review
Code review using parallel subagents.
When & Why to Use This Skill
This Claude skill automates comprehensive code reviews by orchestrating three specialized parallel subagents focused on correctness, safety, and quality. It intelligently detects the review scope from git diffs or specific paths, identifies logic errors, security vulnerabilities, and design smells, and delivers a prioritized, actionable summary to streamline the development workflow and ensure high-quality software delivery.
Use Cases
- Automated Pull Request Reviews: Streamline the PR process by automatically analyzing code changes for logic bugs, boundary conditions, and edge cases before human intervention.
- Security & Vulnerability Auditing: Identify critical security risks such as hardcoded secrets, injection vulnerabilities, and improper input validation across new code changes.
- Technical Debt & Quality Control: Evaluate codebases for design smells, over-engineering, and non-idiomatic patterns to maintain long-term maintainability and performance.
- Pre-push Validation: Use as a local gatekeeper to catch 'must-fix' errors and silent failures in staged changes before they reach the remote repository.
| name | review |
|---|---|
| description | Code review using parallel subagents. |
| allowed-tools | Read, Grep, Glob, Bash, Task |
Code Review
Code review using 3 parallel subagents. Scope detected automatically.
Workflow
- Detect scope (see below)
- Launch 3 parallel reviewer subagents
- Aggregate findings by severity, deduplicate
- Report summary with actionable items
Scope Detection
# Priority order:
# 1. User provided specific files/paths? -> Review those
# 2. Feature branch? -> diff vs main
# 3. Upstream remote? -> diff vs upstream/main
# 4. Version tags? -> diff vs last tag
# 5. Unpushed commits? -> diff vs origin/main
# 6. Staged changes? -> git diff --cached
# 7. Unstaged changes? -> git diff
# 8. Nothing -> inform user
Parallel Subagents
Launch all 3 in parallel using Task tool with subagent_type: reviewer:
Agent 1: Correctness
Logic and functional correctness.
- Logic errors, off-by-one, boundary conditions
- Null/undefined handling
- State consistency (partial failures)
- Race conditions (if concurrent)
- Edge cases: empty, max, negative, zero
- Control flow correctness
- Algorithm correctness
Agent 2: Safety
Security and error handling (defensive thinking).
- Input validation at boundaries
- Hardcoded secrets, credentials
- Injection: SQL, XSS, command, path traversal
- Auth/authz checks
- Sensitive data in logs
- Silent failures, empty catch blocks
- Error propagation (swallowed vs bubbled)
- Fallback behavior hiding problems
- Resource cleanup on error
Agent 3: Quality
Design, performance, and idioms.
- Fits existing patterns?
- Single responsibility
- Over-engineering (future problems?)
- Code smells: long functions (>40 lines), large files (>400 lines)
- Dead code, unused variables
- Naming: intention-revealing, proportional to scope
- No
_v2,_newsuffixes - Unnecessary allocations (
Stringvs&str,Vecvs&[T]) - O(n²) where O(n) possible
- Blocking I/O in async, N+1 queries
- Language idioms (Rust/Python/Go/TS)
Subagent Prompt
Review code changes for [FOCUS: Correctness | Safety | Quality].
Scope: [diff or files]
Report issues with confidence >= 80%. Format:
[SEVERITY] file:line - Issue
-> Fix
Severities:
- ERROR: Must fix (bugs, security, silent failures)
- WARN: Should fix (smells, performance)
- NIT: Optional (style, minor)
Be thorough. No false positives. Only flag what you're confident about.
Aggregation
- Deduplicate (same issue from multiple agents = 1 issue)
- Sort: ERROR → WARN → NIT
- Group by file
Output Format
## Review Summary
Scope: [X files, Y lines]
Issues: ERROR: X, WARN: X, NIT: X
## Critical (must fix)
[ERROR] file:line - Issue
-> Fix
## Important (should fix)
[WARN] file:line - Issue
-> Fix
## Minor
[NIT] file:line - Issue
-> Fix
## Strengths
- What's done well
## Verdict
LGTM / LGTM with nits / Needs work
Quick Review (small changes)
For < 50 lines, review directly without subagents:
- Logic correct, edge cases handled
- Errors handled, not swallowed
- No security issues
- No debug statements
- Naming clear
- Fits existing patterns