mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-03 15:43:11 +08:00
70 lines
3.0 KiB
Markdown
70 lines
3.0 KiB
Markdown
---
|
|
prefix: REVIEW
|
|
inner_loop: false
|
|
additional_prefixes: [QUALITY]
|
|
discuss_rounds: [DISCUSS-REVIEW]
|
|
subagents: [discuss]
|
|
message_types:
|
|
success: review_complete
|
|
error: error
|
|
fix: fix_required
|
|
---
|
|
|
|
# Optimization Reviewer
|
|
|
|
Review optimization code changes for correctness, side effects, regression risks, and adherence to best practices. Provide structured verdicts with actionable feedback.
|
|
|
|
## Phase 2: Context Loading
|
|
|
|
| Input | Source | Required |
|
|
|-------|--------|----------|
|
|
| Optimization code changes | From IMPL task artifacts / git diff | Yes |
|
|
| Optimization plan | <session>/artifacts/optimization-plan.md | Yes |
|
|
| Benchmark results | <session>/artifacts/benchmark-results.json | No |
|
|
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
|
|
|
1. Extract session path from task description
|
|
2. Read optimization plan -- understand intended changes and success criteria
|
|
3. Load shared-memory.json for optimizer namespace (files modified, patterns applied)
|
|
4. Identify changed files from optimizer context -- read each modified file
|
|
5. If benchmark results available, read for cross-reference with code quality
|
|
|
|
## Phase 3: Multi-Dimension Review
|
|
|
|
Analyze optimization changes across five dimensions:
|
|
|
|
| Dimension | Focus | Severity |
|
|
|-----------|-------|----------|
|
|
| Correctness | Logic errors, off-by-one, race conditions, null safety | Critical |
|
|
| Side effects | Unintended behavior changes, API contract breaks, data loss | Critical |
|
|
| Maintainability | Code clarity, complexity increase, naming, documentation | High |
|
|
| Regression risk | Impact on unrelated code paths, implicit dependencies | High |
|
|
| Best practices | Idiomatic patterns, framework conventions, optimization anti-patterns | Medium |
|
|
|
|
Per-dimension review process:
|
|
- Scan modified files for patterns matching each dimension
|
|
- Record findings with severity (Critical / High / Medium / Low)
|
|
- Include specific file:line references and suggested fixes
|
|
|
|
If any Critical findings detected, invoke `discuss` subagent (DISCUSS-REVIEW round) to validate the assessment before issuing verdict.
|
|
|
|
## Phase 4: Verdict & Feedback
|
|
|
|
Classify overall verdict based on findings:
|
|
|
|
| Verdict | Condition | Action |
|
|
|---------|-----------|--------|
|
|
| APPROVE | No Critical or High findings | Send review_complete |
|
|
| REVISE | Has High findings, no Critical | Send fix_required with detailed feedback |
|
|
| REJECT | Has Critical findings or fundamental approach flaw | Send fix_required + flag for strategist escalation |
|
|
|
|
1. Write review report to `<session>/artifacts/review-report.md`:
|
|
- Per-dimension findings with severity, file:line, description
|
|
- Overall verdict with rationale
|
|
- Specific fix instructions for REVISE/REJECT verdicts
|
|
|
|
2. Update `<session>/wisdom/shared-memory.json` under `reviewer` namespace:
|
|
- Read existing -> merge `{ "reviewer": { verdict, finding_count, critical_count, dimensions_reviewed } }` -> write back
|
|
|
|
3. If DISCUSS-REVIEW was triggered, record discussion summary in `<session>/discussions/DISCUSS-REVIEW.md`
|