Agent team

From zeuikli/claude-code-workspace · View interactive version

Agent team is an AI agent skill from the GitHub repository zeuikli/claude-code-workspace. 啟動 Agent Team 模式,多個 worker 平行處理任務並共享發現。適用於大型重構、codebase 遷移、全面審查。

How to use this skill

Skill file

Agent Team — 多 Worker 平行協作

依據 Multi-Agent Coordination Patterns 的 Agent Teams 模式

📦 離線歸檔:CODE0

啟動針對 $ARGUMENTS 的 Agent Team 協作。

架構

Coordinator(主對話)
├── Worker A — 負責領域 1
├── Worker B — 負責領域 2
└── Worker C — 負責領域 3

工作流程

  1. 分析任務範圍:理解 $ARGUMENTS 描述的任務
  2. 劃分工作區域:按目錄 / 模組 / 功能拆分,確保無重疊
  3. 啟動 Workers:每個 Worker 使用獨立 Sub Agent,指定:
  1. 平行執行:所有 Worker 同時啟動
  2. 收集結果:等待所有 Worker 完成,彙整摘要
  3. 衝突解決:如有跨 Worker 的衝突變更,由 Coordinator 決策
  4. 產出報告:統一的變更摘要 + 修改檔案清單

Worker 規範

終止條件

Data Contract Pattern(平行前先對齊 I/O 格式)

來源:shanraisshan/claude-code-best-practice — orchestration-workflow

在 fan-out Workers 之前,Coordinator 必須明確定義每個 Worker 的輸入格式與輸出格式,讓所有 Worker 的結果可以直接合併,無需二次轉換。

範例:三個 Worker 各自查詢不同時區的現在時間,輸出格式事先統一:

{ "time": "14:30", "tz": "UTC+8", "formatted": "2026-04-18 14:30 (UTC+8)" }

Coordinator 在 prompt 中明確寫出此 schema,Worker A/B/C 直接輸出符合格式的 JSON,Coordinator 只需 JSON.parse 後合併陣列,無需猜測欄位名稱或手動對齊格式。

沒有 Data Contract 的後果:Worker A 回傳 time: "2:30pm"、Worker B 回傳 timestamp: 1713420600,Coordinator 需要額外解析邏輯,增加錯誤風險。

Gotcha

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.