team-composition-patterns
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTeam 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
团队规模估算准则
| Complexity | Team Size | When to Use |
|---|---|---|
| Simple | 1-2 | Single-dimension review, isolated bug, small feature |
| Moderate | 2-3 | Multi-file changes, 2-3 concerns, medium features |
| Complex | 3-4 | Cross-cutting concerns, large features, deep debugging |
| Very Complex | 4-5 | Full-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 + 2x
team-leadteam-implementer - Use when: Feature can be decomposed into parallel work streams
- 规模:3人(1名负责人 + 2名实现者)
- Agent类型:1个+ 2个
team-leadteam-implementer - 适用场景:功能可拆分为并行工作流时
Fullstack Team
全栈团队
- Size: 4 (1 lead + 3 implementers)
- Agents: 1x + 1x frontend
team-lead+ 1x backendteam-implementer+ 1x testteam-implementerteam-implementer - Use when: Feature spans frontend, backend, and test layers
- 规模:4人(1名负责人 + 3名实现者)
- Agent类型:1个+ 1名前端
team-lead+ 1名后端team-implementer+ 1名测试team-implementerteam-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 + 2x
team-lead+ 1xteam-implementerteam-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个+ 2个
team-lead+ 1个team-implementerteam-reviewer - 适用场景:大型代码库迁移(框架升级、语言移植、API版本更新),需要并行工作并验证正确性时
Agent Type Selection
Agent类型选择
When spawning teammates with the Task tool, choose based on what tools the teammate needs:
subagent_type| Agent Type | Tools Available | Use For |
|---|---|---|
| All tools (Read, Write, Edit, Bash, etc.) | Implementation, debugging, any task requiring file changes |
| Read-only tools (Read, Grep, Glob) | Research, code exploration, analysis |
| Read-only tools | Architecture planning, task decomposition |
| All tools | Code review with structured findings |
| All tools | Hypothesis-driven investigation |
| All tools | Building features within file ownership boundaries |
| All tools | Team 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类型 | 可用工具 | 适用场景 |
|---|---|---|
| 所有工具(Read、Write、Edit、Bash等) | 功能实现、调试、任何需要修改文件的任务 |
| 只读工具(Read、Grep、Glob) | 研究、代码探索、分析 |
| 只读工具 | 架构规划、任务分解 |
| 所有工具 | 带有结构化结论的代码评审 |
| 所有工具 | 基于假设的故障调查 |
| 所有工具 | 在文件所有权边界内构建功能 |
| 所有工具 | 团队编排与协调 |
关键区别:只读Agent(Explore、Plan)无法修改文件。切勿为只读Agent分配实现类任务。
Display Mode Configuration
显示模式配置
Configure in :
~/.claude/settings.jsonjson
{
"teammateMode": "tmux"
}| Mode | Behavior | Best For |
|---|---|---|
| Each teammate in a tmux pane | Development workflows, monitoring multiple agents |
| Each teammate in an iTerm2 tab | macOS users who prefer iTerm2 |
| All teammates in same process | Simple tasks, CI/CD environments |
在中配置:
~/.claude/settings.jsonjson
{
"teammateMode": "tmux"
}| 模式 | 行为说明 | 最佳适用场景 |
|---|---|---|
| 每个成员在独立的tmux面板中 | 开发工作流、监控多个Agent |
| 每个成员在独立的iTerm2标签页 | 偏好iTerm2的macOS用户 |
| 所有成员在同一进程中 | 简单任务、CI/CD环境 |
Custom Team Guidelines
自定义团队准则
When building custom teams:
- Every team needs a coordinator — Either designate a or have the user coordinate directly
team-lead - Match roles to agent types — Use specialized agents (reviewer, debugger, implementer) when available
- Avoid duplicate roles — Two agents doing the same thing wastes resources
- Define boundaries upfront — Each teammate needs clear ownership of files or responsibilities
- Keep it small — 2-4 teammates is the sweet spot; 5+ requires significant coordination overhead
构建自定义团队时:
- 每个团队都需要协调者 —— 要么指定一个,要么由用户直接协调
team-lead - 角色与Agent类型匹配 —— 尽可能使用专用Agent(评审员、调试员、实现者)
- 避免重复角色 —— 两个Agent执行相同任务会浪费资源
- 提前定义边界 —— 每个成员需要明确的文件所有权或职责范围
- 保持团队规模精简 —— 2-4名成员是最佳规模;5名及以上成员需要大量协调成本