handoff

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Handoff

会话交接

Flags

参数

Flag / ArgEffect
--resume <path>
Load an existing handoff doc and restore context. Writes no new doc.
--path <path>
Save the new doc to
<path>
instead of the default handoffs dir.
Positional argWhat the next session should focus on. Tailors a new doc or narrows a resume.
No flags → create a new handoff doc in the default dir.
--resume
and
--path
are mutually exclusive; if both passed, stop: "
--resume
and
--path
are mutually exclusive." If
--resume
or
--path
is passed without a path, stop and ask for it.
参数/位置参数作用
--resume <path>
加载已有的交接文档并恢复上下文,不生成新文档。
--path <path>
将新文档保存到指定
<path>
路径,而非默认的handoffs目录。
位置参数指定下一次会话的重点内容。用于定制新文档或缩小恢复会话的范围。
无参数 → 在默认目录创建新的交接文档。
--resume
--path
参数互斥;若同时传入,将终止操作并提示:"
--resume
--path
参数互斥。" 若传入
--resume
--path
但未指定路径,将终止操作并要求补充路径。

Handoffs directory

交接文档目录

Default save location is inside this skill's directory (the anchor):
  • Root:
    ./handoffs/
  • Naming:
    ./handoffs/handoff-<YYYY-MM-DD-HHmmss>.md
--path <path>
overrides this entirely.
默认保存位置位于当前skill的目录下(锚点目录):
  • 根目录:
    ./handoffs/
  • 命名规则:
    ./handoffs/handoff-<YYYY-MM-DD-HHmmss>.md
--path <path>
参数将完全覆盖上述默认设置。

Workflow A: Create (default, no
--resume
)

工作流A:创建交接文档(默认模式,无
--resume
参数)

  1. Resolve the save path:
    --path
    if given, else
    <anchor>/handoffs/handoff-<timestamp>.md
    . Create
    ./handoffs/
    if absent.
  2. Survey artifacts from the workspace and conversation, plans, PRDs, ADRs, issues, PRs, commits, diffs. You will reference them by path or URL, never paste their contents.
  3. Write the doc using the format in
    ./REFERENCE.md
    . Keep it readable by a fresh agent in under two minutes.
  4. Redact API keys, tokens, passwords, and PII.
  5. If a positional arg was passed, add
    ## Next session focus
    at the top and frame open tasks and suggested skills around it.
  6. Report the save path, a one-line capture summary, and the resume command:
    /handoff --resume <path>
    .
  1. 确定保存路径:若指定了
    --path
    则使用该路径,否则使用
    <锚点目录>/handoffs/handoff-<时间戳>.md
    。若
    ./handoffs/
    目录不存在则创建。
  2. 收集工作区和对话中的相关产物,包括计划、PRD、ADR、问题、PR、提交记录、差异文件等。仅通过路径或URL引用这些产物,不得粘贴其内容。
  3. 按照
    ./REFERENCE.md
    中的格式编写文档,确保新Agent能在两分钟内快速理解内容。
  4. 编辑文档,移除API密钥、令牌、密码及个人身份信息(PII)等敏感内容。
  5. 若传入了位置参数,在文档顶部添加
    ## 下一次会话重点
    部分,并围绕该重点梳理未完成任务及推荐使用的skill。
  6. 向用户报告保存路径、一行内容摘要,以及恢复命令:
    /handoff --resume <path>

Workflow B: Resume (
--resume <path>
)

工作流B:恢复会话(使用
--resume <path>
参数)

  1. Read the file. If absent, stop: "Handoff file not found at
    <path>
    ."
  2. Summarize context, progress, key decisions, prioritized open tasks, and blockers for the user.
  3. If a positional arg was also passed, treat it as the narrowed focus.
  4. From
    ## Suggested skills
    , list each skill with its rationale and offer to invoke the ones relevant to the focus.
  5. Continue from the open tasks, referencing artifacts by path or URL rather than re-deriving captured content.
  1. 读取指定路径的文件。若文件不存在,终止操作并提示:"未在
    <path>
    路径找到交接文档。"
  2. 向用户总结上下文信息、已完成进度、关键决策、优先级最高的未完成任务及障碍。
  3. 若同时传入了位置参数,将其作为会话的聚焦重点。
  4. 从文档的
    ## 推荐Skill
    部分,列出每个skill及其使用理由,并询问是否调用与当前重点相关的skill。
  5. 从未完成任务开始接续会话,通过路径或URL引用相关产物,而非重新整理已记录的内容。

Constraints

约束条件

  • Redact sensitive values before saving.
  • When resuming, never write a new handoff unless the user explicitly asks.
  • 保存前需编辑移除敏感信息。
  • 恢复会话时,除非用户明确要求,否则不得生成新的交接文档。