team-lead

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Team Lead — Compose & Coordinate Agent Teams

Team Lead — 组建与协调Agent团队

Analyze a task, pick the right team shape, spawn agents, coordinate work.
分析任务,选择合适的团队架构,生成Agent,协调工作。

Step 0: Project Config

步骤0:项目配置

Before spawning agents, ensure
.claude/project.json
exists:
bash
${CLAUDE_PLUGIN_ROOT}/scripts/cli init
Agents read this file for all build commands — no re-detection needed.
在生成Agent之前,确保
.claude/project.json
文件已存在:
bash
${CLAUDE_PLUGIN_ROOT}/scripts/cli init
Agent会从该文件中读取所有构建命令——无需重新检测。

Model Tiers

模型层级

TierModelUse for
Think
sonnet
Planning, architecture, debugging, review
Execute
haiku
Implementation, commands, edits, fixes
Default to
haiku
. Use
sonnet
only when reasoning depth matters.
层级模型适用场景
思考层
sonnet
规划、架构设计、调试、评审
执行层
haiku
代码实现、命令执行、代码编辑、问题修复
默认使用
haiku
。仅当需要深度推理时才使用
sonnet

Team Recipes

团队方案

Feature Dev (2-3 agents)

功能开发(2-3个Agent)

Trigger: New features, UI + backend, E2E work.
NameModelRole
leadsonnetIntegration, API contracts, shared types
backendhaikuAPI routes, DB, server logic
frontendhaikuComponents, UI, client-side (blocked by backend)
触发场景:新功能开发、UI+后端开发、端到端工作。
名称模型角色
负责人sonnet集成开发、API契约定义、共享类型设计
后端开发haikuAPI路由、数据库、服务器逻辑开发
前端开发haiku组件、UI、客户端逻辑开发(需等待后端完成)

Code Quality (2 agents)

代码质量保障(2个Agent)

Trigger: Reviews, tech debt, quality checks.
NameModelRole
reviewersonnetCorrectness, security, patterns (read-only)
debthaikuDuplicates, dead code, over-engineering (read-only)
触发场景:代码评审、技术债务清理、质量检查。
名称模型角色
评审员sonnet代码正确性、安全性、设计模式检查(只读)
债务清理员haiku重复代码、死代码、过度设计清理(只读)

Strategic Sprint (2-3 agents)

战略冲刺(2-3个Agent)

Trigger: Market research, competitive analysis, strategic planning, fundraising.
NameModelRole
researchersonnetMarket intelligence, competitor analysis
strategistsonnetPrioritization, roadmap (blocked by researcher)
ceosonnetDecision synthesis, OKRs, resource calls (blocked by strategist)
触发场景:市场调研、竞品分析、战略规划、融资准备。
名称模型角色
研究员sonnet市场情报收集、竞品分析
战略师sonnet优先级排序、路线图制定(需等待研究员完成)
决策者sonnet决策整合、OKRs制定、资源调配(需等待战略师完成)

Bug Hunt (2 agents)

漏洞排查(2个Agent)

Trigger: Bug fixes, debugging, incidents.
NameModelRole
investigatorsonnetRoot cause, reproduction steps
fixerhaikuImplement fix (blocked by investigator)
触发场景:Bug修复、调试、事件处理。
名称模型角色
调查员sonnet根因分析、复现步骤梳理
修复员haiku修复方案实现(需等待调查员完成)

Workflow

工作流程

  1. Analyze — Read task, pick closest recipe (or combine, cap at 4 agents)
  2. Create team
    TeamCreate
    , then
    TaskCreate
    for each work item
  3. Spawn agents
    Agent
    tool with model tier, permissions, team name
  4. Coordinate
    TaskUpdate
    to assign,
    SendMessage
    for blockers
  5. Gate — Each agent runs
    /gate
    before declaring done
  6. Ship — Run
    /ship
    to push and open PR
  1. 分析 — 解读任务,选择最匹配的方案(或组合方案,最多4个Agent)
  2. 创建团队 — 执行
    TeamCreate
    ,然后为每个工作项执行
    TaskCreate
  3. 生成Agent — 使用
    Agent
    工具,指定模型层级、权限和团队名称
  4. 协调工作 — 通过
    TaskUpdate
    分配任务,使用
    SendMessage
    处理阻塞问题
  5. 校验 — 每个Agent在完成任务前需运行
    /gate
    命令
  6. 交付 — 运行
    /ship
    命令推送代码并创建PR

Rules

规则

  • Smallest team possible. 2 agents over 3 when feasible.
  • Skip the team for single-focus tasks — do it yourself.
  • mode: "acceptEdits"
    for builders,
    mode: "default"
    for reviewers.
  • Never spawn duplicates — shut down stuck agents first.
  • Simple tasks don't need teams. Use judgment.
  • 尽可能使用最小规模的团队。可行时优先用2个Agent而非3个。
  • 单一目标的任务无需组建团队——直接自行完成。
  • 开发类Agent设置
    mode: "acceptEdits"
    ,评审类Agent设置
    mode: "default"
  • 不要生成重复的Agent——先关闭卡住的Agent。
  • 简单任务无需组建团队,请酌情判断。