Agent Skills › open-gsd/gsd-pi › handoff

handoff

GitHub

用于在长会话或上下文耗尽前保存工作检查点,确保下一代理能无缝接续。通过数据库存储状态而非临时文件,提升跨会话协作效率。

src/resources/skills/handoff/SKILL.md open-gsd/gsd-pi

Trigger Scenarios

用户要求暂停、交接或稍后返回 上下文使用接近预算限制 执行高风险操作前需安全存档 长周期任务结束需保留现场

Install

npx skills add open-gsd/gsd-pi --skill handoff -g -y
More Options

Non-standard path

npx skills add https://github.com/open-gsd/gsd-pi/tree/main/src/resources/skills/handoff -g -y

Use without installing

npx skills use open-gsd/gsd-pi@handoff

指定 Agent (Claude Code)

npx skills add open-gsd/gsd-pi --skill handoff -a claude-code -g -y

安装 repo 全部 skill

npx skills add open-gsd/gsd-pi --all -g -y

预览 repo 内 skill

npx skills add open-gsd/gsd-pi --list

SKILL.md

Frontmatter
{
    "name": "handoff",
    "description": "Prepare a clean cross-session handoff so the next agent can pick up where you left off. Saves a focused Work Checkpoint with `gsd_checkpoint_save` and ensures summary artifacts are current. Use when asked to \"hand off\", \"prepare handoff\", \"pause work\", \"bookmark this\", \"I'll come back to this later\", before running out of context budget, or ending a long session with unfinished work."
}
Leave the project in a state where a fresh agent with no memory of this session can be productive within one minute. The deliverable is a Work Checkpoint saved with `gsd_checkpoint_save` plus up-to-date summary artifacts — not a chat recap. GSD already renders `STATE.md` (from the database, after every lifecycle tool call) and summary files (`M###-SUMMARY.md`, `S##-SUMMARY.md`, `T##-SUMMARY.md`). The gap is the *mid-task* handoff: you're partway through a task, context is getting long, and the next session shouldn't start by re-deriving your mental state.

The Work Checkpoint exists for exactly this. It is a database row. The next session of the task gets it as the "Resume State" section of its prompt, and /gsd offers "Resume" instead of "Execute" for a task that has one. CONTINUE.md in the slice directory is rendered from the row for people to read; it is never read back. Do not write continue.md, CONTINUE.md or HANDOFF.md yourself.

Invocation points:

  • User says "pause", "hand off", "I'll come back later", "this is a good stopping point"
  • Context usage nearing budget — better to hand off cleanly than truncate mid-thought
  • Before a risky operation (dependency upgrade, major refactor) where you want a known-good checkpoint
  • End of a long session, multi-day work

<core_principle> WRITE FOR A STRANGER. The next reader is not you. They do not have this conversation. They have the project snapshot (gsd_project_snapshot), the checkpoint, the last summary, and the code. That has to be enough.

CURRENT STATE ONLY. The checkpoint says "pick up HERE." It is not a log of what you did; that goes in summaries. It is not a plan for future work; that lives in the plan files.

NO SECRETS, NO STALE PATHS. Do not inline env values, tokens, or paths that only exist in your working directory. Cite artifacts by relative path from the project root. </core_principle>

Step 1: Identify what's in flight

Answer briefly:

  1. What task (T##) am I on? What's its current plan file?
  2. What have I completed since the last summary?
  3. What's the next concrete action? (Not a goal — an action: "Run X. If Y, do Z.")
  4. What, if anything, is blocking or uncertain?

Step 2: Update the summaries, not the handoff

Before saving the checkpoint:

  • Any task that's actually done? Use gsd_task_complete (or the equivalent tool) to toggle state. Do NOT edit checkboxes by hand. This triggers STATE.md rebuild and T##-SUMMARY.md generation.
  • Any slice-level decisions worth preserving? Save them with gsd_decision_save.
  • Any patterns or traps future agents should know about? Record each one with capture_thought.

This shrinks what the checkpoint has to carry.

Step 3: Save the checkpoint

Call gsd_checkpoint_save with the fields below. Keep it tight — one screenful max.

  • milestoneId, sliceId, taskId — the unit in flight. Pass taskId when a task is in progress; without it the next session of the task does not get the checkpoint.
  • kind — handoff.
  • confirmedContext — the last action, with evidence, and why the next step follows. Example: "Ran npm test after editing src/auth/session.ts; 2 failures in session.test.ts — both complain about a missing expiresAt field in the mock fixture. The session refactor moved expiresAt from optional to required in Session; fixtures were never updated."
  • nextAction — one concrete action the next agent should take. Example: "Update fixtures/sessions.ts to include expiresAt: Date.now() + 3600_000 on every fixture, then re-run npm test."
  • unresolved — open threads you noticed but deliberately didn't act on, and traps the next agent might stumble into. Example: "Validator in src/auth/validator.ts still accepts unbounded session lengths — file as a separate issue after T03 lands. Do NOT revert the Session interface change — it's required for T04. Do NOT run npm run db:reset in this branch; dev data is still needed for manual UAT."
  • evidence — optional: commands, files and results that support the confirmed context. List modified, uncommitted files here.

Step 4: Sanity check

Call gsd_project_snapshot, then read the checkpoint you saved + the most recent summary as if you were a fresh agent. Ask:

  1. Do I know what to do next?
  2. Do I know why?
  3. Do I know what not to do?

If any answer is no, the handoff is incomplete. Save a new checkpoint; the newest one is the resume state.

Step 5: Stop cleanly

  • Do not leave in-flight async_bash or bg_shell jobs. Cancel or wait for them.
  • Do not leave uncommitted changes without flagging them in the checkpoint — note which files are modified and why.
  • Do not push mid-task commits to remote unless that was the plan — they create noise for reviewers.

<anti_patterns>

  • Chat-log handoffs. "First I did X, then Y, then Z…" The next agent doesn't need the journey.
  • A checkpoint that summarizes the whole slice. That's what S##-SUMMARY.md is for, at slice completion.
  • No nextAction. A handoff without a concrete next action is a journal entry.
  • Implicit assumptions. "Obviously the next thing is…" — write it down.
  • Leaving background processes running. They'll be orphaned when the session ends.
  • Handoff without updating summaries. The checkpoint should be thin because the summaries carry the weight.
  • Writing continue.md or HANDOFF.md by hand. Nothing reads those files; only the checkpoint row selects the resume path.

</anti_patterns>

<success_criteria>

  • gsd_checkpoint_save succeeded for the unit in flight.
  • The nextAction is concrete and executable without this session's context.
  • Completed tasks were marked done via gsd_* tools, not by hand-edited checkboxes.
  • Anything notable that was learned is saved with capture_thought or gsd_decision_save.
  • Background processes are not orphaned.
  • A cold-read of the project snapshot + the checkpoint + latest summary would produce the right next action.

</success_criteria>

Version History

  • 5fd73d3 Current 2026-10-18 17:18

    将交接机制从文件系统(CONTINUE.md)迁移至数据库行(gsd_checkpoint_save),/gsd resume-work直接读取数据库头记录,移除旧的文件读写逻辑。

  • 1131ba3 2026-08-27 09:07

Same Skill Collection

gsd-orchestrator/SKILL.md
src/resources/skills/accessibility/SKILL.md
src/resources/skills/agent-browser/SKILL.md
src/resources/skills/api-design/SKILL.md
src/resources/skills/best-practices/SKILL.md
src/resources/skills/btw/SKILL.md
src/resources/skills/code-optimizer/SKILL.md
src/resources/skills/core-web-vitals/SKILL.md
src/resources/skills/create-gsd-extension/SKILL.md
src/resources/skills/create-mcp-server/SKILL.md
src/resources/skills/create-skill/SKILL.md
src/resources/skills/create-workflow/SKILL.md
src/resources/skills/debug-like-expert/SKILL.md
src/resources/skills/decompose-into-slices/SKILL.md
src/resources/skills/dependency-upgrade/SKILL.md
src/resources/skills/design-an-interface/SKILL.md
src/resources/skills/forensics/SKILL.md
src/resources/skills/frontend-design/SKILL.md
src/resources/skills/github-workflows/SKILL.md
src/resources/skills/grill-me/SKILL.md
src/resources/skills/lint/SKILL.md
src/resources/skills/make-interfaces-feel-better/SKILL.md
src/resources/skills/observability/SKILL.md
src/resources/skills/react-best-practices/SKILL.md
src/resources/skills/review/SKILL.md
src/resources/skills/security-review/SKILL.md
src/resources/skills/spike-wrap-up/SKILL.md
src/resources/skills/tdd/SKILL.md
src/resources/skills/test/SKILL.md
src/resources/skills/userinterface-wiki/SKILL.md
src/resources/skills/verify-before-complete/SKILL.md
src/resources/skills/web-design-guidelines/SKILL.md
src/resources/skills/web-quality-audit/SKILL.md
src/resources/skills/write-docs/SKILL.md
src/resources/skills/write-milestone-brief/SKILL.md
packages/pi-coding-agent/examples/extensions/dynamic-resources/SKILL.md

Metadata

Files
0
Version
5fd73d3
Hash
49555b24
Indexed
2026-08-27 09:07

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-20 06:41
浙ICP备14020137号-1