code-review
Use this skill when asked to review, audit, critique, or improve any piece of code.
Review Order
Always work through these layers in order. Never skip a layer even if earlier ones look fine.
- Correctness - Does it do what it claims? Are edge cases handled?
- Security - Injection, unvalidated input, exposed secrets, unsafe deserialization.
- Reliability - Error handling, null safety, resource cleanup, race conditions.
- Performance - Unnecessary loops, missing indexes, N+1 queries, unbounded memory.
- Readability - Naming, function length, cyclomatic complexity, dead code.
- Style - Conventions consistent with the surrounding codebase.
Output Format
Structure your review as follows:
## Summary
One paragraph: overall quality signal and the single most important finding.
## Critical (must fix)
Issues that will cause bugs, data loss, or security vulnerabilities.
For each: problem -> why it matters -> specific fix with corrected code snippet.
## Warnings (should fix)
Issues that degrade reliability or maintainability.
Same format: problem -> why -> fix.
## Suggestions (nice to have)
Style, readability, or minor performance improvements.
Brief - one sentence per item is enough.
## Positive notes (optional)
What is done well. Skip if nothing stands out.
Rules
- Never rewrite the entire file unprompted. Fix what was asked about.
- Every Critical and Warning item must include a concrete corrected snippet - not just a description.
- If you are uncertain whether something is a bug or intentional design, say so explicitly.
- Do not flag style issues as Critical. Severity must be accurate.
- If the code is in a specific language, apply language-idiomatic standards (e.g.
Result types in Rust, Option chaining in Swift, context.Context propagation in Go).
Language-Specific Gotchas
See language-notes.md for common pitfalls per language to check during review.
Severity Definitions
| Level |
Meaning |
| Critical |
Will cause a bug, crash, or security issue in production |
| Warning |
Degrades quality, reliability, or maintainability |
| Suggestion |
Improvement only - no functional impact |
1---2name: code-review-253description: code-review4---5# code-review67Use this skill when asked to review, audit, critique, or improve any piece of code.89---1011## Review Order1213Always work through these layers in order. Never skip a layer even if earlier ones look fine.14151. **Correctness** - Does it do what it claims? Are edge cases handled?162. **Security** - Injection, unvalidated input, exposed secrets, unsafe deserialization.173. **Reliability** - Error handling, null safety, resource cleanup, race conditions.184. **Performance** - Unnecessary loops, missing indexes, N+1 queries, unbounded memory.195. **Readability** - Naming, function length, cyclomatic complexity, dead code.206. **Style** - Conventions consistent with the surrounding codebase.2122---2324## Output Format2526Structure your review as follows:2728```29## Summary30One paragraph: overall quality signal and the single most important finding.3132## Critical (must fix)33Issues that will cause bugs, data loss, or security vulnerabilities.34For each: problem -> why it matters -> specific fix with corrected code snippet.3536## Warnings (should fix)37Issues that degrade reliability or maintainability.38Same format: problem -> why -> fix.3940## Suggestions (nice to have)41Style, readability, or minor performance improvements.42Brief - one sentence per item is enough.4344## Positive notes (optional)45What is done well. Skip if nothing stands out.46```4748---4950## Rules5152- Never rewrite the entire file unprompted. Fix what was asked about.53- Every Critical and Warning item must include a concrete corrected snippet - not just a description.54- If you are uncertain whether something is a bug or intentional design, say so explicitly.55- Do not flag style issues as Critical. Severity must be accurate.56- If the code is in a specific language, apply language-idiomatic standards (e.g. `Result` types in Rust, `Option` chaining in Swift, `context.Context` propagation in Go).5758---5960## Language-Specific Gotchas6162See `language-notes.md` for common pitfalls per language to check during review.6364---6566## Severity Definitions6768| Level | Meaning |69|---|---|70| Critical | Will cause a bug, crash, or security issue in production |71| Warning | Degrades quality, reliability, or maintainability |72| Suggestion | Improvement only - no functional impact |