| name | handoff |
| description | Compile session state into an authoritative kernel.handoff/v1 JSON manifest for bounded resume. Saves provenance, decisions, workflow phases, context policy, next steps. Triggers: handoff, save, pause, context, continue later. |
| user-invocable | true |
| allowed-tools | Read, Bash, Grep, Glob, Write |
| kernel | {"kind":"state_transition","version":2,"side_effects":"writes_meta","confirmation":"none","produces":["kernel.handoff/v1"]} |
Compile the current task into an authoritative, resumable JSON manifest.
The JSON file is CANONICAL. A markdown rendering may be generated for humans but is
never a second source of truth.
Why manifest-first + bounded (EXP-L21): what a decision needs is flat (~50-70k tokens)
regardless of session length; the accumulating transcript is almost pure decoration by
late session. A handoff that says "read the conversation" recreates the waste. A handoff
that pins exact selectors + phases lets the next session reconstruct ONLY the load-bearing
state.
Reference: skills/context-mgmt/SKILL.md
<on_start>
agentdb read-start
</on_start>
Capture (these become manifest sections, not prose):
- objective: goal, success_conditions (observable), non_goals
- contract: governing _meta/contracts/ file if one exists, invariants, assumptions,
decisions_accepted (+rationale), alternatives_rejected (+reason) — rejected paths are
as valuable as accepted ones; they stop re-exploration
- workflow.phases: name each phase of the work; status inherited (done, with evidence)
| required (still to do). Add invalidation_rules: what live-state change would flip an
inherited phase back to required. Rules use typed `when.event` plus optional
`when.path_glob`; never prose trigger strings.
- open_threads, warnings (failed approaches — never re-explore silently)
- tier (1/2/3) in identity
```bash
git branch --show-current && git rev-parse HEAD && git status --short
git log --oneline -10
agentdb query "SELECT * FROM context WHERE type IN ('contract','checkpoint') ORDER BY ts DESC LIMIT 5"
```
Pin artifacts: for each file the next session must trust unchanged,
`shasum -a 256 ` → provenance.artifacts[{path, sha256, purpose}].
uncommitted: commit with "wip: checkpoint before handoff" or stash (document it)
push: push current branch to remote — a local-only handoff is stranded work
Write `_meta/handoffs/{name}-{date}.json` conforming to schemas/kernel.handoff.v1.schema.json.
```bash
"${CLAUDE_PLUGIN_ROOT:-.}/orchestration/manifest/kernel-manifest" validate _meta/handoffs/{file}.json
```
A handoff that does not validate DOES NOT EXIST. Fix and re-validate before reporting done.
Optional human rendering: a .md next to it, first line
`# RENDERED FROM {file}.json — NOT AUTHORITATIVE`.
1. `kernel-manifest validate` passes (above)
2. Commit: "docs: handoff manifest for {name}"
3. Push to remote