| name | review-workflow |
| description | Code review framework: 5-category evaluation, structured output format, severity levels. Load when performing thorough code reviews of changes, diffs, or pull requests. |
Code Review Framework
Structured approach to evaluating code changes for quality, correctness, and maintainability.
<review_categories>
1. Style & Conventions
- Language-specific style guide adherence
- Consistency with existing codebase patterns
- Naming conventions (variables, functions, classes)
- Formatting and readability
2. Bugs & Logic
- Logical errors, unhandled edge cases
- Null/undefined checks, error handling
- Resource leaks (memory, file handles, connections)
- Race conditions, concurrency issues
- Security vulnerabilities (injection, XSS, etc.)
- Off-by-one errors, boundary conditions
3. Performance
- Algorithmic complexity
- Unnecessary computations, redundant operations
- Memory usage patterns
- Database query optimization
- Hot path efficiency
4. Maintainability
- Code clarity, self-documentation
- Function/class size, single responsibility
- Coupling and cohesion
- Code duplication (DRY)
- Testability and modularity
5. Documentation
- Inline comments for complex logic
- Function/class docstrings
- README updates for API changes
- Changelog entries for significant changes
</review_categories>
1. **Context**: understand the purpose and scope of the change
2. **Line-by-line**: review each changed line critically, use grep/ast-grep to understand surrounding context
3. **Holistic**: assess architectural impact, integration, ripple effects
4. **Action items**: categorize findings by severity
<severity_levels>
- Critical (must fix): bugs, security issues, data loss risks, correctness failures
- Warning (should fix): performance issues, maintainability concerns, missing error handling
- Suggestion (nice to have): style improvements, alternative approaches, future considerations
</severity_levels>
<output_format>
### Summary
- Overall: [approve / request changes / needs discussion]
- Scope: [what changed]
- Issues: [N critical, N warning, N suggestion]
### Critical Issues
- [ ] file:line — description. Impact: ... Fix: ...
### Warnings
- [ ] file:line — description. Rationale: ... Recommendation: ...
### Suggestions
- [ ] description. Alternative: ...
### Positive
- Good practices observed
- Well-designed sections
### Checklist
- [ ] Builds successfully
- [ ] Tests pass
- [ ] No security vulnerabilities
- [ ] Documentation updated
- [ ] Follows project conventions
</output_format>
- Be specific: point to exact lines with concrete examples
- Explain why: include reasoning behind suggestions
- Offer solutions: identify problems and propose fixes
- Acknowledge good work: recognize thoughtful decisions
- Separate severity: distinguish blockers from suggestions
- Focus on code, not the author