选项

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: "通用型"
    • prompt: "{代理文件内容}\n\n任务:{任务描述}"
    • 每个代理独立运行——无需代理间通信
  4. 如果某个代理失败(错误、超时或输出为空),请在代码中直接记录失败信息(例如:“安全工程师:失败 — [原因]”),并继续处理成功代理的结果

步骤 5:整合结果

收集所有输出结果,并生成一份综合报告:

  • 按代理分组的结果
  • 汇总部分应突出显示:
    • 各代理之间的共识
    • 建议之间的冲突或矛盾
    • 建议的后续步骤

如果仅选择了一个代理,则跳过综合分析,直接呈现输出结果。

规则

  • 仅支持动态发现。切勿硬编码代理列表。目录中的新文件会自动显示在菜单中。
  • 每支团队最多 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