Code Review Standards
Purpose
Define standards for effective code reviews that improve code quality, share knowledge, and maintain team velocity.
Goals:
- Quality gate: catch bugs, security issues, and design problems early
- Knowledge sharing: spread understanding of the codebase across the team
- Consistency: maintain coding standards and architectural patterns
- Velocity: provide timely, actionable feedback
When to use
Use the code-review-standards skill when:
- Reviewing pull requests / merge requests
- Preparing code for review (self-review checklist)
- Setting up team review guidelines
- Resolving review disagreements
Inputs
- Code diff to review
- PR description and context
- Related requirements or design docs (if applicable)
- Team coding standards and conventions
Outputs
- Review comments with clear, actionable feedback
- Approval/request-changes decision with rationale
- Knowledge transfer notes (if significant patterns discovered)
Steps
- Read the change summary and identify the intent, blast radius, and any high-risk areas.
- Review correctness first (behavior, edge cases, error handling, and failure modes).
- Review maintainability next (structure, naming, tests, and clarity of intent).
- Classify feedback by severity (blocker / major / minor / nit) and make each comment actionable.
- Confirm verification evidence exists (tests, logs, screenshots, or a reproducible manual check), or request it explicitly.
Review Scope (MUST check)
Correctness
- Does the code do what it claims to do?
- Are edge cases handled?
- Are error conditions handled appropriately?
Security
- No hardcoded secrets or credentials
- Input validation present for external data
- No obvious injection vulnerabilities (SQL, XSS, etc.)
- Proper authorization checks
Performance
- No obvious N+1 queries or unnecessary loops
- Appropriate use of caching/memoization
- No blocking operations in hot paths
Maintainability
- Code is readable and self-documenting
- Functions/methods have single responsibility
- No unnecessary complexity
- Appropriate abstraction level
Testing
- New functionality has tests
- Tests cover happy path and key edge cases
- Tests are readable and maintainable
Feedback Quality Rules (MUST)
Be Specific
- ❌ "The comment is confusing"
- ✅ "The variable name
x doesn't convey its purpose. Consider userCount or activeUsers"
Be Constructive
- ❌ "The change is wrong"
- ✅ "The approach may cause issues when X happens. Consider using Y pattern instead"
Distinguish Severity
Use prefixes to clarify feedback importance:
[blocker] - Must fix before merge
[suggestion] - Nice to have, author decides
[question] - Seeking clarification
[nit] - Minor style issue, optional fix
Provide Context
- Explain why, not just what
- Link to relevant documentation or examples
- Mention if something is a team convention vs personal preference
Approval Criteria (SHOULD)
Approve when:
- All blockers are resolved
- Code meets minimum quality bar
- Tests pass and coverage is acceptable
- No security concerns
Request changes when:
- Blockers exist that must be addressed
- Security vulnerabilities identified
- Critical functionality missing or broken
Self-Review Checklist (Before Requesting Review)
Common Review Patterns
The "LGTM" Review
- Avoid rubber-stamp approvals
- Even quick reviews should note what was checked
The Nitpick Storm
- Batch minor issues together
- Mark clearly as
[nit] or [suggestion]
- Don't block on style-only issues
The Architecture Debate
- Large design discussions belong in design docs, not PR comments
- If significant rework needed, discuss synchronously first
The Stale Review
- Reviews SHOULD be completed within 1 business day
- If blocked, communicate timeline to author
Boundaries
- Do NOT approve without actually reading the code
- Do NOT block on personal style preferences that aren't team standards
- Do NOT leave vague feedback without actionable suggestions
- Do NOT let reviews become gatekeeping or power dynamics
Verification
Review quality checklist:
- Feedback is specific and actionable
- Severity is clearly indicated
- Blockers are justified with reasoning
- Response time is reasonable
Included assets
None.
1---2name: code-review-standards3description: Apply consistent code review standards - covers review scope, feedback quality, approval criteria, and common review patterns.4---56# Code Review Standards78## Purpose910Define standards for effective code reviews that improve code quality, share knowledge, and maintain team velocity.1112Goals:13- **Quality gate**: catch bugs, security issues, and design problems early14- **Knowledge sharing**: spread understanding of the codebase across the team15- **Consistency**: maintain coding standards and architectural patterns16- **Velocity**: provide timely, actionable feedback1718## When to use1920Use the code-review-standards skill when:21- Reviewing pull requests / merge requests22- Preparing code for review (self-review checklist)23- Setting up team review guidelines24- Resolving review disagreements2526## Inputs2728- Code diff to review29- PR description and context30- Related requirements or design docs (if applicable)31- Team coding standards and conventions3233## Outputs3435- Review comments with clear, actionable feedback36- Approval/request-changes decision with rationale37- Knowledge transfer notes (if significant patterns discovered)383940## Steps411. Read the change summary and identify the intent, blast radius, and any high-risk areas.422. Review correctness first (behavior, edge cases, error handling, and failure modes).433. Review maintainability next (structure, naming, tests, and clarity of intent).444. Classify feedback by severity (blocker / major / minor / nit) and make each comment actionable.455. Confirm verification evidence exists (tests, logs, screenshots, or a reproducible manual check), or request it explicitly.4647## Review Scope (MUST check)4849### Correctness5051- Does the code do what it claims to do?52- Are edge cases handled?53- Are error conditions handled appropriately?5455### Security5657- No hardcoded secrets or credentials58- Input validation present for external data59- No obvious injection vulnerabilities (SQL, XSS, etc.)60- Proper authorization checks6162### Performance6364- No obvious N+1 queries or unnecessary loops65- Appropriate use of caching/memoization66- No blocking operations in hot paths6768### Maintainability6970- Code is readable and self-documenting71- Functions/methods have single responsibility72- No unnecessary complexity73- Appropriate abstraction level7475### Testing7677- New functionality has tests78- Tests cover happy path and key edge cases79- Tests are readable and maintainable8081## Feedback Quality Rules (MUST)8283### Be Specific8485- ❌ "The comment is confusing"86- ✅ "The variable name `x` doesn't convey its purpose. Consider `userCount` or `activeUsers`"8788### Be Constructive8990- ❌ "The change is wrong"91- ✅ "The approach may cause issues when X happens. Consider using Y pattern instead"9293### Distinguish Severity9495Use prefixes to clarify feedback importance:96- `[blocker]` - Must fix before merge97- `[suggestion]` - Nice to have, author decides98- `[question]` - Seeking clarification99- `[nit]` - Minor style issue, optional fix100101### Provide Context102103- Explain **why**, not just **what**104- Link to relevant documentation or examples105- Mention if something is a team convention vs personal preference106107## Approval Criteria (SHOULD)108109Approve when:110- All blockers are resolved111- Code meets minimum quality bar112- Tests pass and coverage is acceptable113- No security concerns114115Request changes when:116- Blockers exist that must be addressed117- Security vulnerabilities identified118- Critical functionality missing or broken119120## Self-Review Checklist (Before Requesting Review)121122- [ ] Code compiles and tests pass locally123- [ ] PR description explains what and why124- [ ] No commented-out code or debug statements125- [ ] No unrelated changes mixed in126- [ ] Sensitive data removed (secrets, personal info)127- [ ] Documentation updated if needed128129## Common Review Patterns130131### The "LGTM" Review132133- Avoid rubber-stamp approvals134- Even quick reviews should note what was checked135136### The Nitpick Storm137138- Batch minor issues together139- Mark clearly as `[nit]` or `[suggestion]`140- Don't block on style-only issues141142### The Architecture Debate143144- Large design discussions belong in design docs, not PR comments145- If significant rework needed, discuss synchronously first146147### The Stale Review148149- Reviews SHOULD be completed within 1 business day150- If blocked, communicate timeline to author151152## Boundaries153154- Do NOT approve without actually reading the code155- Do NOT block on personal style preferences that aren't team standards156- Do NOT leave vague feedback without actionable suggestions157- Do NOT let reviews become gatekeeping or power dynamics158159## Verification160161Review quality checklist:162- Feedback is specific and actionable163- Severity is clearly indicated164- Blockers are justified with reasoning165- Response time is reasonable166167## Included assets168169None.