coordinator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCoordinator
Coordinator
Overview
概述
Manages two concerns: output mode switching (voice vs text) and agent team orchestration for parallel task execution.
负责管理两大事项:输出模式切换(语音/文本)和用于并行任务执行的Agent团队编排。
Voice/Text Mode Toggle
语音/文本模式切换
Trigger words: "vm", "voice mode" -> switch to VOICE. "tm", "text mode" -> switch to TEXT.
触发词:“vm”、“voice mode” -> 切换至VOICE模式;“tm”、“text mode” -> 切换至TEXT模式。
VOICE Mode Rules
VOICE模式规则
- Short sentences, max 2 lines each
- Bullet points for all lists
- No code blocks longer than 3 lines — summarize verbally instead
- Confirm before executing any tool: "I'll [action]. Go ahead?"
- Use plain language, avoid jargon
- When showing code changes, describe what changed rather than showing diffs
- 短句表达,每条最多2行
- 所有列表均使用项目符号
- 代码块长度不超过3行——改用口头总结
- 执行任何工具前需确认:“我将[执行操作]。可以继续吗?”
- 使用平实语言,避免行话
- 展示代码变更时,描述变更内容而非直接显示差异
TEXT Mode Rules (Default)
TEXT模式规则(默认)
- Full detailed responses with code blocks
- Show diffs, full implementations, detailed explanations
- Execute tools without pre-confirmation (unless destructive)
- 提供完整详细的回复,包含代码块
- 显示差异、完整实现方案和详细说明
- 无需预先确认即可执行工具(除非操作具有破坏性)
Agent Team Orchestration
Agent团队编排
When to Use Teams
何时使用团队
- Task has 3+ independent subtasks
- Different subtasks need different expertise (e.g., implementation + testing + review)
- Work can be parallelized without merge conflicts
- 任务包含3个及以上独立子任务
- 不同子任务需要不同专业能力(例如:实现+测试+评审)
- 工作可并行开展且不会产生合并冲突
Orchestration Details
编排细节
Read references/team-orchestration.md for the full coordination pattern (DECOMPOSE -> WAVE PLAN -> DISPATCH -> GATE -> VERIFY), agent spawn rules, model selection table, context budget management, and conflict resolution.
阅读references/team-orchestration.md获取完整的协作模式(分解 -> 阶段规划 -> 分派 -> 管控 -> 验证)、Agent生成规则、模型选择表、上下文预算管理以及冲突解决方法。
Plan-Driven Orchestration
基于计划的编排
When orchestrating execution of a structured plan ():
.claude/plans/<plan-id>/当编排结构化计划()的执行时:
.claude/plans/<plan-id>/At Session Start
会话开始时
Read and . The manifest defines waves and task dependencies. Use the manifest's wave grouping directly — do not re-derive wave structure.
plan.mdmanifest.json读取和。清单文件定义了阶段划分和任务依赖关系。直接使用清单中的阶段分组——不要重新推导阶段结构。
plan.mdmanifest.jsonAt Each Wave Boundary
每个阶段边界处
Re-read from disk. This protects against context compaction loss. Update task statuses in the manifest after each wave completes.
manifest.json重新从磁盘读取。这可防止上下文压缩导致的状态丢失。每个阶段完成后,更新清单中的任务状态。
manifest.jsonAgent Dispatch
Agent分派
Point each agent at its briefing file. Do NOT paste briefing content inline. Include in dispatch prompt: plan-id, task-id, briefing path, working directory.
为每个Agent指定对应的简报文件。不要将简报内容直接粘贴到提示词中。分派提示词需包含:plan-id、task-id、简报路径、工作目录。
After Final Wave
最终阶段完成后
- Optionally write with execution notes
.claude/plans/<plan-id>/summary.md - Delete the plan directory:
rm -rf .claude/plans/<plan-id>/ - If deletion fails, warn but do not block
- 可选:编写记录执行说明
.claude/plans/<plan-id>/summary.md - 删除计划目录:
rm -rf .claude/plans/<plan-id>/ - 若删除失败,发出警告但无需阻塞后续操作
Common Mistakes
常见错误
- Spawning agents without full context in the prompt
- Letting multiple agents modify the same file
- Skipping verification after merging agent outputs
- Using teams for tasks that are naturally sequential
- Putting dependent tasks in the same wave (task B needs task A's output -> different waves)
- Pasting full briefing text inline instead of pointing agents to their briefing file
- Not re-reading manifest at wave boundaries (context compaction can lose state)
- 在提示词中未包含完整上下文就生成Agent
- 让多个Agent修改同一文件
- 合并Agent输出后跳过验证步骤
- 为天然需串行执行的任务使用团队模式
- 将存在依赖的任务放在同一阶段(任务B依赖任务A的输出 -> 应分属不同阶段)
- 将完整简报文本直接粘贴到提示词中,而非引导Agent查看简报文件
- 未在阶段边界处重新读取清单文件(上下文压缩可能导致状态丢失)