Multi-perspective parallel planning → Risk assessment → Consensus design → Implementation plan (auto commit)
Automation Mechanisms
⚡ This skill has integrated Claude Code Hooks
- Action logging, state tracking, and git commit are all handled automatically by hooks
- Only CP1 initialization needs to be executed; the remaining checkpoints execute automatically
Usage
/multi-plan [功能需求]
/multi-plan 建立用戶認證系統 --from-research ID
Flags: --perspectives N | --quick | --deep | --from-research ID
Default 4 perspectives
| ID | Name | Model | Focus |
|---|---|---|---|
architect |
System Architect | sonnet | Technical feasibility, component design |
risk-analyst |
Risk Analyst | sonnet | Potential risks, failure scenarios |
estimator |
Estimation Expert | haiku | Effort estimation, schedule planning |
ux-advocate |
UX Advocate | haiku | User experience, API design |
→ Model routing configuration:shared/config/model-routing.yaml
Execution Flow
CP1: 工作流初始化 ⚡ 手動執行
python scripts/hooks/init_workflow.py --topic "{feature}" --stage PLAN
↓
Phase 0: 需求錨定 → 載入 research 上下文、確認驗收標準
↓
Phase 1: Memory 搜尋 → 識別可重用的設計決策
↓
Phase 2: 視角分解 → 早期安全/架構檢查
↓
Phase 3: MAP(並行規劃)✅ 自動追蹤
┌──────────┬──────────┬──────────┬──────────┐
│ 架構師 │ 風險分析 │ 估算專家 │ UX 倡導 │
└──────────┴──────────┴──────────┴──────────┘
[CP2/CP3 由 hooks 自動處理 Agent 狀態追蹤]
⚠️ **並行執行關鍵**:
在單一訊息中發送 4 個 Task 工具呼叫:
- Task({description: "架構師視角", ...})
- Task({description: "風險分析視角", ...})
- Task({description: "估算專家視角", ...})
- Task({description: "UX 倡導視角", ...})
這樣才能真正並行執行!
⚠️ **強制**:每個 Agent 必須在完成前執行:
1. mkdir -p .claude/memory/plans/{feature-id}/perspectives/
2. Write → .claude/memory/plans/{feature-id}/perspectives/{perspective_id}.md
未執行 Write = 任務失敗,工作流中止
↓
Phase 4: REDUCE(共識設計 + 風險緩解)
↓
Phase 5: 產出實作計劃 → 品質閘門檢查
↓
Phase 6: Memory 存檔
↓
CP4: Task Commit ✅ 自動執行
[寫入 .claude/memory/ 時自動 git commit]
Early Error Interception
Perform preventive checks in Phase 2:
Security(BLOCKER):
- Authentication mechanism defined
- Authorization model specified
- Data validation strategy defined
Architecture(HIGH):
- No circular dependencies
- Clear module boundaries
→ Configuration:shared/quality/early-detection.yaml
CP4: Task Commit
After Memory archiving is complete,CP4 Task Commit must be executed。
Phase 6: Memory 存檔
↓
CP4: Task Commit
├── git add .claude/memory/plans/{feature-id}/
└── git commit -m "feat(plan): design {feature} implementation plan"
→ Protocol:shared/git/commit-protocol.md
Quality Gates
Pass conditions (PLAN phase):
- ✅ All necessary components have designs
- ✅ Risk assessment completed
- ✅ Milestones clearly defined
- ✅ Quality score ≥ 75
→ Gate configuration:shared/quality/gates.yaml
Output Structure
.claude/memory/plans/[feature-id]/
├── meta.yaml # 元數據
├── perspectives/ # 完整視角報告(MAP 產出,保留)
│ ├── architect.md
│ ├── risk-analyst.md
│ ├── estimator.md
│ └── ux-advocate.md
├── summaries/ # 結構化摘要(REDUCE 產出,供快速查閱)
│ ├── architect.yaml
│ ├── risk-analyst.yaml
│ ├── estimator.yaml
│ └── ux-advocate.yaml
├── synthesis.md # 共識設計
├── implementation-plan.md # 實作計劃(主輸出)
├── milestones.md # 里程碑清單
└── risk-mitigation.md # 風險緩解策略
⚠️ perspectives/ stores complete reports, summaries/ stores structured summaries; both must be retained.
Agent Capability Restrictions
Perspective Agents should not open Tasks:
| Allowed Operations | Description |
|---|---|
| ✅ Read | Read files |
| ✅ Glob/Grep | Search files and content |
| ✅ Explore agent | Lightweight exploration |
| ✅ Bash | Execute commands |
| ✅ WebFetch | Fetch web pages |
| ✅ Write | Write reports |
| ❌ Task | Spawn sub-agents |
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 (PLAN phase):
| Action | Recording Focus |
|---|---|
| Read (read research report) | file_path、output_size |
| Task (launch Agent) | subagent_type、prompt (truncated)、agent_id |
| Write (write plan) | file_path、content_size |
Troubleshooting:
# 查看 PLAN 階段所有失敗行動
jq 'select(.stage == "PLAN" and .status == "failed")' actions.jsonl
# 查看特定視角 Agent 的行動
jq 'select(.agent_id == "agent_architect")' 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 processing |
| synthesis/cross-validation.md | Cross-validation |
| quality/gates.yaml | Quality gates |
| quality/early-detection.yaml | Early interception |
Workflow Position
RESEARCH → PLAN → TASKS → IMPLEMENT → REVIEW → VERIFY
↑
你在這裡
- Input: can load research reports from the
researchskill - Output:
implementation-plan.mdfor thetasksskill to use