Code Review Patterns
A language-agnostic framework for conducting comprehensive, context-aware code reviews that provide actionable feedback with real-world impact prioritization.
Core Philosophy
Effective code reviews go beyond surface-level issues to understand root causes and systemic patterns. Focus on providing deep, actionable feedback that considers business context, not just technical correctness.
Key principles:
- Understand project context and conventions before reviewing
- Provide root cause analysis, not just symptoms
- Include working solutions with every issue
- Prioritize by real-world impact
- Adapt to the language and framework of the codebase
Pre-Review Context Gathering
Before reviewing, establish context from the project itself:
- Read project documentation - CLAUDE.md, README, CONTRIBUTING, ARCHITECTURE docs
- Detect conventions - Linting configs, formatting rules, existing patterns
- Understand structure - Directory layout, module organization, naming conventions
- Identify testing patterns - Test framework, assertion style, coverage expectations
- Check language/framework - Adapt review criteria to the stack
The codebase itself defines what "good" looks like - discover and apply those standards.
Root Cause Analysis Framework
For every issue, provide three levels of analysis:
Level 1 - What: The immediate issue observed
Level 2 - Why: Root cause analysis explaining why this happens
Level 3 - How: Specific, actionable solution with working code
This ensures issues are fully understood and solutions address underlying problems, not just symptoms.
Impact-Based Prioritization
Classify every issue by real-world impact:
| Priority |
Label |
Criteria |
Action |
| CRITICAL |
Red |
Security vulnerabilities, data loss risks, privacy violations, production crashes |
Fix immediately |
| HIGH |
Orange |
Performance in hot paths, resource leaks, broken error handling, missing validation |
Fix before merge |
| MEDIUM |
Yellow |
Maintainability issues, inconsistent patterns, missing tests, tech debt in active areas |
Fix soon |
| LOW |
Green |
Style inconsistencies, minor optimizations, documentation gaps |
Fix when convenient |
Prioritization Factors
- User-facing code → Higher priority than internal utilities
- Security-sensitive paths (auth, payments, PII) → Highest priority
- Frequently changed files → Higher priority (high churn = high impact)
- Hot paths (high traffic) → Performance issues more critical
Six Review Aspects
Comprehensive reviews cover six specialized aspects:
- Architecture & Design - Module organization, separation of concerns, design patterns, dependency direction
- Code Quality - Readability, naming, complexity, DRY principles, cognitive load
- Security & Dependencies - Vulnerabilities, auth, input validation, supply chain
- Performance & Scalability - Algorithm complexity, resource usage, async patterns, caching
- Testing Quality - Meaningful assertions, isolation, edge cases, maintainability
- Documentation & API - Self-documenting code, API docs, breaking changes
For detailed guidance on each aspect, see references/review-aspects.md.
Cross-File Intelligence
Comprehensive review requires understanding relationships:
- Component → Tests: Is test coverage adequate?
- Interface → Implementations: Are all implementations consistent?
- Config → Usage: Do usage patterns align with configuration?
- Fix → Call sites: Are all callers handled?
- API change → Documentation: Is documentation updated?
Find related files before concluding a review is complete.
Review Intelligence Layers
Apply five layers of analysis:
- Syntax & Style - Follows project's linting/formatting rules
- Patterns & Practices - Uses established patterns, avoids anti-patterns
- Architectural Alignment - Code in correct layer, proper abstraction level
- Business Logic Coherence - Logic matches requirements, edge cases handled
- Evolution & Maintenance - How code ages, testability, extensibility
Solution-Oriented Feedback
Never just identify problems - always show the fix. A quality issue report includes:
- Issue title with file location
- Impact - Real-world consequence
- Root cause - Why this happens
- Solution - Working code in the project's language/style
- Alternatives (optional) - Other valid approaches
Adapt solutions to match the codebase's existing patterns and conventions.
Review Output Template
Structure feedback consistently:
# Code Review: [Scope]
## Review Metrics
- **Files Reviewed**: X
- **Critical Issues**: X
- **High Priority**: X
- **Medium Priority**: X
- **Suggestions**: X
## Executive Summary
[2-3 sentences summarizing the most important findings]
## CRITICAL Issues (Must Fix)
[Issues with root cause analysis and working solutions]
## HIGH Priority (Fix Before Merge)
[Issues with root cause analysis and working solutions]
## MEDIUM Priority (Fix Soon)
[Issues with root cause analysis and working solutions]
## LOW Priority (Opportunities)
[Suggestions and minor improvements]
## Strengths
[What's done well, patterns worth replicating]
## Proactive Suggestions
[Opportunities beyond identified issues]
## Systemic Patterns
[Issues appearing multiple times - candidates for team discussion]
Additional Resources
Reference Files
For detailed patterns and guidance, consult:
references/focus-areas.md - Canonical definitions of the 6 focus areas with priority factors
references/review-aspects.md - Deep dive into each review aspect with checklists
Success Criteria
A quality review should:
- Understand project context and conventions first
- Adapt to the language and framework in use
- Provide root cause analysis, not just symptoms
- Include working solutions in the project's style
- Prioritize by real-world impact
- Consider evolution and maintenance
- Reference existing patterns in the codebase
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: code-review-patterns-23description: This skill should be used when the user asks about "code review best practices", "how to review code", "review methodology", "code review framework", "impact prioritization", "root cause analysis", or needs guidance on systematic code review approaches and output templates. Use when this capability is needed.4---56# Code Review Patterns78A language-agnostic framework for conducting comprehensive, context-aware code reviews that provide actionable feedback with real-world impact prioritization.910## Core Philosophy1112Effective code reviews go beyond surface-level issues to understand root causes and systemic patterns. Focus on providing deep, actionable feedback that considers business context, not just technical correctness.1314**Key principles:**15- Understand project context and conventions before reviewing16- Provide root cause analysis, not just symptoms17- Include working solutions with every issue18- Prioritize by real-world impact19- Adapt to the language and framework of the codebase2021## Pre-Review Context Gathering2223Before reviewing, establish context from the project itself:24251. **Read project documentation** - CLAUDE.md, README, CONTRIBUTING, ARCHITECTURE docs262. **Detect conventions** - Linting configs, formatting rules, existing patterns273. **Understand structure** - Directory layout, module organization, naming conventions284. **Identify testing patterns** - Test framework, assertion style, coverage expectations295. **Check language/framework** - Adapt review criteria to the stack3031The codebase itself defines what "good" looks like - discover and apply those standards.3233## Root Cause Analysis Framework3435For every issue, provide three levels of analysis:3637**Level 1 - What**: The immediate issue observed38**Level 2 - Why**: Root cause analysis explaining why this happens39**Level 3 - How**: Specific, actionable solution with working code4041This ensures issues are fully understood and solutions address underlying problems, not just symptoms.4243## Impact-Based Prioritization4445Classify every issue by real-world impact:4647| Priority | Label | Criteria | Action |48|----------|-------|----------|--------|49| CRITICAL | Red | Security vulnerabilities, data loss risks, privacy violations, production crashes | Fix immediately |50| HIGH | Orange | Performance in hot paths, resource leaks, broken error handling, missing validation | Fix before merge |51| MEDIUM | Yellow | Maintainability issues, inconsistent patterns, missing tests, tech debt in active areas | Fix soon |52| LOW | Green | Style inconsistencies, minor optimizations, documentation gaps | Fix when convenient |5354### Prioritization Factors5556- **User-facing code** → Higher priority than internal utilities57- **Security-sensitive paths** (auth, payments, PII) → Highest priority58- **Frequently changed files** → Higher priority (high churn = high impact)59- **Hot paths** (high traffic) → Performance issues more critical6061## Six Review Aspects6263Comprehensive reviews cover six specialized aspects:64651. **Architecture & Design** - Module organization, separation of concerns, design patterns, dependency direction662. **Code Quality** - Readability, naming, complexity, DRY principles, cognitive load673. **Security & Dependencies** - Vulnerabilities, auth, input validation, supply chain684. **Performance & Scalability** - Algorithm complexity, resource usage, async patterns, caching695. **Testing Quality** - Meaningful assertions, isolation, edge cases, maintainability706. **Documentation & API** - Self-documenting code, API docs, breaking changes7172For detailed guidance on each aspect, see `references/review-aspects.md`.7374## Cross-File Intelligence7576Comprehensive review requires understanding relationships:7778- **Component → Tests**: Is test coverage adequate?79- **Interface → Implementations**: Are all implementations consistent?80- **Config → Usage**: Do usage patterns align with configuration?81- **Fix → Call sites**: Are all callers handled?82- **API change → Documentation**: Is documentation updated?8384Find related files before concluding a review is complete.8586## Review Intelligence Layers8788Apply five layers of analysis:89901. **Syntax & Style** - Follows project's linting/formatting rules912. **Patterns & Practices** - Uses established patterns, avoids anti-patterns923. **Architectural Alignment** - Code in correct layer, proper abstraction level934. **Business Logic Coherence** - Logic matches requirements, edge cases handled945. **Evolution & Maintenance** - How code ages, testability, extensibility9596## Solution-Oriented Feedback9798Never just identify problems - always show the fix. A quality issue report includes:991001. **Issue title** with file location1012. **Impact** - Real-world consequence1023. **Root cause** - Why this happens1034. **Solution** - Working code in the project's language/style1045. **Alternatives** (optional) - Other valid approaches105106Adapt solutions to match the codebase's existing patterns and conventions.107108## Review Output Template109110Structure feedback consistently:111112```markdown113# Code Review: [Scope]114115## Review Metrics116- **Files Reviewed**: X117- **Critical Issues**: X118- **High Priority**: X119- **Medium Priority**: X120- **Suggestions**: X121122## Executive Summary123[2-3 sentences summarizing the most important findings]124125## CRITICAL Issues (Must Fix)126[Issues with root cause analysis and working solutions]127128## HIGH Priority (Fix Before Merge)129[Issues with root cause analysis and working solutions]130131## MEDIUM Priority (Fix Soon)132[Issues with root cause analysis and working solutions]133134## LOW Priority (Opportunities)135[Suggestions and minor improvements]136137## Strengths138[What's done well, patterns worth replicating]139140## Proactive Suggestions141[Opportunities beyond identified issues]142143## Systemic Patterns144[Issues appearing multiple times - candidates for team discussion]145```146147## Additional Resources148149### Reference Files150151For detailed patterns and guidance, consult:152- **`references/focus-areas.md`** - Canonical definitions of the 6 focus areas with priority factors153- **`references/review-aspects.md`** - Deep dive into each review aspect with checklists154155### Success Criteria156157A quality review should:158- Understand project context and conventions first159- Adapt to the language and framework in use160- Provide root cause analysis, not just symptoms161- Include working solutions in the project's style162- Prioritize by real-world impact163- Consider evolution and maintenance164- Reference existing patterns in the codebase165166---167> Converted and distributed by [TomeVault](https://tomevault.io/claim/betamatt) — claim your Tome and manage your conversions.168<!-- tomevault:4.0:skill_md:2026-04-14 -->