Code Quality Evaluation
Orchestrate 8 specialized agents for comprehensive code quality evaluation. All agents report findings — you apply fixes.
Agents
All agents are recommendation-only — they read code and report, never modify.
Evaluation agents (run in parallel, background):
| Agent | Focus |
|---|---|
| namer | Naming issues: vague, misleading, type-focused identifiers |
| code-simplifier | Complexity: duplication, deep nesting, verbose patterns |
| comment-cleaner | Comment noise, redundancy, missing documentation comments |
| test-reviewer | Test quality, strategy, leanness, locality |
| error-handling-reviewer | Error flow: creation, propagation, handling, silent swallowing |
| security-reviewer | Secrets, injection, input validation, crypto, auth |
| observability-reviewer | Logging, metrics, tracing, context propagation |
Documentation agent (runs last, after fixes):
| Agent | Focus |
|---|---|
| documenter | Missing, outdated, or insufficient API documentation |
CRITICAL: Do Not Use TaskOutput
Never call the TaskOutput tool during this workflow.
How to wait for background agents:
- Launch agent with
run_in_background=true - Do nothing — literally output nothing and wait
- System notifies you: "Background task completed"
- Read the report FILE the agent wrote — not TaskOutput
TaskOutput destroys context efficiency for the entire workflow.
Workflow
Phase 0: Setup Reports Directory
Create reports directory inside the target:
mkdir -p {target}/.reviews/{timestamp}
Reports directory must be inside target — agents can only write within their review scope.
Phase 1: Evaluate Code (Parallel, Background)
Launch all 7 evaluation agents in parallel:
For each agent in [namer, code-simplifier, comment-cleaner,
test-reviewer, error-handling-reviewer,
security-reviewer, observability-reviewer]:
Task(agent, prompt="""
Evaluate {target} and report findings.
Write findings to: {reports_dir}/{agent}.md
Do NOT modify any code — only report what should change.
Do NOT include file contents in the report — only findings.
""", run_in_background=true)
Phase 2: Read Reports and Present Findings
After all evaluation agents complete:
- Read all report files from
{reports_dir}/ - Aggregate into summary (Critical / Issues / Recommendations counts)
- Present findings to user organized by severity
- Ask user which issues to address
Phase 3: Apply Fixes
Address findings based on user direction:
- Fix critical issues first
- Then issues, then recommendations
- User may skip categories or individual findings
- Continue until user says to stop or all addressed
This phase is iterative — fix, verify, repeat.
Phase 4: Documentation Review (After Fixes)
Only after code fixes are complete, run documenter:
Task(documenter, prompt="""
Evaluate API documentation in {target}.
Write findings to: {reports_dir}/documenter.md
Do NOT modify any code — only report what documentation is missing.
Do NOT include file contents in the report — only findings.
""", run_in_background=true)
Documentation reviews the fixed code, not the original state. Running it earlier wastes effort on outdated code.
Phase 5: Cleanup
After all work complete:
rm -rf {reports_dir}
Remove the .reviews/ directory — reports are temporary artifacts.
Usage
Run code quality evaluation on [path]
