agent-orchestration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Agent Orchestration Rules

Agent编排规则

When the user asks to implement something, use implementation agents to preserve main context.
当用户要求实现某项功能时,使用实现类Agent来保留主上下文。

The Pattern

模式

Wrong - burns context:
Main: Read files → Understand → Make edits → Report
      (2000+ tokens consumed in main context)
Right - preserves context:
Main: Spawn agent("implement X per plan")
Agent: Reads files → Understands → Edits → Tests
Main: Gets summary (~200 tokens)
错误做法 - 消耗上下文:
Main: 读取文件 → 理解内容 → 进行编辑 → 提交报告
      (主上下文消耗2000+ tokens)
正确做法 - 保留上下文:
Main: 生成Agent("按计划实现X功能")
Agent: 读取文件 → 理解内容 → 进行编辑 → 测试
Main: 获取摘要(约200 tokens)

When to Use Agents

何时使用Agent

Task TypeUse Agent?Reason
Multi-file implementationYesAgent handles complexity internally
Following a plan phaseYesAgent reads plan, implements
New feature with testsYesAgent can run tests
Single-line fixNoFaster to do directly
Quick config changeNoOverhead not worth it
任务类型是否使用Agent?原因
多文件实现Agent可在内部处理复杂度
执行计划阶段任务Agent读取计划并执行实现
带测试的新功能开发Agent可运行测试
单行代码修复直接处理速度更快
快速配置修改代理开销得不偿失

Key Insight

核心要点

Agents read their own context. Don't read files in main chat just to understand what to pass to an agent - give them the task and they figure it out.
Agent会读取自身的上下文。不要为了弄清楚要传递给Agent的内容而在主聊天中读取文件——直接给它们任务,它们会自行处理。

Example Prompt

示例提示词

Implement Phase 4: Outcome Marking Hook from the Artifact Index plan.

**Plan location:** thoughts/shared/plans/2025-12-24-artifact-index.md (search for "Phase 4")

**What to create:**
1. TypeScript hook
2. Shell wrapper
3. Python script
4. Register in settings.json

When done, provide a summary of files created and any issues.
实现Artifact Index计划中的第4阶段:结果标记Hook。

**计划位置:** thoughts/shared/plans/2025-12-24-artifact-index.md(搜索"Phase 4")

**需要创建的内容:**
1. TypeScript hook
2. Shell wrapper
3. Python脚本
4. 在settings.json中注册

完成后,提供已创建文件的摘要及任何问题。

Trigger Words

触发词

When user says these, consider using an agent:
  • "implement", "build", "create feature"
  • "follow the plan", "do phase X"
  • "use implementation agents"
当用户说出以下词汇时,考虑使用Agent:
  • "implement"、"build"、"create feature"
  • "follow the plan"、"do phase X"
  • "use implementation agents"