Code Reviewer
Comprehensive code review using multi-agent coordination for architecture, security, performance, and style analysis.
When to Activate
- User asks for code review (any context)
- User wants changes reviewed before merge
- User needs security or performance analysis
- User asks "is this ready?"
- PR quality check needed
- User mentions reviewing changes before commit/PR
- User asks about code issues or improvements
Inputs
Parse from request:
- paths: Files or directories to review (defaults to current git changes)
- --depth: Review depth (standard|comprehensive) - default: standard
- --focus: Specific aspects (architecture|security|performance|all) - default: all
- --suggest-fixes: Generate fix suggestions (default: true)
- --check-tests: Review test coverage (default: false)
- --baseline: Compare against baseline branch (default: main)
Quick Process
- Gather Context: Get diff, changed files, commit messages
- Analyze: Understand intent and scope
- Multi-Agent Review: Architecture, security, performance, style
- Generate Fixes: Actionable improvements
- Summarize: Recommendation with action items
Review Depth
| Depth |
Agent ceiling |
Focus |
| Standard |
up to 4 |
Quick validation of key concerns |
| Comprehensive |
up to 8 |
Deep multi-phase analysis |
These are ceilings, not quotas. Staff only the dimensions the diff actually raises — a
change that touches no code, config, or capability grants does not need a security agent,
and a diff with no new dependencies does not need a dependency pass. "Docs-only" is not the
same test: markdown frontmatter can carry allowed-tools grants, so a docs diff can still
change what a component is permitted to do. Do not spawn an agent for analysis that would finish in a
handful of direct tool calls; read the diff yourself instead.
Orchestration Strategy
Phase 1: Code Analysis Preparation
Identify Review Scope:
- If no paths provided, get current git changes
- Expand directories to file lists
- Filter by file types and patterns
Context Loading:
- Invoke
development-codebase-tools:context-loader-agent to understand surrounding code
- Identify architectural patterns and conventions
- Load relevant documentation and standards
Phase 2: Multi-Agent Review
Invoke agents to coordinate parallel analysis. Every agent below lives in a sibling plugin,
so the plugin:agent-name qualifier is required — a bare name will not resolve:
- Code Quality:
development-codebase-tools:style-enforcer-agent,
development-codebase-tools:refactorer-agent,
development-codebase-tools:code-explainer-agent
- Architecture & Design: pattern consistency, design validation
- Security & Performance:
development-codebase-tools:security-analyzer-agent,
development-codebase-tools:performance-analyzer-agent
- Testing:
development-productivity:test-writer-agent (coverage gaps)
Phase 3: Deep Analysis (if --depth comprehensive)
For comprehensive review, additional specialized analysis:
- Dependency Analysis: Check for circular dependencies, validate imports
- Pattern Consistency: Compare with existing patterns, identify deviations
- Impact Analysis: Assess breaking changes, affected components
Phase 4: Result Aggregation
Combine insights from all agents:
Issue Prioritization:
- Critical: Security vulnerabilities, breaking changes
- High: Performance issues, architectural violations
- Medium: Style inconsistencies, missing tests
- Low: Minor improvements, documentation
Fix Generation:
- Automated fixes for style issues
- Refactoring suggestions with examples
- Security patches with explanations
Review Categories
- Architecture: Pattern compliance, SOLID, dependencies
- Security: Vulnerabilities, auth, injection risks
- Performance: Complexity, queries, caching
- Maintainability: Complexity, coverage, duplication
- Testing: Coverage gaps, test quality
Specialized Review Modes
Architecture Focus (--focus architecture)
- Emphasize design patterns and structure
- Validate SOLID principles
- Check dependency management
- Assess modularity and coupling
Security Focus (--focus security)
- Deep vulnerability scanning
- Input validation checks
- Authentication/authorization review
- Secrets and credential scanning
Performance Focus (--focus performance)
- Algorithm complexity analysis
- Memory usage patterns
- Database query optimization
- Caching opportunities
Output Format
Report every genuine finding. Mark each with a severity rather than dropping it — do not
omit a finding because it is low-severity, because you are unsure it is a real problem, or
because the list is getting long. Uncertainty is a note on the finding ("possible", "worth
confirming"), not a reason to discard it. Filtering by severity or concern happens at
presentation time, when the reader decides what to act on, never at discovery time.
Keep each finding to 2-4 sentences and each section to what a reviewer can act on. The
summary should fit on one screen.
Provides:
- Summary: Intent, scope, risk assessment, files reviewed, issues by severity
- Findings: By severity (critical, major, minor) with file, line, explanation
- Architecture Insights: Patterns, violations, recommendations
- Security Report: Vulnerabilities, severity, mitigation
- Performance Report: Bottlenecks, impact, optimization
- Test Coverage: Current coverage, gaps, suggested tests
- Action Plan: Must-fix, should-fix, consider lists
- Patches: Actionable diffs with automated fix commands
Recommendation
Returns: approve, request-changes, or comment
Examples
"Review my code changes"
"Check this file for security issues"
"Deep review of src/api/ focusing on performance"
"Review code quality in the authentication module"
"Is this PR ready to merge?"
Delegation
Invokes specialized agents from sibling plugins for multi-dimensional analysis:
development-codebase-tools:style-enforcer-agent,
development-codebase-tools:security-analyzer-agent,
development-codebase-tools:performance-analyzer-agent,
development-codebase-tools:code-explainer-agent,
development-codebase-tools:refactorer-agent,
development-codebase-tools:context-loader-agent, and
development-productivity:test-writer-agent.
Delegate only when a dimension needs its own sustained analysis. Reviewing a small diff
directly is cheaper and more accurate than fanning out.
1---2name: review-code3description: Review code changes for quality, security, and performance. Use when user says "review my changes", "do a code review", "check this for issues", "analyze code quality", "security review", "performance review", "is this PR ready", or needs architecture, security, performance, and style analysis.4---56# Code Reviewer78Comprehensive code review using multi-agent coordination for architecture, security, performance, and style analysis.910## When to Activate1112- User asks for code review (any context)13- User wants changes reviewed before merge14- User needs security or performance analysis15- User asks "is this ready?"16- PR quality check needed17- User mentions reviewing changes before commit/PR18- User asks about code issues or improvements1920## Inputs2122Parse from request:2324- **paths**: Files or directories to review (defaults to current git changes)25- **--depth**: Review depth (standard|comprehensive) - default: standard26- **--focus**: Specific aspects (architecture|security|performance|all) - default: all27- **--suggest-fixes**: Generate fix suggestions (default: true)28- **--check-tests**: Review test coverage (default: false)29- **--baseline**: Compare against baseline branch (default: main)3031## Quick Process32331. **Gather Context**: Get diff, changed files, commit messages342. **Analyze**: Understand intent and scope353. **Multi-Agent Review**: Architecture, security, performance, style364. **Generate Fixes**: Actionable improvements375. **Summarize**: Recommendation with action items3839## Review Depth4041| Depth | Agent ceiling | Focus |42| ----------------- | ------------- | -------------------------------- |43| **Standard** | up to 4 | Quick validation of key concerns |44| **Comprehensive** | up to 8 | Deep multi-phase analysis |4546These are ceilings, not quotas. Staff only the dimensions the diff actually raises — a47change that touches no code, config, or capability grants does not need a security agent,48and a diff with no new dependencies does not need a dependency pass. "Docs-only" is not the49same test: markdown frontmatter can carry `allowed-tools` grants, so a docs diff can still50change what a component is permitted to do. Do not spawn an agent for analysis that would finish in a51handful of direct tool calls; read the diff yourself instead.5253## Orchestration Strategy5455### Phase 1: Code Analysis Preparation56571. **Identify Review Scope**:5859 - If no paths provided, get current git changes60 - Expand directories to file lists61 - Filter by file types and patterns62632. **Context Loading**:64 - Invoke `development-codebase-tools:context-loader-agent` to understand surrounding code65 - Identify architectural patterns and conventions66 - Load relevant documentation and standards6768### Phase 2: Multi-Agent Review6970Invoke agents to coordinate parallel analysis. Every agent below lives in a sibling plugin,71so the `plugin:agent-name` qualifier is required — a bare name will not resolve:7273- **Code Quality**: `development-codebase-tools:style-enforcer-agent`,74 `development-codebase-tools:refactorer-agent`,75 `development-codebase-tools:code-explainer-agent`76- **Architecture & Design**: pattern consistency, design validation77- **Security & Performance**: `development-codebase-tools:security-analyzer-agent`,78 `development-codebase-tools:performance-analyzer-agent`79- **Testing**: `development-productivity:test-writer-agent` (coverage gaps)8081### Phase 3: Deep Analysis (if --depth comprehensive)8283For comprehensive review, additional specialized analysis:8485- **Dependency Analysis**: Check for circular dependencies, validate imports86- **Pattern Consistency**: Compare with existing patterns, identify deviations87- **Impact Analysis**: Assess breaking changes, affected components8889### Phase 4: Result Aggregation9091Combine insights from all agents:92931. **Issue Prioritization**:9495 - Critical: Security vulnerabilities, breaking changes96 - High: Performance issues, architectural violations97 - Medium: Style inconsistencies, missing tests98 - Low: Minor improvements, documentation991002. **Fix Generation**:101 - Automated fixes for style issues102 - Refactoring suggestions with examples103 - Security patches with explanations104105## Review Categories106107- **Architecture**: Pattern compliance, SOLID, dependencies108- **Security**: Vulnerabilities, auth, injection risks109- **Performance**: Complexity, queries, caching110- **Maintainability**: Complexity, coverage, duplication111- **Testing**: Coverage gaps, test quality112113## Specialized Review Modes114115### Architecture Focus (`--focus architecture`)116117- Emphasize design patterns and structure118- Validate SOLID principles119- Check dependency management120- Assess modularity and coupling121122### Security Focus (`--focus security`)123124- Deep vulnerability scanning125- Input validation checks126- Authentication/authorization review127- Secrets and credential scanning128129### Performance Focus (`--focus performance`)130131- Algorithm complexity analysis132- Memory usage patterns133- Database query optimization134- Caching opportunities135136## Output Format137138Report every genuine finding. Mark each with a severity rather than dropping it — do not139omit a finding because it is low-severity, because you are unsure it is a real problem, or140because the list is getting long. Uncertainty is a note on the finding ("possible", "worth141confirming"), not a reason to discard it. Filtering by severity or concern happens at142presentation time, when the reader decides what to act on, never at discovery time.143144Keep each finding to 2-4 sentences and each section to what a reviewer can act on. The145summary should fit on one screen.146147Provides:148149- **Summary**: Intent, scope, risk assessment, files reviewed, issues by severity150- **Findings**: By severity (critical, major, minor) with file, line, explanation151- **Architecture Insights**: Patterns, violations, recommendations152- **Security Report**: Vulnerabilities, severity, mitigation153- **Performance Report**: Bottlenecks, impact, optimization154- **Test Coverage**: Current coverage, gaps, suggested tests155- **Action Plan**: Must-fix, should-fix, consider lists156- **Patches**: Actionable diffs with automated fix commands157158## Recommendation159160Returns: `approve`, `request-changes`, or `comment`161162## Examples163164```text165"Review my code changes"166"Check this file for security issues"167"Deep review of src/api/ focusing on performance"168"Review code quality in the authentication module"169"Is this PR ready to merge?"170```171172## Delegation173174Invokes specialized agents from sibling plugins for multi-dimensional analysis:175`development-codebase-tools:style-enforcer-agent`,176`development-codebase-tools:security-analyzer-agent`,177`development-codebase-tools:performance-analyzer-agent`,178`development-codebase-tools:code-explainer-agent`,179`development-codebase-tools:refactorer-agent`,180`development-codebase-tools:context-loader-agent`, and181`development-productivity:test-writer-agent`.182183Delegate only when a dimension needs its own sustained analysis. Reviewing a small diff184directly is cheaper and more accurate than fanning out.