team-builder
列出可用 agent persona,挑最多五個平行跑並綜合結果
中文翻譯
---
name: team-builder
description: 互動式挑選器:透過 claude agents 指令和 agents/ markdown glob 找出可用的 agent persona,依領域分組,讓使用者最多選五個,對同一個任務平行派出,再把共識與衝突綜合成一份統一報告。要組 agent 團隊、瀏覽可用的 agent persona,或平行跑好幾個專家 agent 時使用。
metadata:
origin: community
---
# Team Builder
互動式選單,用來隨需瀏覽並組成 agent 團隊。扁平或依領域分子目錄的 agent 集合都能用。
## 何時使用
- 你有多個 agent persona(markdown 檔),想挑出哪幾個來做某個任務
- 你想從不同領域組一個臨時團隊(例如 Security + SEO + Architecture)
- 你想先瀏覽有哪些 agent 可用,再決定
## 前置條件
Agent 檔必須是含有 persona prompt(身分、規則、工作流程、交付物)的 markdown 檔。第一個 `# Heading` 當作 agent 名稱,第一段當作說明。
扁平和子目錄兩種配置都支援:
**子目錄配置**:領域從資料夾名稱推斷:
```
agents/
├── engineering/
│ ├── security-engineer.md
│ └── software-architect.md
├── marketing/
│ └── seo-specialist.md
└── sales/
└── discovery-coach.md
```
**扁平配置**:領域從共用的檔名前綴推斷。一個前綴要有 2 個以上的檔案共用才算領域。前綴獨一無二的檔案歸到「General」。注意:演算法是在第一個 `-` 處切開,所以多個單字的領域(例如 `product-management`)應該改用子目錄配置:
```
agents/
├── engineering-security-engineer.md
├── engineering-software-architect.md
├── marketing-seo-specialist.md
├── marketing-content-strategist.md
├── sales-discovery-coach.md
└── sales-outbound-strategist.md
```
## 設定
Agent 用兩種方式找出來,再依 agent 名稱合併去重:
1. **`claude agents` 指令**(主要):執行 `claude agents` 取得 CLI 知道的所有 agent,包括使用者 agent、plugin agent(例如 `ecc:architect`)和內建 agent。這樣不用設定任何路徑,就自動涵蓋 ECC marketplace 的安裝。
2. **檔案 glob**(備援,用來讀取 agent 內容):agent 的 markdown 檔從這些地方讀取:
- `./agents/**/*.md` + `./agents/*.md`:專案本地的 agent
- `~/.claude/agents/**/*.md` + `~/.claude/agents/*.md`:全域的使用者 agent
名稱衝突時,排在前面的來源優先:使用者 agent > plugin agent > 內建 agent。如果使用者指定了路徑,也可以改用自訂路徑。
## 運作方式
### 步驟 1:找出可用的 Agent
執行 `claude agents` 取得完整的 agent 清單。逐行解析:
- **Plugin agent** 帶有 `plugin-name:` 前綴(例如 `ecc:security-reviewer`)。用 `:` 後面的部分當 agent 名稱,plugin 名稱當領域。
- **使用者 agent** 沒有前綴。從 `~/.claude/agents/` 或 `./agents/` 讀對應的 markdown 檔,取出名稱和說明。
- **內建 agent**(例如 `Explore`、`Plan`)會略過,除非使用者明確要求納入。
對從 markdown 檔載入的使用者 agent:
- **子目錄配置:** 從父資料夾名稱取出領域
- **扁平配置:** 收集所有檔名前綴(第一個 `-` 之前的文字)。前綴要出現在 2 個以上的檔名裡才算領域(例如 `engineering-security-engineer.md` 和 `engineering-software-architect.md` 都以 `engineering` 開頭 → Engineering 領域)。前綴獨一無二的檔案(例如 `code-reviewer.md`、`tdd-guide.md`)歸到「General」
- 從第一個 `# Heading` 取出 agent 名稱。如果沒有標題,就從檔名推導名稱(去掉 `.md`、把連字號換成空格、轉成 title case)
- 從標題後的第一段取出一行摘要
如果執行 `claude agents` 並探查檔案位置之後,一個 agent 都找不到,就告訴使用者:「No agents found. Run `claude agents` to verify your setup.」然後停下來。
### 步驟 2:呈現領域選單
```
Available agent domains:
1. Engineering — Software Architect, Security Engineer
2. Marketing — SEO Specialist
3. Sales — Discovery Coach, Outbound Strategist
Pick domains or name specific agents (e.g., "1,3" or "security + seo"):
```
- 略過沒有任何 agent 的領域(空目錄)
- 顯示每個領域的 agent 數量
### 步驟 3:處理選擇
接受彈性的輸入:
- 數字:「1,3」會選 Engineering 和 Sales 的所有 agent
- 名稱:「security + seo」會對找到的 agent 做模糊比對
- 「all from engineering」會選那個領域的每個 agent
如果選了超過 5 個 agent,依字母順序列出,並請使用者縮減:「You selected N agents (max 5). Pick which to keep, or say 'first 5' to use the first five alphabetically.」
確認選擇:
```
Selected: Security Engineer + SEO Specialist
What should they work on? (describe the task):
```
### 步驟 4:平行派出 Agent
1. 讀取每個被選中的 agent 的 markdown 檔
2. 如果還沒提供任務描述,就詢問
3. 用 Agent 工具平行派出所有 agent:
- `subagent_type: "general-purpose"`
- `prompt: "{agent file content}\n\nTask: {task description}"`
- 每個 agent 各自獨立執行,不需要 agent 之間互相溝通
4. 如果有 agent 失敗(錯誤、timeout 或空輸出),就在行內註記失敗(例如「Security Engineer: failed — [reason]」),並繼續處理成功的 agent 的結果
### 步驟 5:綜合結果
收集所有輸出並呈現一份統一報告:
- 依 agent 分組的結果
- 綜合段落,標出:
- 各 agent 之間的共識
- 建議之間的衝突或張力
- 建議的下一步
如果只選了 1 個 agent,就跳過綜合,直接呈現輸出。
## 規則
- **只能動態探索。** 絕對不要寫死 agent 清單。目錄裡的新檔案會自動出現在選單裡。
- **每個團隊最多 5 個 agent。** 超過 5 個報酬遞減,而且 token 用量過多。在選擇時就要強制執行。
- **平行派出。** 所有 agent 同時執行,使用 Agent 工具的平行呼叫模式。
- **用平行的 Agent 呼叫,不要用 TeamCreate。** 這個 skill 用平行的 Agent 工具呼叫處理獨立的工作。TeamCreate(Claude Code 裡用於多 agent 對話的工具)只有在 agent 必須互相辯論或回應時才需要。
## 範例
```
User: team builder
Claude:
Available agent domains:
1. Engineering (2) — Software Architect, Security Engineer
2. Marketing (1) — SEO Specialist
3. Sales (4) — Discovery Coach, Outbound Strategist, Proposal Strategist, Sales Engineer
4. Support (1) — Executive Summary
Pick domains or name specific agents:
User: security + seo
Claude:
Selected: Security Engineer + SEO Specialist
What should they work on?
User: Review my Next.js e-commerce site before launch
[Both agents spawn in parallel, each applying their specialty to the codebase]
Claude:
## Security Engineer Findings
- [findings...]
## SEO Specialist Findings
- [findings...]
## Synthesis
Both agents agree on: [...]
Tension: Security recommends CSP that blocks inline styles, SEO needs inline schema markup. Resolution: [...]
Next steps: [...]
```英文原文
---
name: team-builder
description: Interactive picker that discovers available agent personas via the claude agents command and agents/ markdown globs, groups them into domains, has the user select up to five, dispatches them in parallel on one task, and synthesizes agreements and conflicts into a unified report. Use when composing a team of agents, browsing available agent personas, or running several specialist agents in parallel.
metadata:
origin: community
---
# Team Builder
Interactive menu for browsing and composing agent teams on demand. Works with flat or domain-subdirectory agent collections.
## When to Use
- You have multiple agent personas (markdown files) and want to pick which ones to use for a task
- You want to compose an ad-hoc team from different domains (e.g., Security + SEO + Architecture)
- You want to browse what agents are available before deciding
## Prerequisites
Agent files must be markdown files containing a persona prompt (identity, rules, workflow, deliverables). The first `# Heading` is used as the agent name and the first paragraph as the description.
Both flat and subdirectory layouts are supported:
**Subdirectory layout** — domain is inferred from the folder name:
```
agents/
├── engineering/
│ ├── security-engineer.md
│ └── software-architect.md
├── marketing/
│ └── seo-specialist.md
└── sales/
└── discovery-coach.md
```
**Flat layout** — domain inferred from shared filename prefixes. A prefix counts as a domain when 2+ files share it. Files with unique prefixes go to "General". Note: the algorithm splits at the first `-`, so multi-word domains (e.g., `product-management`) should use the subdirectory layout instead:
```
agents/
├── engineering-security-engineer.md
├── engineering-software-architect.md
├── marketing-seo-specialist.md
├── marketing-content-strategist.md
├── sales-discovery-coach.md
└── sales-outbound-strategist.md
```
## Configuration
Agents are discovered via two methods, merged and deduplicated by agent name:
1. **`claude agents` command** (primary) — run `claude agents` to get all agents known to the CLI, including user agents, plugin agents (e.g. `ecc:architect`), and built-in agents. This automatically covers ECC marketplace installs without any path configuration.
2. **File glob** (fallback, for reading agent content) — agent markdown files are read from:
- `./agents/**/*.md` + `./agents/*.md` — project-local agents
- `~/.claude/agents/**/*.md` + `~/.claude/agents/*.md` — global user agents
Earlier sources take precedence when names collide: user agents > plugin agents > built-in agents. A custom path can be used instead if the user specifies one.
## How It Works
### Step 1: Discover Available Agents
Run `claude agents` to get the full agent list. Parse each line:
- **Plugin agents** are prefixed with `plugin-name:` (e.g., `ecc:security-reviewer`). Use the part after `:` as the agent name and the plugin name as the domain.
- **User agents** have no prefix. Read the corresponding markdown file from `~/.claude/agents/` or `./agents/` to extract the name and description.
- **Built-in agents** (e.g., `Explore`, `Plan`) are skipped unless the user explicitly asks to include them.
For user agents loaded from markdown files:
- **Subdirectory layout:** extract the domain from the parent folder name
- **Flat layout:** collect all filename prefixes (text before the first `-`). A prefix qualifies as a domain only if it appears in 2 or more filenames (e.g., `engineering-security-engineer.md` and `engineering-software-architect.md` both start with `engineering` → Engineering domain). Files with unique prefixes (e.g., `code-reviewer.md`, `tdd-guide.md`) are grouped under "General"
- Extract the agent name from the first `# Heading`. If no heading is found, derive the name from the filename (strip `.md`, replace hyphens with spaces, title-case)
- Extract a one-line summary from the first paragraph after the heading
If no agents are found after running `claude agents` and probing file locations, inform the user: "No agents found. Run `claude agents` to verify your setup." Then stop.
### Step 2: Present Domain Menu
```
Available agent domains:
1. Engineering — Software Architect, Security Engineer
2. Marketing — SEO Specialist
3. Sales — Discovery Coach, Outbound Strategist
Pick domains or name specific agents (e.g., "1,3" or "security + seo"):
```
- Skip domains with zero agents (empty directories)
- Show agent count per domain
### Step 3: Handle Selection
Accept flexible input:
- Numbers: "1,3" selects all agents from Engineering and Sales
- Names: "security + seo" fuzzy-matches against discovered agents
- "all from engineering" selects every agent in that domain
If more than 5 agents are selected, list them alphabetically and ask the user to narrow down: "You selected N agents (max 5). Pick which to keep, or say 'first 5' to use the first five alphabetically."
Confirm selection:
```
Selected: Security Engineer + SEO Specialist
What should they work on? (describe the task):
```
### Step 4: Spawn Agents in Parallel
1. Read each selected agent's markdown file
2. Prompt for the task description if not already provided
3. Spawn all agents in parallel using the Agent tool:
- `subagent_type: "general-purpose"`
- `prompt: "{agent file content}\n\nTask: {task description}"`
- Each agent runs independently — no inter-agent communication needed
4. If an agent fails (error, timeout, or empty output), note the failure inline (e.g., "Security Engineer: failed — [reason]") and continue with results from agents that succeeded
### Step 5: Synthesize Results
Collect all outputs and present a unified report:
- Results grouped by agent
- Synthesis section highlighting:
- Agreements across agents
- Conflicts or tensions between recommendations
- Recommended next steps
If only 1 agent was selected, skip synthesis and present the output directly.
## Rules
- **Dynamic discovery only.** Never hardcode agent lists. New files in the directory auto-appear in the menu.
- **Max 5 agents per team.** More than 5 produces diminishing returns and excessive token usage. Enforce at selection time.
- **Parallel dispatch.** All agents run simultaneously — use the Agent tool's parallel invocation pattern.
- **Parallel Agent calls, not TeamCreate.** This skill uses parallel Agent tool calls for independent work. TeamCreate (a Claude Code tool for multi-agent dialogue) is only needed when agents must debate or respond to each other.
## Examples
```
User: team builder
Claude:
Available agent domains:
1. Engineering (2) — Software Architect, Security Engineer
2. Marketing (1) — SEO Specialist
3. Sales (4) — Discovery Coach, Outbound Strategist, Proposal Strategist, Sales Engineer
4. Support (1) — Executive Summary
Pick domains or name specific agents:
User: security + seo
Claude:
Selected: Security Engineer + SEO Specialist
What should they work on?
User: Review my Next.js e-commerce site before launch
[Both agents spawn in parallel, each applying their specialty to the codebase]
Claude:
## Security Engineer Findings
- [findings...]
## SEO Specialist Findings
- [findings...]
## Synthesis
Both agents agree on: [...]
Tension: Security recommends CSP that blocks inline styles, SEO needs inline schema markup. Resolution: [...]
Next steps: [...]
```