From ravie
Use this skill when AI or a developer changed more than a trivial amount of code, touched module boundaries, created components/services/API routes, or modified auth, permissions, database, or RLS logic. Do not use for typo fixes, documentation-only edits, single-line config changes, or changes already reviewed through an equivalent code-review workflow.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ravie:code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Review AI-generated code before it ships. Catches the failure modes that passing checks doesn't: wrong abstractions, magic strings, leaky component boundaries, unnecessary complexity, poor prop shapes.
Review AI-generated code before it ships. Catches the failure modes that passing checks doesn't: wrong abstractions, magic strings, leaky component boundaries, unnecessary complexity, poor prop shapes.
Structured review of code changes — whether from AI generation or manual edits — before committing or opening a PR. This is the quality gate between "checks pass" and "code is actually good."
You MUST use this skill when:
Skip for:
Before reviewing, read rules/karpathy-guidelines.md. Also read rules/git.md for Git/PR changes, rules/supabase.md for database/auth/RLS changes, and rules/ui.md for UI changes.
This review should happen in a separate context to avoid confirmation bias. The main session that wrote the code should not also review it.
If subagents aren't available, do the review in the main session but explicitly switch mode: "Now review the changes as if you're seeing them for the first time."
Correctness
Abstractions
Simplicity
Consistency
Magic values
Security
dangerouslySetInnerHTML without sanitization?Testing
AI-specific antipatterns
?.?.?.) masking broken data flowcounter++)data, result, item, temp)Fix them now, in the current session. Don't defer critical issues.
For medium/low: create follow-up Linear issues if the fix would expand scope.
# Code review — [feature/PR]
## Summary
[1-2 sentences: overall quality assessment]
## Findings
### Critical
- [Finding]: [file:line] — [what's wrong and why it matters]
### High
- [Finding]: [file:line] — [what's wrong and suggested fix]
### Medium
- [Finding]: [file:line] — [what's wrong]
### Low
- [Finding]: [file:line] — [note]
## Verdict
[PASS / PASS WITH FIXES / BLOCK]
## Follow-ups
- [Linear issue for deferred items]
issue-to-pr — invoke between step 11 (full checks) and step 15 (open PR)debug-root-cause — when review reveals a bugsupabase-guardian — when review reveals DB/RLS issuespattern-learner — feed recurring review findings into pattern libraryReviewing in the same context that wrote the code — Claude rationalizes its own choices instead of finding flaws. Always spawn the code-reviewer subagent or run review in a separate session with fresh context.
Treating passing checks as sufficient — typecheck/lint/test passing is necessary but not sufficient. The 8 review dimensions catch issues that automated checks can't: bad abstractions, security holes, AI antipatterns, magic values.
Fixing medium findings by expanding scope — review identifies a problem, "fix" introduces three more files. Keep fixes scoped to the original change. Add follow-up issues for adjacent improvements.
Accepting "I'll fix it later" comments — TODO/FIXME comments accumulate. If the review finds something worth fixing, fix it now or open a Linear issue with concrete acceptance criteria. Don't leave comments in code.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub amnafarzy/ravie --plugin ravie