| name | code-review |
| description | Review code for correctness, style, security, and maintainability. Usage: /code-review <file-or-description> |
code-review
Invoke
/code-review <file-path> # Review a specific file
/code-review <description> # Review based on description
Steps
1. Read the code
Read the target file or files completely. Understand the context.
2. Check for issues in priority order
- Correctness: Does it do what it claims? Logic errors, off-by-ones, null handling
- Security: Injection, auth bypass, secret exposure, OWASP top 10
- Error handling: Silent failures, bare catches, missing validation at boundaries
- Performance: Obvious N+1 queries, unbounded loops, missing indexes
- Style: Consistency with surrounding code, naming, readability
3. Report findings
RESULT: Code review for <target>
🔴 Critical (must fix):
- <issue + line + fix suggestion>
🟡 Important (should fix):
- <issue + line + fix suggestion>
🔵 Nit (optional):
- <issue + line + fix suggestion>
✅ Good patterns noticed:
- <what works well>
STATUS: <clean | issues-found | critical-issues>
Rules
- Prioritize issues by severity — do not bury critical bugs under style nits
- Suggest fixes, not just problems
- Respect existing conventions — do not propose rewrites for style preference
- Be specific: file, line number, what is wrong, what to do instead