handoffkit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesehandoffkit
handoffkit
Turn everything learned in this conversation into a single handoff document a fresh agent, with none of this context, can read and continue from. The point is transfer, not archival: capture the state and reasoning that only lives in this session, and point at the artifacts that already exist (specs, PRs, commits, diffs, issues) rather than copying them. By default, save it as a Markdown file under ; print it as a copy-pastable block only when the user explicitly asks for inline or terminal output, or when no writable filesystem is available.
docs/handoffs/将本次对话中获取的所有信息转换为一份交接文档,让完全不了解当前上下文的新Agent可以直接阅读并继续工作。核心目的是工作移交而非存档:捕捉仅存在于本次会话中的状态和推理过程,并引用已存在的工件(规格说明、PR、提交记录、差异文件、问题工单),而非复制其内容。默认情况下,将文档保存为目录下的Markdown文件;仅当用户明确要求内联或终端输出,或无可写文件系统时,才输出可复制粘贴的代码块。
docs/handoffs/When this fires
触发场景
The user wants continuity across a context boundary: "write a handoff", "hand this off", "summarize for the next session", "pass this to another agent", "compact this before we run out of context". If they give an argument (e.g. "handoff for finishing the migration"), treat it as the focus of the next session and slant the whole document toward it. Lead with what that goal needs and prune what it doesn't.
当用户需要跨上下文边界保持工作连续性时:比如“撰写交接文档”、“移交这项工作”、“为下一次会话总结内容”、“将工作交给另一个Agent”、“在上下文耗尽前压缩会话内容”。如果用户提供了参数(例如“为完成迁移撰写交接文档”),则将其视为下一次会话的聚焦点,并围绕该点调整整个文档内容。优先呈现该目标所需的信息,剔除无关内容。
What goes in, and what stays out
内容取舍
A handoff earns its keep by carrying what a new agent can't reconstruct:
- Include: the goal and why it matters; what's done vs. still open; the immediate next action; decisions made and the reasoning behind them; dead ends already ruled out; gotchas, constraints, and how to run/verify.
- Exclude (reference instead): anything already written down, meaning specs, ADRs, plans, issues, commit messages, diffs, PR descriptions. Link them by path or URL; don't paste their contents. A handoff that restates the diff is noise.
- Redact: API keys, tokens, passwords, and personally identifiable information. Never carry secrets into the document. Refer to them by name ("the staging DB password in "), not value.
.env
交接文档的价值在于承载新Agent无法自行重建的信息:
- 需包含:目标及其重要性;已完成与未完成的工作;当前的首要下一步操作;已做出的决策及其背后的理由;已排除的无效路径;潜在陷阱、约束条件以及运行/验证方法。
- 需排除(改为引用):任何已书面记录的内容,即规格说明、ADR、计划、问题工单、提交信息、差异文件、PR描述。通过路径或URL链接它们,不要粘贴内容。重复差异内容的交接文档属于冗余信息。
- 需脱敏:API密钥、令牌、密码和个人身份信息。绝不能将机密信息写入文档。仅提及名称(例如“.env中的预发布数据库密码”),而非具体值。
Document shape
文档结构
Write these sections; drop any that are genuinely empty rather than padding them.
Two registers, split by section. Current state, Next steps and How to run / verify are read by someone who is doing the work, so write them in ASD-STE100 Simplified Technical English: one instruction per sentence, procedural sentences 20 words or fewer, active voice, present tense, name the actor, no metaphor or idiom, and one term per thing for the whole document. If the top calls it the worker, the bottom does not call it the job runner. Goal and Decisions & constraints are read by someone forming a judgment before they touch anything, so they keep ordinary prose with the reasoning intact; flattening a rejected approach into clipped steps strips the why that stops the next agent repeating it.
markdown
undefined撰写以下部分;若某部分确实为空则省略,不要填充无关内容。
两种表述风格,按区分割。 当前状态、下一步操作和运行/验证方法供实际执行工作的人员阅读,因此需使用ASD-STE100简化技术英语:每句一个指令, procedural句子不超过20个单词,主动语态,现在时态,明确执行者,无比喻或习语,整个文档中同一事物使用统一术语。如果文档开头称其为worker,结尾就不能称其为job runner。目标和决策与约束条件供接手前需要判断情况的人员阅读,因此保留带有推理过程的常规散文风格;若将被否决的方案简化为简短步骤,会丢失避免下一个Agent重复犯错的原因。
markdown
undefinedHandoff: <one-line title of the work>
Handoff: <工作的单行标题>
Goal
Goal
What we're trying to achieve and why. If the user gave a focus argument, frame this around it.
我们要实现的目标及其原因。如果用户提供了聚焦参数,请围绕该参数阐述。
Current state
Current state
What's done and working, what's half-done, what's untouched. Be concrete.
已完成且正常工作的内容、未完成的内容、尚未触及的内容。表述需具体。
Next steps
Next steps
The ordered actions the next agent should take. Start with the very first one.
下一个Agent应执行的有序操作。从第一个操作开始。
Key files & artifacts
Key files & artifacts
Paths and URLs that matter (source files, the spec, the open PR, the failing test). Reference, don't reproduce.
重要的路径和URL(源文件、规格说明、待合并PR、失败的测试)。仅引用,不复制内容。
Decisions & constraints
Decisions & constraints
Choices made and why; approaches already ruled out; hard limits and things not to break.
已做出的选择及其原因;已排除的方案;硬性限制和不可破坏的内容。
Open questions / blockers
Open questions / blockers
Unknowns, pending answers, or anything waiting on the user.
未知事项、待答复的问题或任何等待用户处理的内容。
How to run / verify
How to run / verify
Commands to build, run, or test, enough to reproduce the current state.
用于构建、运行或测试的命令,足以复现当前状态。
Suggested skills
Suggested skills
Capabilities the next session should reach for, e.g. a commit skill to land the work, a PR skill to open the pull request, a test-plan skill to verify. Name them by function, not by a specific tool that may not be installed. Recommend by relevance to the goal.
undefined下一次会话应使用的能力,例如用于完成工作的commit skill、用于创建拉取请求的PR skill、用于验证的test-plan skill。按功能命名,而非可能未安装的特定工具。根据与目标的相关性推荐。
undefinedProcedure
流程步骤
- Reread the session. Scan the conversation for the goal, the current state, decisions, and loose ends. That is the raw material.
- Separate carry-over from reference. For each thing worth mentioning, decide: does it live only in this chat (carry it) or is it already an artifact (link it)?
- Draft the document in the shape above, slanted toward the focus argument if one was given. Keep it tight; a new agent should be able to read it in a minute and act.
- Redact any secrets or PII before output.
- Save or print it according to the output rules below, then close per Hand off.
- 重读会话内容。扫描对话,提取目标、当前状态、决策和未完成事项。这些是原始素材。
- 区分需保留和需引用的内容。对于每一项值得提及的内容,判断:它仅存在于本次聊天中(保留)还是已作为工件存在(链接)?
- 按上述结构起草文档,若有聚焦参数则围绕该参数调整内容。保持简洁;新Agent应能在一分钟内读完并采取行动。
- 脱敏处理:在输出前移除任何机密信息或个人身份信息。
- 保存或输出文档:根据以下输出规则执行,然后按照移交部分结束会话。
Output
输出方式
Default: save a Markdown file. Write the finished handoff into in the workspace, creating that directory if it doesn't exist. Name it , using a short lowercase kebab-case subject slug and the handoff's ISO creation date at the end (for example, ). Keep that date stable if the same handoff is edited, and update the existing file in place. If a genuinely distinct handoff would collide on the same day, make the slug more specific; only as a last resort insert the next available sequence immediately before the date (). Tell the user the exact path.
docs/handoffs/handoff-<slug>-YYYY-MM-DD.mdhandoff-auth-migration-2026-07-13.mdhandoff-auth-migration-02-2026-07-13.mdOn explicit request: print inline. When the user explicitly asks for terminal, inline, chat-only, or copy-pastable output, emit the finished handoff as a single Markdown codeblock and do not write a file.
No writable filesystem: degrade gracefully. If the environment cannot write files, emit the finished handoff as a single Markdown codeblock and say that no file was created.
默认:保存为Markdown文件。将完成的交接文档写入工作区的目录,若该目录不存在则创建。文件命名为,其中slug为简短的小写短横线分隔主题,末尾添加交接文档的ISO创建日期(例如)。若同一交接文档被编辑,日期保持不变,直接更新现有文件。若同一天内有完全不同的交接文档可能重名,则细化slug;仅在万不得已时,在日期前添加可用的序号(例如)。告知用户确切的文件路径。
docs/handoffs/handoff-<slug>-YYYY-MM-DD.mdhandoff-auth-migration-2026-07-13.mdhandoff-auth-migration-02-2026-07-13.md明确请求时:内联输出。当用户明确要求终端、内联、仅聊天或可复制粘贴的输出时,将完成的交接文档作为单个Markdown代码块输出,不写入文件。
无可写文件系统时:优雅降级。若环境无法写入文件,将完成的交接文档作为单个Markdown代码块输出,并告知用户未创建文件。
Hand off
移交
Write this section in the procedural register: one instruction per sentence, active voice, present tense, no metaphor.
What changed. Nothing in the project itself; the handoff is a new (or updated) document, and say which.
Where it landed. Give the exact path (), or "printed inline, no file written" when that's what happened.
docs/handoffs/handoff-<slug>-YYYY-MM-DD.mdNext. One move. Start a fresh session pointed at this document, beginning with the handoff's own first next-step. Name that step here so the user doesn't have to open the file to learn it. Nothing else follows in this session; the whole point of the handoff is that this context can now end.
本部分使用流程化表述风格:每句一个指令,主动语态,现在时态,无比喻。
变更内容。项目本身无变更;仅新增(或更新)了一份交接文档,说明具体是哪一份。
存放位置。提供确切路径(),若为内联输出则说明“已内联输出,未写入文件”。
docs/handoffs/handoff-<slug>-YYYY-MM-DD.md下一步操作。一个具体动作。启动指向该文档的新会话,从交接文档中的第一个下一步操作开始。在此处明确该步骤,以便用户无需打开文件即可了解。本次会话到此结束;交接的核心意义在于当前上下文可终止。