Code Review Checklist
One review answers a single question: "Will this code become someone else's problem within three months?" Walk the five axes in order; each axis gets pass / fail / N-A, and every failure must come with a concrete fix.
Workflow
- Check the scope first: look at the diff size. Over ~400 changed lines, ask for a split before reviewing — review quality on huge diffs always collapses.
- Check axis by axis (order = priority):
- Correctness: edge cases (null, empty, zero, negative, oversized), concurrency/timing assumptions, error handling (are exceptions swallowed?). The only axis that can block a merge.
- Security: is user input concatenated into SQL / shell commands / HTML; are secrets or tokens hard-coded; does logging leak sensitive data.
- Readability: do names say what things are; does each function do one thing; are magic numbers named. Flag only what you can't understand — not "I'd write it differently."
- Performance: repeated queries or recomputation inside loops; N+1 problems; avoidable large-object copies. No data-free performance speculation ("this might get slow" is not a comment).
- Test coverage: does new logic have tests; do edge cases have cases. All-green tests with the critical path uncovered still get sent back.
- Write the comments: fixed format —
[axis] file:line problem → suggested fix. Only actionable suggestions; "could be optimized" is not one.
- Triage:
Must fix (correctness / security) vs Should fix (readability / performance / tests). "Should fix" doesn't block the merge, but say so explicitly.
Rules
- At most 10 comments per review. More than that means the code is too broken — send it back for a rewrite instead of grading 50 items.
- No style policing: indentation, quotes, semicolons — that's the linter's job, not a human's.
- Speak with the diff: every comment must cite a concrete line of code. A comment without a code reference is invalid.
Checklist (minimal executable version)
## Code review checklist
- [ ] Correctness: edge cases (null/0/negative/oversized) handled, exceptions not swallowed
- [ ] Correctness: concurrency/timing assumptions hold, no races
- [ ] Security: no SQL/shell/HTML injection points, no hard-coded secrets, no sensitive data in logs
- [ ] Readability: names are descriptive, functions have a single responsibility, no magic numbers
- [ ] Performance: no repeated queries/computation in loops, no N+1, no evidence-free performance worries
- [ ] Tests: new logic is covered, edge cases have cases
- [ ] Scope: diff ≤ ~400 lines, otherwise split first
Example review comments:
[Must fix][Correctness] order.py:87 empty order list triggers IndexError → guard for empty before taking [0]
[Should fix][Readability] order.py:92 magic number 86400 → name it SECONDS_PER_DAY
Anti-patterns
- ❌ Drive-by LGTM: approving before reading the whole diff — the review is theater.
- ❌ Style police: 18 of 20 comments about quotes and line breaks while a null-pointer dereference slips through.
- ❌ Comments without code: "this logic looks off" — which logic? Which line? Unsaid means invalid.
- ❌ Performance speculation: "this loop might be slow at scale" — a performance comment without data is noise.
- ❌ Grading 50 items: when there are too many problems to list, the right move is "rewrite and resubmit", not playing teacher.
1---2name: code-review-checklist3description: Five-axis code review checklist (correctness, security, readability, performance, test coverage) producing actionable comments instead of style nitpicks. Use when the user asks to review code, a diff, or a pull request.4license: MIT5---67# Code Review Checklist89One review answers a single question: "Will this code become someone else's problem within three months?" Walk the five axes in order; each axis gets pass / fail / N-A, and every failure must come with a concrete fix.1011## Workflow12131. **Check the scope first**: look at the diff size. Over ~400 changed lines, ask for a split before reviewing — review quality on huge diffs always collapses.142. **Check axis by axis** (order = priority):15 - **Correctness**: edge cases (null, empty, zero, negative, oversized), concurrency/timing assumptions, error handling (are exceptions swallowed?). The only axis that can block a merge.16 - **Security**: is user input concatenated into SQL / shell commands / HTML; are secrets or tokens hard-coded; does logging leak sensitive data.17 - **Readability**: do names say what things are; does each function do one thing; are magic numbers named. Flag only what you can't understand — not "I'd write it differently."18 - **Performance**: repeated queries or recomputation inside loops; N+1 problems; avoidable large-object copies. No data-free performance speculation ("this might get slow" is not a comment).19 - **Test coverage**: does new logic have tests; do edge cases have cases. All-green tests with the critical path uncovered still get sent back.203. **Write the comments**: fixed format — `[axis] file:line problem → suggested fix`. Only actionable suggestions; "could be optimized" is not one.214. **Triage**: `Must fix` (correctness / security) vs `Should fix` (readability / performance / tests). "Should fix" doesn't block the merge, but say so explicitly.2223## Rules2425- At most 10 comments per review. More than that means the code is too broken — send it back for a rewrite instead of grading 50 items.26- No style policing: indentation, quotes, semicolons — that's the linter's job, not a human's.27- Speak with the diff: every comment must cite a concrete line of code. A comment without a code reference is invalid.2829## Checklist (minimal executable version)3031```markdown32## Code review checklist3334- [ ] Correctness: edge cases (null/0/negative/oversized) handled, exceptions not swallowed35- [ ] Correctness: concurrency/timing assumptions hold, no races36- [ ] Security: no SQL/shell/HTML injection points, no hard-coded secrets, no sensitive data in logs37- [ ] Readability: names are descriptive, functions have a single responsibility, no magic numbers38- [ ] Performance: no repeated queries/computation in loops, no N+1, no evidence-free performance worries39- [ ] Tests: new logic is covered, edge cases have cases40- [ ] Scope: diff ≤ ~400 lines, otherwise split first41```4243Example review comments:4445```text46[Must fix][Correctness] order.py:87 empty order list triggers IndexError → guard for empty before taking [0]47[Should fix][Readability] order.py:92 magic number 86400 → name it SECONDS_PER_DAY48```4950## Anti-patterns5152- ❌ Drive-by LGTM: approving before reading the whole diff — the review is theater.53- ❌ Style police: 18 of 20 comments about quotes and line breaks while a null-pointer dereference slips through.54- ❌ Comments without code: "this logic looks off" — which logic? Which line? Unsaid means invalid.55- ❌ Performance speculation: "this loop might be slow at scale" — a performance comment without data is noise.56- ❌ Grading 50 items: when there are too many problems to list, the right move is "rewrite and resubmit", not playing teacher.