Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and file-lock claiming. Patterns for team sizing, task decomposition, and when to use teams vs sub-agents vs worktrees.
Agent Teams 智能编排决策引擎。自动分析任务复杂度,判断使用 Subagent 还是 Agent Teams。 触发场景: (1) 任务涉及多角度并行分析(如代码审查、竞争假说调试) (2) 需要成员之间互相通信、质疑、协作 (3) 跨层开发(前端/后端/测试各自负责) (4) 用户明确要求"创建团队"、"用 agent teams" (5) 任务描述包含"并行"、"同时"、"多人"、"协作"等关键词 (6) 使用 /team 命令 --- # Agent Teams 智能编排决策引擎 ## 核心决策逻辑 ### 第一步:任务特征分析 在收到用户任务后,**自动进行以下 5 维度评估**(无需用户明确要求): #### 1. 并行性维度 - ✅ **适合 Teams**: 多个子任务可以完全独立并行执行,不需要等待彼此结果 - ❌ **适合 Subagent**: 任务有明确的先后顺序,后续步骤依赖前面结果 #### 2. 通信需求维度 - ✅ **适合 Teams**: 成员需要互相分享发现、质疑对方结论、协商决策 - ❌ **适合 Subagent**: 只需要将结果报告给主 Agent,成员之间无需交流 #### 3. 上下文隔离维度 - ✅ **适合 Teams**: 每个成员需要聚焦不同领域,避免上下文污染 - ❌ **适合 Subagent**: 所有工作共享相同的知识背景和上下文 #### 4. 文件冲突维度 - ✅ **适合 Teams**: 每个成员操作不同的文件集,没有并发编辑冲突 - ❌ **适合 Subagent**: 多人需要修改同一文件(会导致覆盖冲突) #### 5. 成本收益维度 - ✅ **适合 Teams**: 并行探索的价值 > Token 成本(如研究、审查、新功能开发) - ❌ **适合 Subagent**: 简单任务,协调开销大于收益 --- ### 第二步:决策矩阵 根据以上维度得分,应用以下规则: | 场景类型 | 并行性 | 通信需求 | 上下文隔离 | 文件冲突 | 推荐方案 | 置信度 | |---------|-------|---------|----------|---------|---------|-------| | 多角度代码审查 | ✓ | ✓ | ✓ | ✓ | **Agent Teams** | 95% | | 竞争假说调试 | ✓ | ✓ | ✓ | ✓ | **Agent Teams** | 95% | | 跨层协调开发 | ✓ | ✓ | ✓ | ✓ | **Agent Teams** | 90% | | 独立目录搜索 | ✓ | ✗ | ✓ | ✓ | **Subagent** | 85% | | 顺序数据处理 | ✗ | ✗ | ✗ | ✓ | **Subagent** | 90% | | 单文件多人编辑 | ✓ | ✗ | ✗ | ✗ | **Subagent** | 95% | **决策规则:** - 4-5 个 ✓ → 强烈推荐 Agent Teams - 2-3 个 ✓ → 视任务复杂度决定 - 0-1 个 ✓ → 推荐 Subagent --- ## 团队设计指南 ### 团队规模建议 ``` 简单任务(代码审查、小型调试): 2-3 人 中等复杂度(新功能开发): 3-5 人 高复杂度(大型重构、架构设计): 5-7 人 ⚠️ 警告:超过 7 人协调成本急剧上升 ``` ### 角色分配原则 **1. 职责清晰化** - ✅ 好:`security-reviewer` 只关注安全漏洞 - ❌ 坏:`general-reviewer` 什么都审查(会导致重复劳动) **2. 技能互补性** - ✅ 好:`frontend-dev` + `backend-dev` + `test-engineer` - ❌ 坏:3 个都是 `fullstack-dev`(缺乏专业化) **3. 文件所有权明确** - ✅ 好:每个成员负责不同的目录/模块 - ❌ 坏:多人修改同一文件(导致覆盖冲突) ### 任务粒度设计 **理想任务粒度:** - 单个任务耗时:15-30 分钟 - 每人任务数量:5-6 个 - 任务产出:明确的交付物(一个函数、一个测试文件、一份报告) **太小的任务:** ``` ❌ "检查第 42 行是否有 bug" ❌ "读取 config.json 文件" ``` **太大的任务:** ``` ❌ "重构整个认证系统" ❌ "实现完整的订单模块" ``` **合适的任务:** ``` ✅ "审查 auth 模块的安全漏洞,输出 security-report.md" ✅ "实现用户登录 API 端点,包含参数验证
Pipeline de seguridad adversarial — Red Team, Blue Team, Auditor con scoring
Create agent teams for parallel collaboration. Use when user mentions team, parallel, multi-agent, coordinate, collaborate, review team, multiple perspectives, or says "agent-teams".
- 📁 references/
- 📁 scripts/
- 📄 SKILL.md
Manages TrueFoundry roles, teams, and collaborators. Create custom roles, organize users into teams, and grant access to resources. Use when managing permissions, creating teams, or adding collaborators.
Persistent agent team dispatcher with lead coordination. This skill should be used after cw-plan to execute tasks via a managed team (requires CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 and CLAUDE_CODE_TASK_LIST_ID).
Join the Cortex agent team — reads agent config from team directory, generates .cortex.md protocol, updates CLAUDE.local.md. Idempotent — safe to re-run as a sync.
List all AI API keys for the current team. Shows key aliases, masked key values, and spend per key. Use when a team member asks about their API key or wants to see who has access.
- 📄 agentar_cli.mjs
- 📄 SKILL.md
Search, install, and export agentars and teams from the CatchClaw marketplace. Use when the user wants to find, install, or package agent templates or teams.