team-builder

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

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文件),希望选择其中一些来完成某项任务
  • 你想从不同领域临时组建一个团队(例如:安全 + 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
可用Agent领域:
1. 工程领域 — 软件架构师、安全工程师
2. 营销领域 — SEO专家
3. 销售领域 — 发现教练

请选择领域或指定具体Agent名称(例如:"1,3" 或 "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个。”
确认选择:
已选中:安全工程师 + SEO专家
他们需要完成什么任务?(描述任务):

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文件内容}\n\n任务: {任务描述}"
    • 每个Agent独立运行——不需要Agent之间的通信
  4. 如果某个Agent运行失败(错误、超时或输出为空),在结果中内联标注失败信息(例如,"安全工程师: 运行失败 — [原因]"),并继续处理成功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:
用户: team builder

Claude:
可用Agent领域:
1. 工程领域 — 软件架构师、安全工程师
2. 营销领域 — SEO专家
3. 销售领域 — 发现教练、外展策略师、提案策略师、销售工程师
4. 支持领域 — 执行摘要

请选择领域或指定具体Agent名称(例如:"1,3" 或 "security + seo"):

用户: security + seo

Claude:
已选中:安全工程师 + SEO专家
他们需要完成什么任务?

用户: 我要在Next.js电商网站上线前对其进行审核

[两个Agent并行启动,各自将其专业知识应用到代码库中]

Claude:

Security Engineer Findings

安全工程师 发现结果

  • [findings...]
  • [发现内容...]

SEO Specialist Findings

SEO专家 发现结果

  • [findings...]
  • [发现内容...]

Synthesis

合成结果

Both agents agree on: [...] Tension: Security recommends CSP that blocks inline styles, SEO needs inline schema markup. Resolution: [...] Next steps: [...]
undefined
所有Agent达成的共识:[...] 冲突点:安全团队建议使用CSP阻止内联样式,而SEO需要内联Schema标记。解决方案:[...] 后续步骤:[...]
undefined