team-composition-patterns

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Team Composition Patterns

Agent团队构成模式

Best practices for composing multi-agent teams, selecting team sizes, choosing agent types, and configuring display modes for Claude Code's Agent Teams feature.
为Claude Code的Agent Teams功能撰写的多Agent团队组建、团队规模选择、Agent类型挑选及显示模式配置的最佳实践。

When to Use This Skill

何时使用此技能

  • Deciding how many teammates to spawn for a task
  • Choosing between preset team configurations
  • Selecting the right agent type (subagent_type) for each role
  • Configuring teammate display modes (tmux, iTerm2, in-process)
  • Building custom team compositions for non-standard workflows
  • 决定为某项任务配置多少个Agent成员
  • 选择预设的团队配置
  • 为每个角色选择合适的Agent类型(subagent_type)
  • 配置成员显示模式(tmux、iTerm2、in-process)
  • 为非标准工作流构建自定义团队构成

Team Sizing Heuristics

团队规模估算准则

ComplexityTeam SizeWhen to Use
Simple1-2Single-dimension review, isolated bug, small feature
Moderate2-3Multi-file changes, 2-3 concerns, medium features
Complex3-4Cross-cutting concerns, large features, deep debugging
Very Complex4-5Full-stack features, comprehensive reviews, systemic issues
Rule of thumb: Start with the smallest team that covers all required dimensions. Adding teammates increases coordination overhead.
复杂度团队规模适用场景
简单1-2单维度评审、孤立Bug修复、小型功能开发
中等2-3多文件变更、涉及2-3项关注点、中型功能开发
复杂3-4跨模块关注点、大型功能开发、深度调试
极复杂4-5全栈功能开发、全面评审、系统性问题排查
经验法则:从能覆盖所有需求维度的最小团队规模开始。增加成员会提升协调成本。

Preset Team Compositions

预设团队构成

Review Team

评审团队

  • Size: 3 reviewers
  • Agents: 3x
    team-reviewer
  • Default dimensions: security, performance, architecture
  • Use when: Code changes need multi-dimensional quality assessment
  • 规模:3名评审员
  • Agent类型:3个
    team-reviewer
  • 默认评审维度:安全性、性能、架构
  • 适用场景:代码变更需要多维度质量评估时

Debug Team

调试团队

  • Size: 3 investigators
  • Agents: 3x
    team-debugger
  • Default hypotheses: 3 competing hypotheses
  • Use when: Bug has multiple plausible root causes
  • 规模:3名调查员
  • Agent类型:3个
    team-debugger
  • 默认假设:3种相互竞争的故障假设
  • 适用场景:Bug存在多种可能根因时

Feature Team

功能开发团队

  • Size: 3 (1 lead + 2 implementers)
  • Agents: 1x
    team-lead
    + 2x
    team-implementer
  • Use when: Feature can be decomposed into parallel work streams
  • 规模:3人(1名负责人 + 2名实现者)
  • Agent类型:1个
    team-lead
    + 2个
    team-implementer
  • 适用场景:功能可拆分为并行工作流时

Fullstack Team

全栈团队

  • Size: 4 (1 lead + 3 implementers)
  • Agents: 1x
    team-lead
    + 1x frontend
    team-implementer
    + 1x backend
    team-implementer
    + 1x test
    team-implementer
  • Use when: Feature spans frontend, backend, and test layers
  • 规模:4人(1名负责人 + 3名实现者)
  • Agent类型:1个
    team-lead
    + 1名前端
    team-implementer
    + 1名后端
    team-implementer
    + 1名测试
    team-implementer
  • 适用场景:功能覆盖前端、后端及测试层时

Research Team

研究团队

  • Size: 3 researchers
  • Agents: 3x
    general-purpose
  • Default areas: Each assigned a different research question, module, or topic
  • Capabilities: Codebase search (Grep, Glob, Read), web search (WebSearch, WebFetch)
  • Use when: Need to understand a codebase, research libraries, compare approaches, or gather information from code and web sources in parallel
  • 规模:3名研究员
  • Agent类型:3个
    general-purpose
  • 默认研究方向:每个成员分配不同的研究问题、模块或主题
  • 能力:代码库搜索(Grep、Glob、Read)、网络搜索(WebSearch、WebFetch)
  • 适用场景:需要理解代码库、研究类库、对比实现方案,或并行从代码及网络来源收集信息时

Security Team

安全团队

  • Size: 4 reviewers
  • Agents: 4x
    team-reviewer
  • Default dimensions: OWASP/vulnerabilities, auth/access control, dependencies/supply chain, secrets/configuration
  • Use when: Comprehensive security audit covering multiple attack surfaces
  • 规模:4名评审员
  • Agent类型:4个
    team-reviewer
  • 默认评审维度:OWASP/漏洞、授权/访问控制、依赖项/供应链、密钥/配置
  • 适用场景:覆盖多个攻击面的全面安全审计时

Migration Team

迁移团队

  • Size: 4 (1 lead + 2 implementers + 1 reviewer)
  • Agents: 1x
    team-lead
    + 2x
    team-implementer
    + 1x
    team-reviewer
  • Use when: Large codebase migration (framework upgrade, language port, API version bump) requiring parallel work with correctness verification
  • 规模:4人(1名负责人 + 2名实现者 + 1名评审员)
  • Agent类型:1个
    team-lead
    + 2个
    team-implementer
    + 1个
    team-reviewer
  • 适用场景:大型代码库迁移(框架升级、语言移植、API版本更新),需要并行工作并验证正确性时

Agent Type Selection

Agent类型选择

When spawning teammates with the Task tool, choose
subagent_type
based on what tools the teammate needs:
Agent TypeTools AvailableUse For
general-purpose
All tools (Read, Write, Edit, Bash, etc.)Implementation, debugging, any task requiring file changes
Explore
Read-only tools (Read, Grep, Glob)Research, code exploration, analysis
Plan
Read-only toolsArchitecture planning, task decomposition
agent-teams:team-reviewer
All toolsCode review with structured findings
agent-teams:team-debugger
All toolsHypothesis-driven investigation
agent-teams:team-implementer
All toolsBuilding features within file ownership boundaries
agent-teams:team-lead
All toolsTeam orchestration and coordination
Key distinction: Read-only agents (Explore, Plan) cannot modify files. Never assign implementation tasks to read-only agents.
使用Task工具生成Agent成员时,需根据成员所需工具选择
subagent_type
Agent类型可用工具适用场景
general-purpose
所有工具(Read、Write、Edit、Bash等)功能实现、调试、任何需要修改文件的任务
Explore
只读工具(Read、Grep、Glob)研究、代码探索、分析
Plan
只读工具架构规划、任务分解
agent-teams:team-reviewer
所有工具带有结构化结论的代码评审
agent-teams:team-debugger
所有工具基于假设的故障调查
agent-teams:team-implementer
所有工具在文件所有权边界内构建功能
agent-teams:team-lead
所有工具团队编排与协调
关键区别:只读Agent(Explore、Plan)无法修改文件。切勿为只读Agent分配实现类任务。

Display Mode Configuration

显示模式配置

Configure in
~/.claude/settings.json
:
json
{
  "teammateMode": "tmux"
}
ModeBehaviorBest For
"tmux"
Each teammate in a tmux paneDevelopment workflows, monitoring multiple agents
"iterm2"
Each teammate in an iTerm2 tabmacOS users who prefer iTerm2
"in-process"
All teammates in same processSimple tasks, CI/CD environments
~/.claude/settings.json
中配置:
json
{
  "teammateMode": "tmux"
}
模式行为说明最佳适用场景
"tmux"
每个成员在独立的tmux面板中开发工作流、监控多个Agent
"iterm2"
每个成员在独立的iTerm2标签页偏好iTerm2的macOS用户
"in-process"
所有成员在同一进程中简单任务、CI/CD环境

Custom Team Guidelines

自定义团队准则

When building custom teams:
  1. Every team needs a coordinator — Either designate a
    team-lead
    or have the user coordinate directly
  2. Match roles to agent types — Use specialized agents (reviewer, debugger, implementer) when available
  3. Avoid duplicate roles — Two agents doing the same thing wastes resources
  4. Define boundaries upfront — Each teammate needs clear ownership of files or responsibilities
  5. Keep it small — 2-4 teammates is the sweet spot; 5+ requires significant coordination overhead
构建自定义团队时:
  1. 每个团队都需要协调者 —— 要么指定一个
    team-lead
    ,要么由用户直接协调
  2. 角色与Agent类型匹配 —— 尽可能使用专用Agent(评审员、调试员、实现者)
  3. 避免重复角色 —— 两个Agent执行相同任务会浪费资源
  4. 提前定义边界 —— 每个成员需要明确的文件所有权或职责范围
  5. 保持团队规模精简 —— 2-4名成员是最佳规模;5名及以上成员需要大量协调成本