Multi-perspective review → Issue classification → Prioritization → Fix suggestions
Usage
/multi-review [實作路徑]
/multi-review .claude/memory/implement/user-auth/
Flags: --from-implement ID | --focus security|quality|docs
Default 4 perspectives
| ID | Name | Model | Focus |
|---|---|---|---|
code-quality |
Code quality | haiku | Naming, structure, readability |
test-coverage |
Test coverage | haiku | Coverage, test quality |
documentation |
Documentation check | haiku | Comments, README, API documentation |
integration |
Integration analysis | sonnet | Integration issues, dependency conflicts |
→ Model routing configuration:shared/config/model-routing.yaml
Execution flow
Phase 0: 載入實作 → 收集變更檔案、測試結果
↓
Phase 1: MAP(並行審查)
┌──────────┬──────────┬──────────┬──────────┐
│程式碼品質│測試覆蓋 │文檔檢查 │整合分析 │
└──────────┴──────────┴──────────┴──────────┘
⚠️ **並行執行關鍵**:
在單一訊息中發送 4 個 Task 工具呼叫:
- Task({description: "程式碼品質審查", ...})
- Task({description: "測試覆蓋審查", ...})
- Task({description: "文檔檢查", ...})
- Task({description: "整合分析", ...})
這樣才能真正並行執行!
↓
Phase 2: REDUCE(問題匯總)
├── 問題分類(BLOCKER/HIGH/MEDIUM/LOW)
├── 優先排序
└── 修復建議
↓
Phase 3: 品質評分 → 各維度評分
↓
Phase 4: 品質閘門 → 通過/回退決策
Issue classification
| Level | Definition | Handling |
|---|---|---|
| BLOCKER | Must be fixed to continue | Roll back to IMPLEMENT |
| HIGH | Important issue, should be fixed | Fix within time limit |
| MEDIUM | Suggested improvement | Record and track |
| LOW | Style suggestion | Optional |
Quality scoring
Three-dimension scoring:
- Completeness (30%): Complete functionality, no omissions
- Consistency (30%): Consistent style, no contradictions
- Actionability (40%): Specific and executable suggestions
→ Scoring configuration:shared/quality/scoring.yaml
CP4: Task Commit
After the quality gate check is complete,CP4 Task Commit must be executed。
Phase 4: 品質閘門 → 通過/回退決策
↓
CP4: Task Commit
├── git add .claude/memory/review/{implement-id}/
└── git commit -m "docs(review): complete {feature} code review"
→ Protocol:shared/git/commit-protocol.md
Quality gate
Pass conditions (REVIEW phase):
- ✅ No BLOCKER issues
- ✅ HIGH issues ≤ 2
- ✅ Quality score ≥ 75
Failure handling:
- BLOCKER exists → Roll back to IMPLEMENT
- HIGH > 2 → Require fix and re-review
→ Gate configuration:shared/quality/gates.yaml
Output structure
.claude/memory/review/[implement-id]/
├── meta.yaml # 元數據
├── perspectives/ # 完整視角報告(MAP 產出,保留)
│ ├── code-quality.md
│ ├── test-coverage.md
│ ├── documentation.md
│ └── integration.md
├── summaries/ # 結構化摘要(REDUCE 產出,供快速查閱)
│ ├── code-quality.yaml
│ ├── test-coverage.yaml
│ ├── documentation.yaml
│ └── integration.yaml
├── issues.yaml # 問題清單
├── scoring.yaml # 評分詳情
└── review-summary.md # 審查摘要(主輸出)
⚠️ perspectives/ stores the complete report, summaries/ stores the structured summary, both must be retained.
Agent capability limitations
Review Agent should not open Task:
| Allowed operations | Description |
|---|---|
| ✅ Read | Read code |
| ✅ Glob/Grep | Search files and content |
| ✅ Bash | Execute commands |
| ✅ Write | Write reports |
| ❌ Task | Open sub-Agent |
Action log
After each tool call completes, record to .claude/workflow/{workflow-id}/logs/actions.jsonl。
Recording timing:
- Success: record
tool、input、output_preview、duration_ms、status: success - Failure: record
tool、input、error、stderr(if any),status: failed
Key actions (REVIEW phase):
| Action | Recording focus |
|---|---|
| Read (read code) | file_path、output_size |
| Task (start review Agent) | subagent_type、prompt (truncated)、agent_id |
| Grep (search issue patterns) | pattern、match_count |
| Write (write review report) | file_path、content_size |
Troubleshoot issues:
# 查看 REVIEW 階段所有失敗行動
jq 'select(.stage == "REVIEW" and .status == "failed")' actions.jsonl
# 查看特定審查視角的行動
jq 'select(.agent_id == "agent_code-quality")' actions.jsonl
→ Log specification:shared/communication/execution-logs.md
Shared modules
| Module | Purpose |
|---|---|
| coordination/map-phase.md | Parallel coordination |
| coordination/reduce-phase.md | Aggregation and integration, large file handling |
| quality/scoring.yaml | Quality scoring |
| quality/gates.yaml | Quality gate |
| quality/rollback-strategy.yaml | Rollback strategy |
| perspectives/expertise-frameworks/ | Professional Framework |
Workflow Position
RESEARCH → PLAN → TASKS → IMPLEMENT → REVIEW → VERIFY
↑
你在這裡
- Input: Implemented code, from
implementskill - Output: Review report, for
verifyskill verification or rollbackimplement