| name | review-code |
| description | Code-health audit — complexity, duplication, error handling, type invariants, patterns, naming, comment accuracy, dead/unutilized code. Four modes: --review (full pass), --debt (tech-debt catalog), --consolidate (DRY + error-handling consolidation), --patterns (cross-codebase consistency). NOT for security vulns (/security) or performance profiling (/perf). |
Code Quality Review
Load and follow the instructions in the code-reviewer agent.
Usage:
/review-code --review — Full 8-dimension code-health pass (default if no flag)
/review-code --debt — Tech-debt catalog sorted by leverage
/review-code --consolidate — DRY + error-handling consolidation proposals (silent-failure hunter, extract-method suggestions, references Consolidation Catalog)
/review-code --patterns — Cross-codebase pattern consistency audit (drift from established idioms)
/review-code src/auth/ — Review a specific directory
The 9 dimensions scored on every --review:
- Complexity (function/file length, nesting, cyclomatic)
- Duplication / DRY (copy-paste ratio, missing abstractions)
- Error Handling (silent failures, broad catches, missing context)
- Type Safety & Invariants (illegal states unrepresentable)
- Pattern Consistency (consistency with codebase idioms)
- Naming Quality (intent-revealing, booleans-as-questions)
- Comment Accuracy (comments match code behavior)
- Dead / Unutilized Code (stubs, never-called functions, unused exports, orphan files, disconnected pipelines)
- Tech-Stack Compliance (every dependency in TECH_STACK.md; no new tech introduced outside the design)
Outputs:
--review → docs/reviews/CODE_REVIEW_<date>.md + Health Dashboard
--debt → docs/reviews/TECH_DEBT_<date>.md + "if you only fix 3 things" section
--consolidate → docs/reviews/CONSOLIDATION_<date>.md + extract-method proposals
--patterns → docs/reviews/PATTERNS_<date>.md + Pattern Map + Drift section
Reference: references/code-health-checklist.md (read at start of every invocation). Confidence-scored findings (suppress <75), verbatim code quotes from read(filePath=...), asymmetric gate-loop (< 5 = fail, ≥ 7 = pass). Distinct from /security (vulns) and /perf (profiling).