文件
skills/cc-switch-dev-workflow/references/knowledge-base/orchestration/agent-handoff-contract.md
2026-03-26 00:27:17 -07:00

53 行
1.7 KiB
Markdown

# Orchestration: Agent Handoff Contract
## Purpose
统一 agent 之间交接任务时的最小契约,防止交接变成全文转发。
## When to Use
- 一个 agent 的输出要交给另一个 agent 时
- 线程 reset 前
- 从 fallback 模型回到主线程时
## Inputs
- 上一角色的高密度产物
- 当前任务边界
- 当前任务验证方式
## Outputs
- 标准化 handoff 文档
- 可直接执行的单任务上下文
## Primary Agent/Model
发起 handoff 的当前 agent
## Secondary Agent/Model
接收 handoff 的下一角色 agent
## Required Skills
- [`../templates/agent-handoff-template.md`](../templates/agent-handoff-template.md)
## Steps
1. 用模板填好 `Goal / Scope / Non-Goals / Source of Truth / Constraints / Deliverable / Validation / Escalation`
2. 只引用必要文件和必要章节。
3. 删除旧讨论、废弃方案和非本任务噪音。
4. 接收方在执行前复述边界,如边界不清立即打回。
## Exit Criteria
- 接收方无需阅读原线程即可开始执行
- 交接文档足够短,但不缺关键边界
## Failure Recovery
- 如果接收方提出“我还需要看完整聊天记录”,说明 handoff 失败,应重写
- 如果 handoff 把实现细节和设计决策混在一起,先拆成计划与实施两个 handoff
## Related Templates
- [`../templates/agent-handoff-template.md`](../templates/agent-handoff-template.md)
## Contract Rules
- `Goal` 只能有一个主目标
- `Scope` 必须点名路径、模块或文档
- `Non-Goals` 必须明确写出这轮不要碰什么
- `Source of Truth` 只能列真正约束当前任务的文件
- `Validation` 必须可执行,不能写成“看起来没问题”
- `Escalation` 必须说明什么情况停下来找人