team-builder

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Team Builder

Team Builder

Interactive menu for browsing and composing agent teams on demand. Works with flat or domain-subdirectory agent collections.
用于按需浏览和组建Agent团队的交互式菜单,支持扁平化或按领域分目录的Agent集合。

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
  • 你拥有多个Agent角色(markdown文件),希望选择合适的Agent执行任务
  • 你想要从不同领域组建临时团队(例如,安全 + SEO + 架构)
  • 你希望先浏览可用Agent再做选择

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
Agent文件必须是包含角色提示(身份、规则、工作流程、交付成果)的markdown文件。第一个
# 标题
将被用作Agent名称,第一段将作为描述。
支持扁平化和分目录两种文件布局:
分目录布局 — 领域信息从文件夹名称推导:
agents/
├── engineering/
│   ├── security-engineer.md
│   └── software-architect.md
├── marketing/
│   └── seo-specialist.md
└── sales/
    └── discovery-coach.md
扁平化布局 — 领域信息从文件名共享前缀推导。当2个及以上文件共享同一个前缀时,该前缀被视为领域。前缀唯一的文件将归入“通用”领域。注意:算法会在第一个
-
处拆分文件名,因此多词领域(如
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

Configuration

配置说明

Agent directories are probed in order and results are merged:
  1. ./agents/**/*.md
    +
    ./agents/*.md
    — project-local agents (both depths)
  2. ~/.claude/agents/**/*.md
    +
    ~/.claude/agents/*.md
    — global agents (both depths)
Results from all locations are merged and deduplicated by agent name. Project-local agents take precedence over global agents with the same name. A custom path can be used instead if the user specifies one.
Agent目录将按顺序探测,结果会合并:
  1. ./agents/**/*.md
    +
    ./agents/*.md
    — 项目本地Agent(包含所有层级)
  2. ~/.claude/agents/**/*.md
    +
    ~/.claude/agents/*.md
    — 全局Agent(包含所有层级)
所有位置的结果会合并,并根据Agent名称去重。项目本地Agent优先级高于同名的全局Agent。用户也可以指定自定义路径。

How It Works

工作原理

Step 1: Discover Available Agents

步骤1:发现可用Agent

Glob agent directories using the probe order above. Exclude README files. For each file found:
  • 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 agent files are found after probing all locations, inform the user: "No agent files found. Checked: [list paths probed]. Expected: markdown files in one of those directories." Then stop.
按照上述探测顺序遍历Agent目录,排除README文件。对于每个找到的文件:
  • 分目录布局:从父文件夹名称提取领域信息
  • 扁平化布局:收集所有文件名前缀(第一个
    -
    之前的文本)。只有当前缀出现在2个及以上文件名中时,才会被视为一个领域(例如
    engineering-security-engineer.md
    engineering-software-architect.md
    都以
    engineering
    开头 → 工程领域)。前缀唯一的文件(如
    code-reviewer.md
    tdd-guide.md
    )将被归类到“通用”领域
  • 从第一个
    # 标题
    提取Agent名称。如果没有找到标题,则从文件名推导(去除
    .md
    后缀,将连字符替换为空格,首字母大写)
  • 从标题后的第一段提取单行摘要
如果探测所有位置后未找到Agent文件,告知用户:“未找到Agent文件。已检查路径:[列出探测过的路径]。要求:上述目录中的markdown文件。”然后终止流程。

Step 2: Present Domain Menu

步骤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"):
  • Skip domains with zero agents (empty directories)
  • Show agent count per domain
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数量

Step 3: Handle Selection

步骤3:处理选择

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):
接受灵活的输入格式:
  • 数字:"1,3" 选择工程和销售领域的所有Agent
  • 名称:"security + seo" 模糊匹配已发现的Agent
  • "all from engineering" 选择该领域的所有Agent
如果选择的Agent超过5个,按字母顺序列出并要求用户缩小范围:“你已选择N个Agent(最多5个)。请选择保留哪些,或输入'first 5'使用按字母顺序排列的前5个。”
确认选择:
Selected: Security Engineer + SEO Specialist
What should they work on? (describe the task):

Step 4: Spawn Agents in Parallel

步骤4:并行启动Agent

  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
  1. 读取每个选中Agent的markdown文件
  2. 如果尚未提供任务描述,提示用户输入
  3. 使用Agent工具并行启动所有Agent:
    • subagent_type: "general-purpose"
    • prompt: "{agent file content}\n\nTask: {task description}"
    • 每个Agent独立运行 — 无需Agent间通信
  4. 如果某个Agent运行失败(错误、超时或输出为空),在结果中内联标注失败信息(例如“Security Engineer: failed — [原因]”),继续展示成功Agent的结果

Step 5: Synthesize Results

步骤5:合成结果

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.
收集所有输出并生成统一报告:
  • 按Agent分组展示结果
  • 合成部分重点突出:
    • 各Agent结论的共识点
    • 建议之间的冲突或矛盾
    • 推荐的后续步骤
如果仅选择了1个Agent,跳过合成步骤,直接展示输出结果。

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.
  • 仅动态发现。绝不硬编码Agent列表。目录中的新文件会自动出现在菜单中。
  • 每个团队最多5个Agent。超过5个会导致收益递减和令牌使用过量。在选择阶段强制执行此限制。
  • 并行调度。所有Agent同时运行 — 使用Agent工具的并行调用模式。
  • 使用并行Agent调用,而非TeamCreate。本技能使用并行Agent工具调用来完成独立工作。只有当Agent需要辩论或相互响应时,才需要使用TeamCreate(Claude Code的多Agent对话工具)。

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:
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

Security Engineer Findings

  • [findings...]
  • [findings...]

SEO Specialist Findings

SEO Specialist Findings

  • [findings...]
  • [findings...]

Synthesis

Synthesis

Both agents agree on: [...] Tension: Security recommends CSP that blocks inline styles, SEO needs inline schema markup. Resolution: [...] Next steps: [...]
undefined
Both agents agree on: [...] Tension: Security recommends CSP that blocks inline styles, SEO needs inline schema markup. Resolution: [...] Next steps: [...]
undefined