Reviews code quality, pattern adherence, and architecture with red-team validation. Use when user says "check your code", "code quality review", "is this well-written", or "review code quality"...
Review code quality, pattern adherence, and architecture—focused on "Is this well-written?" not "Will this break?"
Invoke when user says:
Different from check-your-work: check-your-work finds bugs and security issues. check-your-code evaluates code quality (pattern adherence, architecture, readability). Both use P0-P3 severity.
| Phase | Agents | Action |
|---|---|---|
| 1 | - | Scope Discovery (identify files) |
| 2 | 5 parallel | Quality Review (all agents at once) |
| 3 | 1 | Red Team - Challenge Findings (devil's advocate) |
| 4 | - | Report + User Decision |
For Phase 2 details: references/phase-2-quality-review.md For Phase 3 details: references/phase-3-red-team.md For report format: templates/quality-report.md
| Agent | Focus |
|---|---|
| pattern-enforcer | CLAUDE.md, claude-patterns/* compliance |
| react-quality | Component design, hooks, state management |
| architecture | SOLID principles, separation of concerns |
| readability | 30-second rule, naming, complexity |
| ai-smell-detector | Over-engineering, unnecessary abstractions |
| Agent | Focus |
|---|---|
| devil-advocate | Challenge all findings, reduce false positives |
| Level | Meaning | Action |
|---|---|---|
| P0 | Critical quality (major pattern violations) | Fix before commit |
| P1 | High (SOLID violations, component structure) | Recommend fixing |
| P2 | Medium (readability, minor pattern deviations) | Safe to commit, track |
| P3 | Low (style preferences, optional improvements) | Optional |
Note: Quality P0s are less urgent than bug P0s. A quality P0 means "this is very poorly written" not "this will break production."
| Gate | Phase | Question |
|---|---|---|
| Scope | 1 | "Review these files?" (if >2000 lines) |
| Action | 4 | "Improve now / Accept as-is / Discuss findings?" |
| Size | Lines | Recommendation |
|---|---|---|
| Ideal | 200-1000 | Fast, thorough |
| Acceptable | 1000-2000 | May take 3-5 min |
| Large | >2000 | Warn user, suggest splitting |
Include: Changed files, related files Exclude: Generated types, node_modules, build artifacts, test files
NEVER dismiss findings because they are in "pre-existing code".
Report ALL quality issues found in reviewed files regardless of when they were introduced. A pattern violation discovered today that was written months ago is still worth flagging.
Invalid reasoning (DO NOT USE):
Correct approach:
git status to identify modified filesLaunch ALL 5 agents in a single message with multiple Task calls. See references/phase-2-quality-review.md for agent prompts.
Provide each agent:
Launch 1 agent to challenge ALL findings from Phase 2. See references/phase-3-red-team.md for agent prompt.
Provide:
Output: Validated findings with status (CONFIRMED/DOWNGRADED/DISMISSED/UPGRADED)
{
questions: [
{
question: "What would you like to do with these findings?",
header: "Action",
options: [
{
label: "Improve now",
description: "Fix the quality issues before committing",
},
{ label: "Accept as-is", description: "Proceed without changes" },
{
label: "Discuss findings",
description: "Review specific issues in detail",
},
],
multiSelect: false,
},
];
}
For comprehensive quality: Run check-your-code + check-your-work + typecheck + tests
Pattern files checked:
CLAUDE.mdreact-typescript-antipatterns.mdzod-form-patterns.mdtanstack-query-patterns.mdsettings-patterns.mdservice-refactoring-patterns.mdKey quality dimensions:
v1.3.0 (2026-01-20): Add critical rule for pre-existing issues
v1.2.0 (2025-01-18): AI optimization updates
v1.1.0 (2025-01-11): Switch to P0-P3 severity system
v1.0.0 (2025-01-11): Initial release