| name | code-review |
| description | Review code for correctness, maintainability, performance, and security. Trigger with "review this code", "check this PR", "code review", or "look at this diff". |
Code Review
Review code with structured, prioritized findings.
When to Use
- User shares code or a PR diff for review
- Pre-commit quality check
- Reviewing a specific function or module
Steps
- Read the code and understand its purpose and context
- Check correctness: logic errors, edge cases, error handling, null safety
- Check maintainability: naming, complexity, duplication, readability
- Check performance: unnecessary work, N+1 queries, memory allocation
- Check security: input validation, auth, data exposure, injection
- Categorize findings and provide suggested fixes
Output Format
## Code Review -- [File/PR Name]
### Summary
[1-2 sentence overview of code quality and key concerns]
### Findings
#### Blocking (must fix before merge)
**[B1]** [Title] -- Line [N]
```[language]
// Current code
Issue: [What is wrong and why it matters]
Fix:
// Suggested fix
Warning (should fix)
[W1] [Title] -- Line [N]
[Same format]
Suggestion (nice to have)
[S1] [Title]
[Suggestion with reasoning]
Positives
Summary
- Blocking: [N] | Warning: [N] | Suggestion: [N]
- Recommendation: [Approve / Request changes]