dispatching-parallel-agentslisted
Install: claude install-skill shumingyang-opencode/superpowers-zh-tw
# 派發並行代理
## 總覽
你將任務委派給具備隔離上下文的專門代理。透過精確構思它們的指令與上下文,你確保它們能保持專注並成功完成任務。它們不應繼承你 session 的上下文或歷史 —— 你為它們建構所需的全部內容。這也為協調工作保留了你的上下文。
當你有多個互不相關的失敗(不同的測試檔、不同的子系統、不同的 bug)時,���一調查會浪費時間。每次調查都彼此獨立,可以並行進行。
**核心原則:** 每個獨立的問題領域派發一個代理,讓它們並行運作。
## 何時使用
```dot
digraph when_to_use {
"Multiple failures?" [shape=diamond];
"Are they independent?" [shape=diamond];
"Single agent investigates all" [shape=box];
"One agent per problem domain" [shape=box];
"Can they work in parallel?" [shape=diamond];
"Sequential agents" [shape=box];
"Parallel dispatch" [shape=box];
"Multiple failures?" -> "Are they independent?" [label="yes"];
"Are they independent?" -> "Single agent investigates all" [label="no - related"];
"Are they independent?" -> "Can they work in parallel?" [label="yes"];
"Can they work in parallel?" -> "Parallel dispatch" [label="yes"];
"Can they work in parallel?" -> "Sequential agents" [label="no - shared state"];
}
```
**使用時機:**
- 3 個以上測試檔因不同根因而失敗
- 多個子系統各自獨立損壞
- 每個問題無需依賴其他問題的上下文即可理解
- 各調查之間沒有共享狀態
**不要使用的時機:**
- 失敗彼此相關(修好一個可能連帶修好其他)
- 需要理解完整的系統狀態
- 代理會互相干擾
## 模式
### 1. 識別獨立的問題領域
按損壞的內容對失敗分組:
- 檔案 A 測試:工具核准流程
- 檔案 B 測試:批次完成行為
- 檔案 C 測試:中止功能
每個領域彼此獨立 —— 修正工具核准不會影響中止測試。
### 2. 建立聚焦的代理任務
每個代理會收到:
- **明確範圍:** 單一測試檔或子系統
- **清楚目標:** 讓這些測試通過
- **限制:** 不要更動其他程式碼
- **預期輸出:** 你發現與修正內容的摘要
### 3. 並行派發
在同一則回應中發出全部三個子代理派發 —— 它們會並行執行:
```text
Subagent (general-purpose): "Fix agent-tool-abort.test.ts failures"
Subagent (general-purpose): "Fix