1---2name: code-review-checklist3description: Skill for the reviewer agent. Structured checklist for reviewing code changes with depth and consistency. Includes severity taxonomy, comment guide, anti-patterns, and domain-specific checklists. Load BEFORE starting any code review.4---56# Code Review Checklist78## Review Methodology (6 Steps)9101. **Scope** — Read PR title, description, linked ticket. Check which files and areas changed.112. **High-level pass** — Does the overall approach make sense? Simpler alternative? Respects architecture?123. **Deep dive** — Read every changed line. Logic correct? Edge cases handled? Tests verify the right behavior?134. **Cross-cutting pass** — Security, performance, observability across the whole change.145. **Craft comments** — Group related feedback, assign severity, write clearly.156. **Follow up** — Verify blocker fixes were applied; approve when all blockers resolved.1617---1819## Severity Taxonomy2021Label every issue so the author can triage at a glance:2223| Severity | Label | Meaning |24|----------|-------|---------|25| 🔴 | `BLOCKER` | Must fix before merge. Bug, security hole, or spec violation. |26| 🟠 | `CRITICAL` | Should fix before merge. Likely causes production bugs. |27| 🟡 | `IMPORTANT` | Should fix, doesn't block merge. May cause future issues. |28| 🔵 | `SUGGESTION` | Nice to have. Quality or maintainability improvement. |29| ⚪ | `NIT` | Style preference only. Never blocks a PR. |3031---3233## The Checklist3435### 1. PR Overview36- [ ] Description explains **what** and **why** (not just how)37- [ ] All changes logically belong in this PR38- [ ] Matches the linked ticket/issue/spec39- [ ] README, docs, or API specs updated if behavior changed4041### 2. Design & Architecture42- [ ] Overall approach makes sense for the problem43- [ ] Follows existing architectural patterns (or diverges with good reason)44- [ ] Abstractions are justified — not premature, not missing45- [ ] Makes future changes easier, not harder4647### 3. Correctness & Functionality48- [ ] Code does what the developer intended49- [ ] Edge cases: empty/null/zero, boundary conditions, invalid input50- [ ] Concurrency: race conditions, deadlocks, atomicity51- [ ] Failure modes: errors, timeouts, partial failures52- [ ] Idempotency where expected (retries won't cause double-processing)5354### 4. Complexity55- [ ] Each function/class does one thing (no "and" in function names)56- [ ] A new developer could understand this within a minute57- [ ] No over-engineering (YAGNI)58- [ ] Cyclomatic complexity reasonable — deep nesting extracted into helpers5960### 5. Security61- [ ] All user/input data validated and sanitized at trust boundaries62- [ ] Auth enforced on every protected path63- [ ] Sensitive data not logged, not exposed in errors, encrypted at rest/transit64- [ ] No injection vulnerabilities: SQL, NoSQL, XSS, command injection, SSRF, path traversal65- [ ] Dependencies checked for known vulnerabilities (if applicable)6667### 6. Tests68- [ ] Tests included in the same PR69- [ ] Happy path and failure/edge cases covered70- [ ] Tests actually fail when corresponding code breaks71- [ ] Test names describe the scenario, not the function7273### 7. Error Handling & Resilience74- [ ] Errors handled explicitly — not swallowed (no bare `except`/`catch`)75- [ ] Error messages meaningful: include context, not just "error"76- [ ] Timeouts set for all external calls77- [ ] Resources cleaned up in all paths (success AND error)7879### 8. Performance80- [ ] No N+1 queries or redundant network requests81- [ ] No obvious algorithmic inefficiencies82- [ ] Resources properly released8384### 9. Naming & Readability85- [ ] Variable, function, class names are descriptive and unambiguous86- [ ] Booleans read naturally: `isActive`, `hasPermission`, `canDelete`87- [ ] Magic numbers/strings extracted to named constants8889### 10. Comments & Documentation90- [ ] Comments explain **why**, not **what**91- [ ] No outdated comments or commented-out code92- [ ] TODOs linked to tickets or have owners9394### 11. Style & Consistency95- [ ] Follows team style guide and project conventions96- [ ] Style nits always prefixed `NIT:` — never block a PR for style9798### 12. Observability & Operations99- [ ] New features covered by logging, metrics, or structured events100- [ ] Log levels appropriate: ERROR for failures, WARN for anomalies, INFO for notable events101- [ ] No PII or secrets logged102103---104105## Comment Crafting106107- **One concern per comment** — don't bury multiple issues in one thread108- **Explain WHY** — "this is wrong because..." is valuable; "this is wrong" is not109- **Be specific** — reference exact lines, not just files110- **Offer alternatives** — "consider using X instead" beats "don't use X"111- **Use "we" or "this line"** — keeps feedback impersonal112- **Acknowledge good code** — at least one positive comment per review113114---115116## Domain-Specific Checks117118### Web / Frontend119- Accessibility: keyboard navigation, screen reader support, color contrast120- Bundle size: new dependencies justified? Code-splitting used?121- State management: cleanup on unmount? Race conditions in async effects?122123### API / Backend124- API contract matches what clients expect; versioning handled125- Request body validated at the boundary126- POST/PUT endpoints handle duplicate requests safely (idempotency)127128### Data / Migrations129- `DROP` or destructive `ALTER` statements — reversible?130- Rollback plan exists and is documented131- Data integrity: constraints, orphaned records handled132133### Infrastructure / Config134- No hardcoded credentials; environment variables used properly135- Service roles and IAM policies follow least privilege136- Dependency/image version changes tested137138---139140## PR Size Strategy141142| Size | Lines | Approach |143|------|-------|----------|144| 🟢 Small | < 200 | Full review using entire checklist |145| 🟡 Medium | 200-500 | Deep review on changed files; quick scan on related files |146| 🟠 Large | 500-1000 | Ask to split. If can't, review by commit or feature boundary |147| 🔴 Excessive | > 1000 | Request smaller PRs before reviewing |148149---150151## Anti-Patterns152153| Anti-Pattern | Do This Instead |154|---|---|155| Rubber-stamping | Read every changed line |156| Bikeshedding on trivial issues | Label nits; never let style block a PR |157| 50+ comments without prioritization | Use severity labels; distinguish blockers from nits |158| Criticizing test style over missing coverage | Fix coverage gaps first |