/codereview - Multi-Reviewer Parallel Code Review
Run a comprehensive code review that dispatches 3 specialized perspectives concurrently - architecture, security, and testing - then consolidates into a single actionable verdict.
Target: $ARGUMENTS
Why 3 Perspectives, Not 6
Most multi-reviewer systems use 5-7 overlapping perspectives that waste tokens and produce redundant findings. /codereview uses exactly 3 orthogonal perspectives - each covers a distinct failure mode with zero overlap:
┌──────────────────────────────────────────────────────────────┐
│ PARALLEL REVIEW DISPATCH │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ @reviewer │ │ @security │ │ @tester │ │
│ │ Architecture│ │ OWASP/Auth │ │ Coverage │ │
│ │ + Quality │ │ + Data │ │ + Edge Cases│ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ ┌──────────────┐ │
│ │ CONSOLIDATE │ │
│ │ Deduplicate │ │
│ │ Assign Sev. │ │
│ │ Verdict │ │
│ └──────────────┘ │
└──────────────────────────────────────────────────────────────┘
When to Use
- Before merging a pull request
- Before a production release
- After major refactors that touch multiple modules
- After new contributor PRs (unfamiliar with codebase conventions)
- When a change touches auth, payments, or data handling
- NOT for: quick single-file fixes (use
@reviewer directly)
- NOT for: security-only audit (use
@security directly)
- NOT for: test strategy design (use
@tester directly)
Workflow
Step 1: Scope Detection
Determine the review target:
IF $ARGUMENTS is a file/directory path → review that path
IF $ARGUMENTS is a module name → find and review the module
IF $ARGUMENTS is a PR number/URL → extract changed files from PR diff
IF $ARGUMENTS is empty → review staged/uncommitted changes
Gather scope metrics:
# Count files and lines in scope
find $TARGET -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.vue" -o -name "*.svelte" \) | head -200 | xargs wc -l 2>/dev/null || true
# If PR, get the diff
gh pr diff $PR_NUMBER 2>/dev/null || git diff main...HEAD 2>/dev/null || true
Read the project's docs/ARCHITECTURE.md if it exists - this is the source of truth for architecture review.
Step 2: Parallel Review Dispatch
Dispatch 3 concurrent review perspectives. Each reviewer gets the full file context but applies a different lens.
Perspective 1: Architecture Review (@reviewer focus)
Review the code for structural integrity and quality:
| Check |
What to Look For |
| Layer separation |
Services don't import from components, no cross-module imports |
| Naming conventions |
Files, functions, variables follow project conventions |
| Design patterns |
DRY, SOLID, composition over inheritance |
| API contracts |
DTOs/schemas at boundaries, typed inputs and outputs |
| Dependency direction |
Layers depend inward, not outward |
| Code smells |
Long methods (>40 lines), deep nesting (>3 levels), god objects |
| Type safety |
No any abuse, strict mode, proper generics |
| Error handling |
Try/catch at boundaries, custom error types, no swallowed errors |
| Import hygiene |
No circular dependencies, barrel file discipline |
# Architecture checks
grep -rn ": any\|as any" $TARGET --include="*.ts" --include="*.tsx" 2>/dev/null | head -20
grep -rn "console\.\|debugger" $TARGET --include="*.ts" --include="*.tsx" --include="*.vue" 2>/dev/null | head -20
Perspective 2: Security Review (@security focus)
Review the code for vulnerabilities and data safety:
| Check |
What to Look For |
| Injection |
SQL/NoSQL injection, command injection, template injection |
| XSS |
Unsanitized output, dangerouslySetInnerHTML, v-html, raw HTML |
| Auth/AuthZ |
Missing auth checks, broken access control, IDOR vulnerabilities |
| Input validation |
Missing or insufficient validation, type coercion issues |
| Secrets |
Hardcoded API keys, tokens, passwords, connection strings |
| Data exposure |
Sensitive data in logs, error messages, API responses, URLs |
| CSRF |
Missing CSRF tokens on state-changing operations |
| Cryptography |
Weak algorithms, predictable tokens, missing encryption |
| Headers |
Missing security headers (CSP, HSTS, X-Frame-Options) |
| Dependencies |
Known CVEs in packages |
# Security checks
npm audit --json 2>/dev/null | head -50 || true
grep -rn "password\|secret\|token\|api_key\|apikey" $TARGET --include="*.ts" --include="*.tsx" --include="*.env*" 2>/dev/null | head -20
grep -rn "v-html\|dangerouslySetInnerHTML\|innerHTML" $TARGET --include="*.ts" --include="*.tsx" --include="*.vue" 2>/dev/null | head -20
grep -rn "eval(\|new Function(" $TARGET --include="*.ts" --include="*.tsx" --include="*.js" 2>/dev/null | head -20
Perspective 3: Test Review (@tester focus)
Review the code for test quality and coverage:
| Check |
What to Look For |
| Coverage gaps |
Business logic without corresponding tests |
| Missing edge cases |
Null, empty, boundary values, error paths not tested |
| Test quality |
Tests that test implementation vs behavior |
| Mocking correctness |
Over-mocking, mocking what you own, leaking mocks |
| Assertion strength |
Weak assertions (toBeTruthy vs toEqual), missing assertions |
| Test isolation |
Shared mutable state, order-dependent tests |
| Naming clarity |
Descriptive it('should...') vs vague test names |
| Test types |
Right balance of unit/integration/e2e for the change |
| Regression risk |
Changed code without updated tests |
| Flakiness signals |
Timing dependencies, network calls in unit tests |
# Test checks
find $TARGET -name "*.spec.ts" -o -name "*.test.ts" -o -name "*.spec.tsx" -o -name "*.test.tsx" 2>/dev/null | wc -l
npx vitest run --passWithNoTests --reporter=json 2>/dev/null || npx jest --json --passWithNoTests 2>/dev/null || true
Step 3: Consolidation
Merge findings from all 3 perspectives:
- Deduplicate - Remove findings flagged by multiple perspectives (keep highest severity)
- Cross-reference - A security finding that also lacks tests is escalated one severity level
- Assign severity - Every finding gets a severity level (see table below)
- Sort - CRITICAL first, then HIGH, MEDIUM, LOW
- Group - By file, then by severity within each file
Step 4: Verdict
Apply verdict rules based on the consolidated findings. The verdict is final and non-negotiable - it follows the rules mechanically.
Severity Levels
| Level |
Description |
Action |
| CRITICAL |
Security vulnerability, data loss risk, auth bypass |
Block merge. Fix immediately. |
| HIGH |
Architecture violation, missing validation, untested critical path |
Request changes. Fix before merge. |
| MEDIUM |
Code quality issue, weak test, minor vulnerability |
Approve with notes. Fix in next sprint. |
| LOW |
Style issue, minor improvement, optional optimization |
Approve. Fix when convenient. |
Verdict Rules
| Condition |
Verdict |
Meaning |
| Any CRITICAL finding |
BLOCK |
Do not merge under any circumstances |
| Any HIGH finding (no CRITICAL) |
REQUEST_CHANGES |
Fix HIGH findings, then re-review |
| MEDIUM findings only |
APPROVE WITH NOTES |
Safe to merge, but address MEDIUM items soon |
| LOW findings only (or none) |
APPROVE |
Clean to merge |
Escalation rules:
- A security finding without a corresponding test → severity +1 level
- A finding that recurs from a previous review → severity +1 level
- A finding in auth, payments, or PII handling → minimum severity HIGH
Verification Protocol
Before claiming the review is complete:
- All 3 perspectives were executed (architecture, security, tests)
- Every finding has a severity level assigned
- Every CRITICAL or HIGH finding includes a specific file:line reference
- Every CRITICAL or HIGH finding includes a concrete remediation suggestion
- Automated checks were run where available (
npm audit, tsc, linting, test suite)
- The verdict follows the Verdict Rules mechanically - no exceptions
- Cross-referencing was performed (security findings checked for test coverage)
Anti-Rationalization
| Excuse |
Reality |
| "No security issues found" |
Did you check all OWASP categories? Absence of evidence is not evidence of absence. |
| "Tests look fine" |
Did you check edge cases, error paths, and assertion strength? Or just that tests exist? |
| "Architecture is clean" |
Did you trace actual imports and dependency direction? Or just scan filenames? |
| "It's just a small change" |
Small changes cause production outages. Review scope does not reduce rigor. |
| "The CI passed" |
CI checks syntax, not logic. A green build is not a security audit. |
| "Previous review approved this pattern" |
Patterns can be wrong. Evaluate independently every time. |
| "Too many files to review thoroughly" |
Scope down to critical paths (auth, data, business logic). Never skip security. |
| "The author is senior, they know what they're doing" |
Seniority does not prevent bugs. Review the code, not the author. |
Rules
- All 3 perspectives are mandatory - Skipping one defeats the purpose of multi-reviewer review
- Read-only - Never modify files during a review
- Evidence required - Every finding needs a file:line reference and explanation
- Remediation required - Findings without fix suggestions are useless
- Verdict is mechanical - Follow the Verdict Rules table, no subjective overrides
- No sycophancy - Never say "LGTM", "looks good", or "great job" without evidence
- Cross-reference findings - A security issue without tests is worse than either alone
- Severity must be justified - Every rating needs a specific technical reason
- Run automated tools - Never skip
npm audit, linting, or type checking if available
- Fresh context per perspective - Each reviewer perspective starts from the code, not from another reviewer's output
Output
──── /codereview ────
Target: [path or PR]
Scope: [X files, Y lines]
Architecture: [N findings] - @reviewer
Security: [N findings] - @security
Tests: [N findings] - @tester
Severity:
CRITICAL: N
HIGH: N
MEDIUM: N
LOW: N
Top Findings:
1. [CRITICAL] [description] - [file:line]
2. [HIGH] [description] - [file:line]
3. [HIGH] [description] - [file:line]
Verdict: [APPROVE | APPROVE WITH NOTES | REQUEST_CHANGES | BLOCK]
Reason: [1-line justification]
1---2name: codereview3description: "Use when you need a comprehensive code review combining architecture, security, and test perspectives - especially before merging, releasing, or after major changes."4user-invocable: true5argument-hint: "[path, module, or PR]"6allowed-tools: Read, Bash, Glob, Grep7metadata:8 source: https://skillmd.com/skills/aibot88/codereview9---1011# /codereview - Multi-Reviewer Parallel Code Review1213Run a comprehensive code review that dispatches 3 specialized perspectives concurrently - architecture, security, and testing - then consolidates into a single actionable verdict.1415**Target:** $ARGUMENTS1617## Why 3 Perspectives, Not 61819Most multi-reviewer systems use 5-7 overlapping perspectives that waste tokens and produce redundant findings. `/codereview` uses exactly 3 orthogonal perspectives - each covers a distinct failure mode with zero overlap:2021```22┌──────────────────────────────────────────────────────────────┐23│ PARALLEL REVIEW DISPATCH │24│ │25│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │26│ │ @reviewer │ │ @security │ │ @tester │ │27│ │ Architecture│ │ OWASP/Auth │ │ Coverage │ │28│ │ + Quality │ │ + Data │ │ + Edge Cases│ │29│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │30│ │ │ │ │31│ └────────────────┼────────────────┘ │32│ ▼ │33│ ┌──────────────┐ │34│ │ CONSOLIDATE │ │35│ │ Deduplicate │ │36│ │ Assign Sev. │ │37│ │ Verdict │ │38│ └──────────────┘ │39└──────────────────────────────────────────────────────────────┘40```4142## When to Use4344- Before merging a pull request45- Before a production release46- After major refactors that touch multiple modules47- After new contributor PRs (unfamiliar with codebase conventions)48- When a change touches auth, payments, or data handling49- NOT for: quick single-file fixes (use `@reviewer` directly)50- NOT for: security-only audit (use `@security` directly)51- NOT for: test strategy design (use `@tester` directly)5253## Workflow5455### Step 1: Scope Detection5657Determine the review target:5859```60IF $ARGUMENTS is a file/directory path → review that path61IF $ARGUMENTS is a module name → find and review the module62IF $ARGUMENTS is a PR number/URL → extract changed files from PR diff63IF $ARGUMENTS is empty → review staged/uncommitted changes64```6566Gather scope metrics:6768```bash69# Count files and lines in scope70find $TARGET -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" -o -name "*.vue" -o -name "*.svelte" \) | head -200 | xargs wc -l 2>/dev/null || true7172# If PR, get the diff73gh pr diff $PR_NUMBER 2>/dev/null || git diff main...HEAD 2>/dev/null || true74```7576Read the project's `docs/ARCHITECTURE.md` if it exists - this is the source of truth for architecture review.7778### Step 2: Parallel Review Dispatch7980Dispatch 3 concurrent review perspectives. Each reviewer gets the full file context but applies a different lens.8182---8384**Perspective 1: Architecture Review** (`@reviewer` focus)8586Review the code for structural integrity and quality:8788| Check | What to Look For |89|-------|------------------|90| Layer separation | Services don't import from components, no cross-module imports |91| Naming conventions | Files, functions, variables follow project conventions |92| Design patterns | DRY, SOLID, composition over inheritance |93| API contracts | DTOs/schemas at boundaries, typed inputs and outputs |94| Dependency direction | Layers depend inward, not outward |95| Code smells | Long methods (>40 lines), deep nesting (>3 levels), god objects |96| Type safety | No `any` abuse, strict mode, proper generics |97| Error handling | Try/catch at boundaries, custom error types, no swallowed errors |98| Import hygiene | No circular dependencies, barrel file discipline |99100```bash101# Architecture checks102grep -rn ": any\|as any" $TARGET --include="*.ts" --include="*.tsx" 2>/dev/null | head -20103grep -rn "console\.\|debugger" $TARGET --include="*.ts" --include="*.tsx" --include="*.vue" 2>/dev/null | head -20104```105106---107108**Perspective 2: Security Review** (`@security` focus)109110Review the code for vulnerabilities and data safety:111112| Check | What to Look For |113|-------|------------------|114| Injection | SQL/NoSQL injection, command injection, template injection |115| XSS | Unsanitized output, `dangerouslySetInnerHTML`, `v-html`, raw HTML |116| Auth/AuthZ | Missing auth checks, broken access control, IDOR vulnerabilities |117| Input validation | Missing or insufficient validation, type coercion issues |118| Secrets | Hardcoded API keys, tokens, passwords, connection strings |119| Data exposure | Sensitive data in logs, error messages, API responses, URLs |120| CSRF | Missing CSRF tokens on state-changing operations |121| Cryptography | Weak algorithms, predictable tokens, missing encryption |122| Headers | Missing security headers (CSP, HSTS, X-Frame-Options) |123| Dependencies | Known CVEs in packages |124125```bash126# Security checks127npm audit --json 2>/dev/null | head -50 || true128grep -rn "password\|secret\|token\|api_key\|apikey" $TARGET --include="*.ts" --include="*.tsx" --include="*.env*" 2>/dev/null | head -20129grep -rn "v-html\|dangerouslySetInnerHTML\|innerHTML" $TARGET --include="*.ts" --include="*.tsx" --include="*.vue" 2>/dev/null | head -20130grep -rn "eval(\|new Function(" $TARGET --include="*.ts" --include="*.tsx" --include="*.js" 2>/dev/null | head -20131```132133---134135**Perspective 3: Test Review** (`@tester` focus)136137Review the code for test quality and coverage:138139| Check | What to Look For |140|-------|------------------|141| Coverage gaps | Business logic without corresponding tests |142| Missing edge cases | Null, empty, boundary values, error paths not tested |143| Test quality | Tests that test implementation vs behavior |144| Mocking correctness | Over-mocking, mocking what you own, leaking mocks |145| Assertion strength | Weak assertions (`toBeTruthy` vs `toEqual`), missing assertions |146| Test isolation | Shared mutable state, order-dependent tests |147| Naming clarity | Descriptive `it('should...')` vs vague test names |148| Test types | Right balance of unit/integration/e2e for the change |149| Regression risk | Changed code without updated tests |150| Flakiness signals | Timing dependencies, network calls in unit tests |151152```bash153# Test checks154find $TARGET -name "*.spec.ts" -o -name "*.test.ts" -o -name "*.spec.tsx" -o -name "*.test.tsx" 2>/dev/null | wc -l155npx vitest run --passWithNoTests --reporter=json 2>/dev/null || npx jest --json --passWithNoTests 2>/dev/null || true156```157158### Step 3: Consolidation159160Merge findings from all 3 perspectives:1611621. **Deduplicate** - Remove findings flagged by multiple perspectives (keep highest severity)1632. **Cross-reference** - A security finding that also lacks tests is escalated one severity level1643. **Assign severity** - Every finding gets a severity level (see table below)1654. **Sort** - CRITICAL first, then HIGH, MEDIUM, LOW1665. **Group** - By file, then by severity within each file167168### Step 4: Verdict169170Apply verdict rules based on the consolidated findings. The verdict is final and non-negotiable - it follows the rules mechanically.171172## Severity Levels173174| Level | Description | Action |175|-------|-------------|--------|176| CRITICAL | Security vulnerability, data loss risk, auth bypass | Block merge. Fix immediately. |177| HIGH | Architecture violation, missing validation, untested critical path | Request changes. Fix before merge. |178| MEDIUM | Code quality issue, weak test, minor vulnerability | Approve with notes. Fix in next sprint. |179| LOW | Style issue, minor improvement, optional optimization | Approve. Fix when convenient. |180181## Verdict Rules182183| Condition | Verdict | Meaning |184|-----------|---------|---------|185| Any CRITICAL finding | **BLOCK** | Do not merge under any circumstances |186| Any HIGH finding (no CRITICAL) | **REQUEST_CHANGES** | Fix HIGH findings, then re-review |187| MEDIUM findings only | **APPROVE WITH NOTES** | Safe to merge, but address MEDIUM items soon |188| LOW findings only (or none) | **APPROVE** | Clean to merge |189190**Escalation rules:**191- A security finding without a corresponding test → severity +1 level192- A finding that recurs from a previous review → severity +1 level193- A finding in auth, payments, or PII handling → minimum severity HIGH194195## Verification Protocol196197**Before claiming the review is complete:**1981991. All 3 perspectives were executed (architecture, security, tests)2002. Every finding has a severity level assigned2013. Every CRITICAL or HIGH finding includes a specific file:line reference2024. Every CRITICAL or HIGH finding includes a concrete remediation suggestion2035. Automated checks were run where available (`npm audit`, `tsc`, linting, test suite)2046. The verdict follows the Verdict Rules mechanically - no exceptions2057. Cross-referencing was performed (security findings checked for test coverage)206207## Anti-Rationalization208209| Excuse | Reality |210|--------|---------|211| "No security issues found" | Did you check all OWASP categories? Absence of evidence is not evidence of absence. |212| "Tests look fine" | Did you check edge cases, error paths, and assertion strength? Or just that tests exist? |213| "Architecture is clean" | Did you trace actual imports and dependency direction? Or just scan filenames? |214| "It's just a small change" | Small changes cause production outages. Review scope does not reduce rigor. |215| "The CI passed" | CI checks syntax, not logic. A green build is not a security audit. |216| "Previous review approved this pattern" | Patterns can be wrong. Evaluate independently every time. |217| "Too many files to review thoroughly" | Scope down to critical paths (auth, data, business logic). Never skip security. |218| "The author is senior, they know what they're doing" | Seniority does not prevent bugs. Review the code, not the author. |219220## Rules2212221. **All 3 perspectives are mandatory** - Skipping one defeats the purpose of multi-reviewer review2232. **Read-only** - Never modify files during a review2243. **Evidence required** - Every finding needs a file:line reference and explanation2254. **Remediation required** - Findings without fix suggestions are useless2265. **Verdict is mechanical** - Follow the Verdict Rules table, no subjective overrides2276. **No sycophancy** - Never say "LGTM", "looks good", or "great job" without evidence2287. **Cross-reference findings** - A security issue without tests is worse than either alone2298. **Severity must be justified** - Every rating needs a specific technical reason2309. **Run automated tools** - Never skip `npm audit`, linting, or type checking if available23110. **Fresh context per perspective** - Each reviewer perspective starts from the code, not from another reviewer's output232233## Output234235```236──── /codereview ────237Target: [path or PR]238Scope: [X files, Y lines]239240Architecture: [N findings] - @reviewer241Security: [N findings] - @security242Tests: [N findings] - @tester243244Severity:245 CRITICAL: N246 HIGH: N247 MEDIUM: N248 LOW: N249250Top Findings:2511. [CRITICAL] [description] - [file:line]2522. [HIGH] [description] - [file:line]2533. [HIGH] [description] - [file:line]254255Verdict: [APPROVE | APPROVE WITH NOTES | REQUEST_CHANGES | BLOCK]256Reason: [1-line justification]257```