Code Review Standards
Systematic approach to code review. Use this skill when:
- Performing code reviews
- Defining review criteria for a project
- Understanding severity levels for findings
- Creating code review documents
Review Focus Areas
Use this checklist when reviewing implementation code:
| Category |
What to Review |
| Architecture Alignment |
Does implementation match Architect's design? Follows system-architecture.md patterns? |
| SOLID Principles |
SRP, OCP, LSP, ISP, DIP violations (load engineering-standards for detection patterns) |
| DRY/YAGNI/KISS |
Duplication, speculative generalization, over-complexity |
| TDD Compliance |
TDD Compliance table present in implementation doc? All rows show test-first? |
| Code Smells |
Long Method, Large Class, Feature Envy, etc. (see engineering-standards) |
| Documentation & Comments |
Appropriate inline comments explaining "why" (not "what"), function docstrings, module-level docs, complex logic explained |
| Naming & Clarity |
Self-documenting names, appropriate abstractions, readable code |
| Error Handling |
Defensive coding, graceful failures, appropriate exceptions |
| Security Quick Scan |
Obvious vulnerabilities (injection, exposed secrets, hardcoded creds) |
| Performance |
Obvious inefficiencies, N+1 patterns, memory leaks |
| Observability |
Appropriate logging, telemetry for debugging |
Severity Levels
| Severity |
Definition |
Action |
| CRITICAL |
Security vulnerability, data loss risk, architectural violation |
REJECT - must fix |
| HIGH |
Anti-pattern, significant maintainability issue, missing tests |
REJECT - must fix |
| MEDIUM |
Code smell, minor design issue, unclear code |
Fix recommended, may approve with comments |
| LOW |
Style preference, minor optimization opportunity |
Note for future, approve |
| INFO |
Observation, suggestion for improvement |
FYI only |
When to Reject
- Any CRITICAL finding → REJECT
- Any HIGH finding → REJECT
- 3+ MEDIUM findings in same file → Consider REJECT
- Pattern of MEDIUM findings across files → Consider REJECT
Finding Format
When documenting findings, use this format:
**[SEVERITY] [Category]**: [Brief title]
- **Location**: `path/to/file.py:L42-L55`
- **Issue**: [What's wrong and why it matters]
- **Recommendation**: [Specific fix suggestion]
Example:
**[HIGH] Documentation**: Missing docstrings on public API
- **Location**: `src/api/handlers.py:L15-L45`
- **Issue**: Public functions `create_user()` and `delete_user()` lack docstrings. Future maintainers won't understand expected inputs/outputs.
- **Recommendation**: Add Google-style docstrings with Args, Returns, and Raises sections.
Code Review Document Template
Create in agent-output/code-review/ matching plan name:
# Code Review: [Plan Name]
**Plan Reference**: `agent-output/planning/[plan-name].md`
**Implementation Reference**: `agent-output/implementation/[plan-name]-implementation.md`
**Date**: [date]
**Reviewer**: Code Reviewer
## Changelog
| Date | Agent Handoff | Request | Summary |
|------|---------------|---------|---------|
| YYYY-MM-DD | [Who handed off] | [What was requested] | [Brief summary] |
## Architecture Alignment
**System Architecture Reference**: `agent-output/architecture/system-architecture.md`
**Alignment Status**: ALIGNED / MINOR_DEVIATIONS / MAJOR_DEVIATIONS
[Assessment of how implementation aligns with architectural decisions]
## TDD Compliance Check
**TDD Table Present**: Yes / No
**All Rows Complete**: Yes / No
**Concerns**: [Any issues with TDD compliance]
## Findings
### Critical
[List of critical findings, or "None"]
### High
[List of high findings, or "None"]
### Medium
[List of medium findings, or "None"]
### Low/Info
[List of low/info findings, or "None"]
## Positive Observations
[Acknowledge good patterns, well-written code, or improvements]
## Verdict
**Status**: APPROVED / APPROVED_WITH_COMMENTS / REJECTED
**Rationale**: [Brief explanation]
## Required Actions
[If rejected: specific list of fixes required]
[If approved with comments: optional improvements]
## Next Steps
[Handoff to Implementer for fixes / Handoff to QA for testing]
Review Best Practices
- Be constructive: Explain WHY something is an issue, not just THAT it's an issue
- Be specific: File paths, line numbers, code snippets
- Provide solutions: Concrete fix suggestions, not just criticism
- Acknowledge good work: Note positive patterns when you see them
- Prioritize: Focus on impactful issues, not nitpicks
- Context matters: Consider the plan's constraints and timeline
1---2name: code-review-standards3description: Code review checklist, severity definitions, and document templates. Load when performing code reviews or defining review criteria.4license: MIT5---67# Code Review Standards89Systematic approach to code review. Use this skill when:10- Performing code reviews11- Defining review criteria for a project12- Understanding severity levels for findings13- Creating code review documents1415---1617## Review Focus Areas1819Use this checklist when reviewing implementation code:2021| Category | What to Review |22|----------|----------------|23| **Architecture Alignment** | Does implementation match Architect's design? Follows system-architecture.md patterns? |24| **SOLID Principles** | SRP, OCP, LSP, ISP, DIP violations (load `engineering-standards` for detection patterns) |25| **DRY/YAGNI/KISS** | Duplication, speculative generalization, over-complexity |26| **TDD Compliance** | TDD Compliance table present in implementation doc? All rows show test-first? |27| **Code Smells** | Long Method, Large Class, Feature Envy, etc. (see `engineering-standards`) |28| **Documentation & Comments** | Appropriate inline comments explaining "why" (not "what"), function docstrings, module-level docs, complex logic explained |29| **Naming & Clarity** | Self-documenting names, appropriate abstractions, readable code |30| **Error Handling** | Defensive coding, graceful failures, appropriate exceptions |31| **Security Quick Scan** | Obvious vulnerabilities (injection, exposed secrets, hardcoded creds) |32| **Performance** | Obvious inefficiencies, N+1 patterns, memory leaks |33| **Observability** | Appropriate logging, telemetry for debugging |3435---3637## Severity Levels3839| Severity | Definition | Action |40|----------|------------|--------|41| **CRITICAL** | Security vulnerability, data loss risk, architectural violation | REJECT - must fix |42| **HIGH** | Anti-pattern, significant maintainability issue, missing tests | REJECT - must fix |43| **MEDIUM** | Code smell, minor design issue, unclear code | Fix recommended, may approve with comments |44| **LOW** | Style preference, minor optimization opportunity | Note for future, approve |45| **INFO** | Observation, suggestion for improvement | FYI only |4647### When to Reject4849- Any CRITICAL finding → REJECT50- Any HIGH finding → REJECT51- 3+ MEDIUM findings in same file → Consider REJECT52- Pattern of MEDIUM findings across files → Consider REJECT5354---5556## Finding Format5758When documenting findings, use this format:5960```markdown61**[SEVERITY] [Category]**: [Brief title]62- **Location**: `path/to/file.py:L42-L55`63- **Issue**: [What's wrong and why it matters]64- **Recommendation**: [Specific fix suggestion]65```6667**Example:**68```markdown69**[HIGH] Documentation**: Missing docstrings on public API70- **Location**: `src/api/handlers.py:L15-L45`71- **Issue**: Public functions `create_user()` and `delete_user()` lack docstrings. Future maintainers won't understand expected inputs/outputs.72- **Recommendation**: Add Google-style docstrings with Args, Returns, and Raises sections.73```7475---7677## Code Review Document Template7879Create in `agent-output/code-review/` matching plan name:8081```markdown82# Code Review: [Plan Name]8384**Plan Reference**: `agent-output/planning/[plan-name].md`85**Implementation Reference**: `agent-output/implementation/[plan-name]-implementation.md`86**Date**: [date]87**Reviewer**: Code Reviewer8889## Changelog9091| Date | Agent Handoff | Request | Summary |92|------|---------------|---------|---------|93| YYYY-MM-DD | [Who handed off] | [What was requested] | [Brief summary] |9495## Architecture Alignment9697**System Architecture Reference**: `agent-output/architecture/system-architecture.md`98**Alignment Status**: ALIGNED / MINOR_DEVIATIONS / MAJOR_DEVIATIONS99100[Assessment of how implementation aligns with architectural decisions]101102## TDD Compliance Check103104**TDD Table Present**: Yes / No105**All Rows Complete**: Yes / No106**Concerns**: [Any issues with TDD compliance]107108## Findings109110### Critical111[List of critical findings, or "None"]112113### High114[List of high findings, or "None"]115116### Medium117[List of medium findings, or "None"]118119### Low/Info120[List of low/info findings, or "None"]121122## Positive Observations123124[Acknowledge good patterns, well-written code, or improvements]125126## Verdict127128**Status**: APPROVED / APPROVED_WITH_COMMENTS / REJECTED129**Rationale**: [Brief explanation]130131## Required Actions132133[If rejected: specific list of fixes required]134[If approved with comments: optional improvements]135136## Next Steps137138[Handoff to Implementer for fixes / Handoff to QA for testing]139```140141---142143## Review Best Practices1441451. **Be constructive**: Explain WHY something is an issue, not just THAT it's an issue1462. **Be specific**: File paths, line numbers, code snippets1473. **Provide solutions**: Concrete fix suggestions, not just criticism1484. **Acknowledge good work**: Note positive patterns when you see them1495. **Prioritize**: Focus on impactful issues, not nitpicks1506. **Context matters**: Consider the plan's constraints and timeline