AGENT SKILL

session-handoff

Creates and resumes handoff documents for seamless agentic coding session transitions.

License 许可
MIT
最近更新
2026-11-03
Stars
★ 2
Forks
0

01 前言 Front Matter

name
session-handoff
description
Creates and resumes handoff documents for seamless agentic coding session transitions.
when_to_use
Trigger on "wrap up", "wrap up this session", "save state", "handoff", "resume from handoff", "continue from last session", "clear handoffs", "prune handoffs" — and when context approaches capacity (>80%), at natural pauses, or when switching workstreams. Wrap-up routes here even when a generic memory/remember skill is installed: the handoff document is the continuation artifact, and hook-based auto-memory still runs on its own. Not for resuming work on a design or plan artifact — that is discovery/draft-plan territory. Not for resuming an in-flight plan from the .condux/progress/ ledger — that is subagent-execution. Not for a usage/cost report — that is session-report. Not for remembering facts across Codex sessions — that is concord:remember.

02 资源文件 5

03 SKILL.md 正文

Session Handoff Skill

Preserve and restore session context across agentic coding sessions.

Trigger conditions

Create a handoff when:

  • User says "save state", "handoff", "wrap up", or "context is full"
  • Context window approaching capacity (>80%)
  • Logical milestone complete before switching workstreams
  • Switching between workstreams or projects

Resume from a handoff when:

  • User says "resume", "pick up from", or "continue from last session"
  • Starting a session on a branch that has handoffs in .session-handoff/

Create workflow

  1. Gather state — run these inline:
    git branch --show-current
    git log --oneline -5
    git status --short
    git diff --name-only HEAD
    ls -lt .session-handoff/ 2>/dev/null | head -10
    
  2. Ask the user: "Save handoff as markdown (.md), HTML (.html), or both? Default: markdown."
  3. Scaffold using the chosen template — references/handoff-template.md or references/handoff-template.html. For both, fill the markdown template once, then mirror the same content into the HTML template — identical sections in the same order, no divergence. Both templates lead with "immediate next steps" and "blockers"; keep it that way, because a handoff is read to resume work. Fill every section — no [FILL] placeholders left.
    • The HTML rail and the pane are two copies of the same steps. Each rail entry is a clamped link (href="#step-N") to the full text in the pane's <ol class="steps"> (id="step-N"). Write the same wording in both, and when you add or remove a step keep every href/id pair aligned — a rail link with no matching id scrolls nowhere. Fill the rail's identity block from the frontmatter: task, created, branch, repo, workstream, continues-from.
    • Set the rail's blockers chip to match the section. Nothing stuck → <a class="chip" href="#blockers">none</a>; otherwise keep class="chip blocked".
    • Optional sections. "decisions made", "blockers" and "deferred / out of scope" are legitimately optional — if a session has nothing to report there, replace that section's placeholder content with the one-line .kit-empty block shown in the HTML comment directly above it (a single .kit-empty__body sentence — this surface renders it as a quiet line, not a panel) instead of leaving stray placeholder rows. Delete that HTML comment once you have decided either way — it is scaffolding for you, and a saved handoff should not carry the instructions used to write it.
  4. Validate before saving:
    • No [FILL] markers remain
    • No credentials, tokens, API key values, or env var values
    • Three required sections present and substantive (>50 chars each): "Current State Summary", "Important Context", "Immediate Next Steps"
    • Referenced file paths exist on disk
    • Next steps are specific (file:line, not "fix the auth")
    • HTML only — the rail agrees with the pane, because both are filled by hand: every href="#step-N" has a matching id="step-N" and the two carry the same text; the blockers chip says none exactly when the blockers section is empty; no authoring comment survives (the rail's fill note and the empty-state notes are scaffolding, not content)
  5. Save to .session-handoff/YYYY-MM-DD-HHMMSS-[slug].[md|html]. For both, save the two files under the same YYYY-MM-DD-HHMMSS-[slug] stem, differing only in extension.
  6. Confirm: "Handoff saved: .session-handoff/<filename>" (list both paths when both was chosen)
  7. Retention check — after saving, run the Prune workflow below on the remaining files: flag the new handoff's continues-from predecessor chain as superseded, plus anything very stale, and offer to delete them.

Resume workflow

  1. List and pick the relevant handoff:
    ls -lt .session-handoff/ | head -10
    
  2. Check freshness relative to the handoff timestamp:
    git log --oneline --after="<handoff-date>"
    git diff --name-only <handoff-branch>...HEAD
    
  3. Read the full handoff document
  4. Run the resume checklist at references/resume-checklist.md
  5. Report staleness level and any red flags to the user before touching code
  6. Begin at "Immediate Next Steps §1"
  7. After the resume has landed (next steps under way or superseded by new direction), offer to delete the consumed handoff — and any older handoffs it chains to via continues-from. A resumed handoff is spent: its context now lives in the session and the next handoff.

Prune workflow

Handoffs are disposable by design — once consumed or superseded, delete them. Runs after a resume (step 7), after a create (step 7), or on request ("clear handoffs", "prune handoffs").

  1. Identify candidates in .session-handoff/:
    • Consumed — resumed in this session and the work has moved on
    • Superseded — a newer handoff names it (directly or transitively) in continues-from
    • Very stale — >30 days old or >20 commits behind (see Staleness scoring)
    • Overflow — beyond the 5 most recent stems, oldest first
  2. Present the list with one reason per file and ask for a single yes/no confirmation for the whole batch (the user can exclude items). Never delete without asking; never ask file-by-file.
  3. Delete confirmed files with rm. Twin formats share a stem — always remove .md and .html together. If the file is tracked in git, use git rm so the deletion is staged.
  4. Report what was removed and what was kept.

Never prune: the handoff just created, anything the user excluded, or the only handoff for a branch with uncommitted work it describes.

Staleness scoring

Commits since Age Files changed Level Action
0 <1 day 0–5 Fresh Proceed
1–5 1–7 days 5–20 Slightly stale Note gaps, proceed
6–20 7–30 days 20+ Stale Surface delta, confirm
>20 >30 days — Very stale Reference only; re-explore first

Quality gates (block handoff if any fail)

  • [ ] No [FILL] markers
  • [ ] No secrets or credential values
  • [ ] Required sections present and substantive
  • [ ] Next steps include file paths and/or line numbers
  • [ ] Each decision includes rationale, not just the choice

Storage

.session-handoff/YYYY-MM-DD-HHMMSS-[slug].md and/or .session-handoff/YYYY-MM-DD-HHMMSS-[slug].html. When both formats are saved, they share one timestamp-slug stem and differ only in extension.

Handoffs are gitignored working state, not project docs — they're disposable by design (see Prune workflow). The directory lives at the git root and is created on demand. Before the first write in a repo, run the bootstrap once:

  1. Resolve the root with git rev-parse --show-toplevel. Not a git repo → fall back to CWD and say so once.
  2. git check-ignore -q .session-handoff/ — already ignored, proceed silently.
  3. Otherwise ask once: "Handoffs are scratch — add .session-handoff/ to .gitignore so they stay out of your commits?" On yes, append it. If the user would rather not touch a tracked file, write it to .git/info/exclude instead. Never edit either file without asking.

Check AGENTS.md for a project-specific override; an explicit path wins.

Migrating an existing repo: older handoffs may sit in handoffs/ at the repo root (the pre-2.0 location) and may be committed. On resume, check both paths. Offer to move them once — git mv handoffs/ .session-handoff/ if tracked, plain mv otherwise — but never move them silently.

If continuing prior work, set continues-from in the metadata header and reference the predecessor filename.

04 同仓库更多 Skills

jabworks
jabworks/agentic-toolkit

orphan

暂无简介

★ 2
jabworks
jabworks/agentic-toolkit

no-blurb

暂无简介

★ 2
jabworks
jabworks/agentic-toolkit

workflow

Routes any dev task into the right execution tier (Small/Medium/Large) and carries condux's operating rules — proportional effort, lazy skill loading, soft gates, implement-yourself-by-default.

★ 2
jabworks
jabworks/agentic-toolkit

usage-trace

Checks and manages durable, local usage capture — ingest, health status, and the opt-in limit snapshot — for Claude Code and Codex. Capture itself runs automatically at session start.

★ 2
jabworks
jabworks/agentic-toolkit

toolkit-skill-standards

Use when writing or reviewing a SKILL.md for jabworks/agentic-toolkit — frontmatter budgets, the trigger contract ("Use when…" description or when_to_use field), progressive disclosure into references/, and keeping a new description out of existing skills' trigger space. Triggers include "review this skill description", "write the frontmatter", "does this collide with an existing skill", "where should this content live". Not for scaffold/sync mechanics; use toolkit-foundry.

★ 2
jabworks
jabworks/agentic-toolkit

toolkit-research-frontier

Use when planning improvement work on jabworks/agentic-toolkit itself — open problems (trigger-collision automation, YAML-strict frontmatter checks, docs-catalog enforcement), existing assets, the next three concrete steps, and the four-front library-health campaign with commands and success criteria. Triggers include "let's improve our toolkit", "let's improve this repo", "what should we improve next", "toolkit roadmap", "open problems", "run the health campaign".

★ 2