選項

team-builder

affaan-m/ECC affaan-m/ECC

瀏覽可用的代理角色,並組建最多 5 名代理組成的臨時團隊,讓他們並行處理一項任務,然後整合他們的結果。

...展開全部
0
更新時間 2026-10-02

團隊建構器

用於按需瀏覽及組建代理團隊的互動式選單。適用於平層式或以網域為基礎的子目錄式代理集合。

何時使用

  • 您擁有多個代理角色(Markdown 檔案),並希望為某項任務挑選要使用的角色
  • 您希望從不同領域(例如:資安 + SEO + 架構)中組建一個臨時團隊
  • 您希望在決定前先瀏覽可用的代理程式

先決條件

代理程式檔案必須是包含角色提示(身分、規則、工作流程、交付成果)的 Markdown 檔案。第一個# 標題將用作代理程式名稱,而第一個段落則用作描述。

同時支援平面式與子目錄式佈局:

子目錄佈局— 領域由資料夾名稱推斷:

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

設定

代理程式可透過兩種方法被偵測到,並會根據代理程式名稱進行合併與去重:

  1. claude agents指令(主要方式)— 執行claude agents可取得 CLI 已知的所有代理程式,包括使用者代理程式、外掛程式代理程式(例如everything-claude-code:architect)以及內建代理程式。此方式可自動涵蓋 ECC 市集的安裝項目,無需任何路徑設定。
  2. 檔案通配符(備用方案,用於讀取代理程式內容)—— 代理程式 Markdown 檔案讀取自:
    • ./agents/**/*.md+./agents/*.md— 專案本地的代理程式
    • ~/.claude/agents/**/*.md+~/.claude/agents/*.md— 全球使用者代理程式

當名稱衝突時,較早的來源具有優先權:使用者代理程式 > 外掛程式代理程式 > 內建代理程式。若使用者指定了自訂路徑,則可改用該路徑。

運作原理

步驟 1:探索可用代理程式

執行 `claude agents` 以取得完整的代理程式清單。解析每一行:

  • 外掛程式代理前綴為plugin-name:(例如:everything-claude-code:security-reviewer)。將:後面的部分作為代理名稱,並將外掛程式名稱作為網域。
  • 使用者代理程式沒有前綴。從~/.claude/agents/或./agents/讀取對應的 Markdown 檔案,以擷取名稱和描述。
  • 內建代理程式(例如Explore、Plan)將被跳過,除非使用者明確要求包含它們。

對於從 Markdown 檔案載入的使用者代理:

  • 子目錄佈局:從父目錄名稱中提取網域
  • 扁平結構:彙整所有檔案名稱前綴(第一個「-」之前的文字)。僅當某個前綴出現在兩個或更多檔案名稱中時,才符合作為領域的資格(例如:engineering-security-engineer.md和engineering-software-architect.md均以engineering開頭 → Engineering 領域)。 具有唯一前綴的檔案(例如:code-reviewer.md、tdd-guide.md)將歸類於「一般」
  • 從第一個# 標題中提取代理名稱。若未找到標題,則從檔案名稱推導名稱(移除.md 後綴、將連字號替換為空格、採用標題大小寫格式)
  • 從標題後的第一段中提取一行摘要

若執行claude agents並掃描檔案位置後未找到任何代理程式,請通知使用者:「未找到代理程式。請執行claude agents以驗證您的設定。」然後停止。

步驟 2:顯示領域選單

可用的代理領域:
1. 工程 — 軟體架構師、資安工程師
2. 行銷 — SEO 專家
3. 銷售 — 商機發掘教練、外展策略師

選擇領域或指定特定代理名稱(例如:「1,3」或「security + seo」):
  • 跳過沒有代理的領域(空目錄)
  • 顯示各領域的代理人數

步驟 3:處理選項

接受彈性輸入:

  • 數字:輸入「1,3」將選取工程與銷售部門的所有專員
  • 名稱:「security + seo」會對已偵測到的代理進行模糊比對
  • 「工程部門的所有代理」會選取該網域中的所有代理

若選取的代理超過 5 個,請按字母順序列出並請使用者縮小範圍:「您已選取 N 個代理(上限 5 個)。請選擇要保留的代理,或說『前 5 個』以採用按字母順序排列的前五個。」

確認選取:

已選取:資安工程師 + SEO 專家
他們應負責哪些工作?(描述任務):

步驟 4:並行啟動代理

  1. 讀取每位已選取專員的 Markdown 檔案
  2. 若尚未提供任務描述,請提示使用者輸入
  3. 使用 Agent 工具並行啟動所有代理:
    • subagent_type: "general-purpose"
    • prompt: "{代理程式檔案內容}\n\n任務:{任務描述}"
    • 每個代理程式皆獨立運作 — 無需代理程式間的通訊
  4. 若某個代理程式失敗(發生錯誤、超時或輸出為空),請在程式內直接標註失敗訊息(例如:「資安工程師:失敗 — [原因]」),並繼續處理成功代理程式的結果

步驟 5:整合結果

彙整所有輸出結果,並呈列一份統整報告:

  • 按代理程式分組的結果
  • 彙整部分應重點呈現:
    • 各代理之間的共識
    • 各項建議之間的衝突或張力
    • 建議的後續步驟

若僅選取 1 個代理,則跳過綜合分析,直接呈現輸出結果。

規則

  • 僅限動態偵測。切勿將代理程式清單硬編碼。目錄中的新檔案會自動出現在選單中。
  • 每隊最多 5 個代理。超過 5 個將導致效益遞減且過度消耗代幣。請於選取時強制執行此限制。
  • 並行調度。所有代理均同時運行——請使用 Agent 工具的並行呼叫模式。
  • 使用並行 Agent 呼叫,而非 TeamCreate。此技能採用並行 Agent 工具呼叫以進行獨立作業。TeamCreate(Claude Code 用於多代理對話的工具)僅在代理需進行辯論或相互回應時才需要。

範例

使用者:團隊建立者

Claude:
可用的代理領域:
1. 工程 (2) — 軟體架構師、資安工程師
2. 行銷 (1) — SEO 專家
3. 銷售 (4) — 需求發掘教練、外展策略師、提案策略師、銷售工程師
4. 支援 (1) — 執行摘要

請選擇領域或指定特定代理程式:

使用者:安全 + SEO

Claude:
已選取:資安工程師 + SEO 專家
他們應該處理什麼任務?

使用者:在正式上線前審查我的 Next.js 電子商務網站

[兩位代理程式並行啟動,各自運用專業領域分析程式碼庫]

克勞德:
## 資安工程師的發現
- [發現內容...]

## SEO 專家的發現
- [發現內容...]

## 綜合分析
兩位代理均認同:[...]
衝突點:安全工程師建議採用會封鎖內嵌樣式的 CSP,而 SEO 專家則需要內嵌的 Schema 標記。解決方案:[...]
後續步驟:[...]
在 GitHub 上查看
---
name: team-builder
description: Browse available agent personas and compose ad-hoc teams of up to 5 agents to work in parallel on a task, then synthesize their results.
---

# 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. `everything-claude-code: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., `everything-claude-code: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: [...]
```

所有檔案

1 個檔案

安裝 team-builder

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/affaan-m/ECC/tree/main/skills/team-builder # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/ Claude 會自動偵測並使用該技能
儲存庫 affaan-m/ECC

相關技能

airtable-automation
更新時間 2026-06-29
seo-programmatic
更新時間 2026-06-29
notion-automation
更新時間 2026-06-29
fairdb-backup-manager
更新時間 2026-06-29
OR