Code Review Checklist Generator
Generate thorough, contextual code review checklists that route attention to highest-risk areas based on what actually changed, not generic advice.
Decision Points: Route by Change Type
Step 1: Scan PR title, description, and git diff summary to classify change type
Step 2: Apply corresponding decision tree, checking items in priority order
IF New Feature:
├─ Security First: Does change touch auth, user input, or data access?
│ ├─ YES → Check input validation, auth boundaries, SQL injection vectors
│ └─ NO → Skip to API review
├─ API Surface: New public methods minimal? Could interface be smaller?
├─ Edge Cases: Test null/empty/max inputs, concurrent access, network failures
└─ Backwards Compatibility: Migration path for breaking changes?
IF Bug Fix:
├─ Triage Severity: Critical (security/data loss) vs Normal vs Cosmetic
│ ├─ CRITICAL → Verify fix addresses root cause, add regression test
│ ├─ NORMAL → Check blast radius, search for similar patterns
│ └─ COSMETIC → Ensure fix doesn't introduce complexity
├─ Root Cause: Comment explains WHY bug occurred, not just what changed
└─ Test Coverage: Regression test fails on old code, passes on new
IF Refactoring:
├─ Behavior Preservation Check: Do existing tests pass unmodified?
│ ├─ YES → Focus on performance implications
│ └─ NO → Require explanation for each test change
├─ No Feature Smuggling: Are behavior changes documented/intentional?
├─ Incremental Safety: Could split into smaller PRs to reduce risk?
└─ Performance Impact: New allocations, DB calls, or O(n) changes?
IF Dependencies:
├─ Version Jump Size: Patch vs Minor vs Major update
│ ├─ MAJOR → Read breaking changes, check for API usage
│ ├─ MINOR → Verify new features don't auto-enable unsafely
│ └─ PATCH → Quick security scan, verify lockfile consistency
├─ Security Focus: Does update address CVE? Check for new vulnerabilities
└─ Bundle Impact: Frontend deps - check bundle size growth
IF Config/Infrastructure:
├─ Secret Exposure: Scan for API keys, passwords, tokens in plain text
├─ Rollback Safety: Can revert without data loss or downtime?
├─ Environment Consistency: Does change work across dev/staging/prod?
└─ Deployment Dependencies: Required manual steps documented?
Failure Modes
Rubber Stamp Review
- Detection: Approval under 2 minutes on 500+ line PR, no substantive comments, generic "LGTM"
- Root Cause: Social pressure to not block, review fatigue, didn't actually read code
- Fix: Require one substantive comment per 100 lines changed OR explicit "trivial change" justification
Logic Blindness
- Detection: 10+ style/format comments, zero comments on correctness, error handling, or edge cases
- Root Cause: Style issues are cognitively cheap to spot, logic bugs require understanding control flow
- Fix: Automate style checks, explicitly ignore formatting in review, focus first pass on "what breaks if this runs twice?"
Authorization Gap Miss
- Detection: Approved endpoint/route changes without checking permission boundaries or user access controls
- Root Cause: No systematic scan for auth implications when request handlers change
- Fix: For any route/handler change, trace: "Who can call this? What must they prove? What data can they access?"
Test Theater Approval
- Detection: Approved based on test file existence without verifying tests actually validate the changed behavior
- Root Cause: Treating tests as documentation rather than executable specifications
- Fix: For each new/modified test, ask: "Does this fail on the old code? What specific behavior does it prove works?"
Scope Creep Review
- Detection: Reviewer requests unrelated features: "while you're here, also refactor X" or "can you add Y feature too?"
- Root Cause: Conflating code review with design session, treating PR as infinitely expandable
- Fix: File unrelated suggestions as separate issues, evaluate PR strictly against its stated scope
Worked Examples
Example 1: SQL Injection in User Search
PR: "Add advanced user search with role filtering"
Files: routes/users.js, services/userSearch.js, test/search.test.js
Decision Tree Application:
- Change Type: New Feature → Check security first
- Security Scan: Route accepts user input → Examine query construction
- Code Analysis:
userSearch.js line 23: SELECT * FROM users WHERE name LIKE '%${req.query.name}%'
- Vulnerability Found: Direct string interpolation in SQL query
What Novice Misses:
- Tests exist and pass ✓
- Feature works as described ✓
- Code follows style guide ✓
- Misses: SQL injection vector in search parameter
Expert Catches:
- String interpolation
${req.query.name} allows injection
- Test inputs are benign ("john", "admin") - missing malicious cases
- No input sanitization before query construction
- Action: Block with "SQL injection risk - use parameterized queries. Add test with injection payload."
Example 2: Race Condition in Payment Flow
PR: "Remove transaction wrapper for better performance"
Files: services/payment.js - removes database transaction
Decision Tree Application:
- Change Type: Refactoring → Check behavior preservation
- Test Analysis: Existing tests still pass → Dig deeper into what changed
- Code Diff: Removed
db.transaction() wrapper around payment operations
- Race Condition: Status update and balance deduction now separate operations
What Novice Misses:
- Fewer lines of code ✓
- Tests still pass ✓
- Performance improvement mentioned ✓
- Misses: Atomicity requirement for financial operations
Expert Catches:
- Transaction removal breaks ACID properties
- Crash between operations leaves inconsistent state
- Tests don't cover partial failure scenarios
- Action: Block with "Removing transaction creates race condition. Payment could be marked complete without balance deduction."
Quality Gates
Mark review complete only when ALL conditions verified:
NOT-FOR Boundaries
This skill should NOT be used for:
- High-level architecture discussions - use
system-design skill instead
- Performance optimization strategies - use
performance-optimization skill
- Comprehensive security threat modeling - use
security-review skill
- Code style/formatting enforcement - use automated linting tools
- Technology selection decisions - use
technical-decision-making skill
Delegate when:
- PR introduces new architectural patterns →
system-design
- Performance issues beyond obvious inefficiencies →
performance-optimization
- Security changes affecting authentication/authorization systems →
security-review
- Complex database migrations with data transformation →
database-design
- Framework or technology stack changes →
technical-decision-making
1---2name: code-review-checklist3description: Generates comprehensive, context-aware code review checklists tailored to the specific codebase, programming language, and team standards. Analyzes PR diffs and suggests what reviewers should focus on.4license: Apache-2.05---6
7# Code Review Checklist Generator
8
9Generate thorough, contextual code review checklists that route attention to highest-risk areas based on what actually changed, not generic advice.
10
11## Decision Points: Route by Change Type
12
13**Step 1**: Scan PR title, description, and git diff summary to classify change type
14**Step 2**: Apply corresponding decision tree, checking items in priority order
15
16```
17IF New Feature:
18├─ Security First: Does change touch auth, user input, or data access?
19│ ├─ YES → Check input validation, auth boundaries, SQL injection vectors
20│ └─ NO → Skip to API review
21├─ API Surface: New public methods minimal? Could interface be smaller?
22├─ Edge Cases: Test null/empty/max inputs, concurrent access, network failures
23└─ Backwards Compatibility: Migration path for breaking changes?
24
25IF Bug Fix:
26├─ Triage Severity: Critical (security/data loss) vs Normal vs Cosmetic
27│ ├─ CRITICAL → Verify fix addresses root cause, add regression test
28│ ├─ NORMAL → Check blast radius, search for similar patterns
29│ └─ COSMETIC → Ensure fix doesn't introduce complexity
30├─ Root Cause: Comment explains WHY bug occurred, not just what changed
31└─ Test Coverage: Regression test fails on old code, passes on new
32
33IF Refactoring:
34├─ Behavior Preservation Check: Do existing tests pass unmodified?
35│ ├─ YES → Focus on performance implications
36│ └─ NO → Require explanation for each test change
37├─ No Feature Smuggling: Are behavior changes documented/intentional?
38├─ Incremental Safety: Could split into smaller PRs to reduce risk?
39└─ Performance Impact: New allocations, DB calls, or O(n) changes?
40
41IF Dependencies:
42├─ Version Jump Size: Patch vs Minor vs Major update
43│ ├─ MAJOR → Read breaking changes, check for API usage
44│ ├─ MINOR → Verify new features don't auto-enable unsafely
45│ └─ PATCH → Quick security scan, verify lockfile consistency
46├─ Security Focus: Does update address CVE? Check for new vulnerabilities
47└─ Bundle Impact: Frontend deps - check bundle size growth
48
49IF Config/Infrastructure:
50├─ Secret Exposure: Scan for API keys, passwords, tokens in plain text
51├─ Rollback Safety: Can revert without data loss or downtime?
52├─ Environment Consistency: Does change work across dev/staging/prod?
53└─ Deployment Dependencies: Required manual steps documented?
54```
55
56## Failure Modes
57
58### Rubber Stamp Review
59- **Detection**: Approval under 2 minutes on 500+ line PR, no substantive comments, generic "LGTM"
60- **Root Cause**: Social pressure to not block, review fatigue, didn't actually read code
61- **Fix**: Require one substantive comment per 100 lines changed OR explicit "trivial change" justification
62
63### Logic Blindness
64- **Detection**: 10+ style/format comments, zero comments on correctness, error handling, or edge cases
65- **Root Cause**: Style issues are cognitively cheap to spot, logic bugs require understanding control flow
66- **Fix**: Automate style checks, explicitly ignore formatting in review, focus first pass on "what breaks if this runs twice?"
67
68### Authorization Gap Miss
69- **Detection**: Approved endpoint/route changes without checking permission boundaries or user access controls
70- **Root Cause**: No systematic scan for auth implications when request handlers change
71- **Fix**: For any route/handler change, trace: "Who can call this? What must they prove? What data can they access?"
72
73### Test Theater Approval
74- **Detection**: Approved based on test file existence without verifying tests actually validate the changed behavior
75- **Root Cause**: Treating tests as documentation rather than executable specifications
76- **Fix**: For each new/modified test, ask: "Does this fail on the old code? What specific behavior does it prove works?"
77
78### Scope Creep Review
79- **Detection**: Reviewer requests unrelated features: "while you're here, also refactor X" or "can you add Y feature too?"
80- **Root Cause**: Conflating code review with design session, treating PR as infinitely expandable
81- **Fix**: File unrelated suggestions as separate issues, evaluate PR strictly against its stated scope
82
83## Worked Examples
84
85### Example 1: SQL Injection in User Search
86
87**PR**: "Add advanced user search with role filtering"
88**Files**: `routes/users.js`, `services/userSearch.js`, `test/search.test.js`
89
90**Decision Tree Application**:
911. **Change Type**: New Feature → Check security first
922. **Security Scan**: Route accepts user input → Examine query construction
933. **Code Analysis**: `userSearch.js` line 23: `SELECT * FROM users WHERE name LIKE '%${req.query.name}%'`
944. **Vulnerability Found**: Direct string interpolation in SQL query
95
96**What Novice Misses**:
97- Tests exist and pass ✓
98- Feature works as described ✓
99- Code follows style guide ✓
100- **Misses**: SQL injection vector in search parameter
101
102**Expert Catches**:
103- String interpolation `${req.query.name}` allows injection
104- Test inputs are benign ("john", "admin") - missing malicious cases
105- No input sanitization before query construction
106- **Action**: Block with "SQL injection risk - use parameterized queries. Add test with injection payload."
107
108### Example 2: Race Condition in Payment Flow
109
110**PR**: "Remove transaction wrapper for better performance"
111**Files**: `services/payment.js` - removes database transaction
112
113**Decision Tree Application**:
1141. **Change Type**: Refactoring → Check behavior preservation
1152. **Test Analysis**: Existing tests still pass → Dig deeper into what changed
1163. **Code Diff**: Removed `db.transaction()` wrapper around payment operations
1174. **Race Condition**: Status update and balance deduction now separate operations
118
119**What Novice Misses**:
120- Fewer lines of code ✓
121- Tests still pass ✓
122- Performance improvement mentioned ✓
123- **Misses**: Atomicity requirement for financial operations
124
125**Expert Catches**:
126- Transaction removal breaks ACID properties
127- Crash between operations leaves inconsistent state
128- Tests don't cover partial failure scenarios
129- **Action**: Block with "Removing transaction creates race condition. Payment could be marked complete without balance deduction."
130
131## Quality Gates
132
133Mark review complete only when ALL conditions verified:
134
135- [ ] Every changed file examined (not just GitHub diff preview)
136- [ ] Security implications assessed for any user input, auth, or data access changes
137- [ ] Test coverage verified: new code paths tested, modified paths have updated tests
138- [ ] At least one substantive logic/correctness comment per 100 lines OR explicit "trivial" justification
139- [ ] All blocking issues resolved (no outstanding "request changes" items)
140- [ ] Can explain PR purpose and technical approach to uninvolved teammate
141- [ ] For data operations: authorization verified, audit logging confirmed
142- [ ] For schema changes: migration tested, rollback plan documented
143- [ ] For API changes: backwards compatibility confirmed or breaking change explicitly noted
144- [ ] Non-trivial changes tested locally (not just code reading)
145
146## NOT-FOR Boundaries
147
148**This skill should NOT be used for**:
149- High-level architecture discussions - use `system-design` skill instead
150- Performance optimization strategies - use `performance-optimization` skill
151- Comprehensive security threat modeling - use `security-review` skill
152- Code style/formatting enforcement - use automated linting tools
153- Technology selection decisions - use `technical-decision-making` skill
154
155**Delegate when**:
156- PR introduces new architectural patterns → `system-design`
157- Performance issues beyond obvious inefficiencies → `performance-optimization`
158- Security changes affecting authentication/authorization systems → `security-review`
159- Complex database migrations with data transformation → `database-design`
160- Framework or technology stack changes → `technical-decision-making`