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
Context section — the attention budget is the design center:
- policy.mode: advisory (default) | bounded (extra loads must be justified + ledgered)
| sealed (forbidden globs hook-blocked; for controlled experiments)
- required: SELECTORS, not whole files, wherever a section suffices:
{path, heading: "## X"} · {path, lines: "A-B"} · {path, grep: "pat", context: N}
· {git_diff: "revA..revB"} — each with a reason
- forbidden: globs the resume must NOT touch (sealed mode enforces via guard-context hook)
- budget: target_tokens (aim: boot + manifest + 2-12k selected history, per EXP-L21),
max_tokens (hard stop)
Execution section: entry_phase, entrypoint (the literal first operation), stop_conditions,
checkpoints (when to emit kernel.checkpoint/v1 during the resumed work).
Resume section: one-line continuation prompt:
/kernel:ingest resume from _meta/handoffs/{file}.json
JSON strings are always quoted, so sha/commit fields cannot type-drift (the old YAML
fails validation).
1---2name: handoff3description: Save provenance, decisions, phases, context policy, and next steps as kernel.handoff/v1. Triggers: handoff, save, pause, context, continue later.4---56<skill id="handoff">78<purpose>9Compile the current task into an authoritative, resumable JSON manifest.10The JSON file is CANONICAL. A markdown rendering may be generated for humans but is11never a second source of truth.1213Why manifest-first + bounded (EXP-L21): what a decision needs is flat (~50-70k tokens)14regardless of session length; the accumulating transcript is almost pure decoration by15late session. A handoff that says "read the conversation" recreates the waste. A handoff16that pins exact selectors + phases lets the next session reconstruct ONLY the load-bearing17state.1819Reference: skills/context-mgmt/SKILL.md20</purpose>2122<on_start>23```bash24agentdb read-start25```26</on_start>2728<phase id="1_extract" name="EXTRACT STATE">29Capture (these become manifest sections, not prose):30- objective: goal, success_conditions (observable), non_goals31- contract: governing _meta/contracts/ file if one exists, invariants, assumptions,32 decisions_accepted (+rationale), alternatives_rejected (+reason) — rejected paths are33 as valuable as accepted ones; they stop re-exploration34- workflow.phases: name each phase of the work; status inherited (done, with evidence)35 | required (still to do). Add invalidation_rules: what live-state change would flip an36 inherited phase back to required. Rules use typed `when.event` plus optional37 `when.path_glob`; never prose trigger strings.38- open_threads, warnings (failed approaches — never re-explore silently)39- tier (1/2/3) in identity40</phase>4142<phase id="2_gather" name="GATHER EVIDENCE">43```bash44git branch --show-current && git rev-parse HEAD && git status --short45git log --oneline -1046agentdb query "SELECT * FROM context WHERE type IN ('contract','checkpoint') ORDER BY ts DESC LIMIT 5"47```48Pin artifacts: for each file the next session must trust unchanged,49`shasum -a 256 <path>` → provenance.artifacts[{path, sha256, purpose}].50</phase>5152<ask_user>53 Use AskUserQuestion when: state extraction complete, before writing the manifest54 Ask: "Anything to add to the handoff? Blockers, decisions, or context I might have missed?"55 Options: looks complete, add context, skip handoff56</ask_user>5758<phase id="3_hygiene" name="GIT HYGIENE">59uncommitted: commit with "wip: checkpoint before handoff" or stash (document it)60push: push current branch to remote — a local-only handoff is stranded work61</phase>6263<phase id="4_compile" name="COMPILE THE MANIFEST">64Write `_meta/handoffs/{name}-{date}.json` conforming to schemas/kernel.handoff.v1.schema.json.6566Context section — the attention budget is the design center:67- policy.mode: advisory (default) | bounded (extra loads must be justified + ledgered)68 | sealed (forbidden globs hook-blocked; for controlled experiments)69- required: SELECTORS, not whole files, wherever a section suffices:70 `{path, heading: "## X"}` · `{path, lines: "A-B"}` · `{path, grep: "pat", context: N}`71 · `{git_diff: "revA..revB"}` — each with a reason72- forbidden: globs the resume must NOT touch (sealed mode enforces via guard-context hook)73- budget: target_tokens (aim: boot + manifest + 2-12k selected history, per EXP-L21),74 max_tokens (hard stop)7576Execution section: entry_phase, entrypoint (the literal first operation), stop_conditions,77checkpoints (when to emit kernel.checkpoint/v1 during the resumed work).7879Resume section: one-line continuation prompt:80 `/kernel:ingest resume from _meta/handoffs/{file}.json`8182JSON strings are always quoted, so sha/commit fields cannot type-drift (the old YAML83fails validation).84</phase>8586<phase id="5_validate" name="VALIDATE — MANDATORY">87```bash88"${CLAUDE_PLUGIN_ROOT:-.}/orchestration/manifest/kernel-manifest" validate _meta/handoffs/{file}.json89```90A handoff that does not validate DOES NOT EXIST. Fix and re-validate before reporting done.91Optional human rendering: a .md next to it, first line92`# RENDERED FROM {file}.json — NOT AUTHORITATIVE`.93</phase>9495<delivery>961. `kernel-manifest validate` passes (above)972. Commit: "docs: handoff manifest for {name}"983. Push to remote99</delivery>100101<on_complete>102```bash103agentdb write-end '{"skill":"handoff","saved_to":"_meta/handoffs/{file}.json","branch":"X","tier":N}'104# If non-local profile: post handoff summary to GitHub Discussions (Agent Logs category)105# Suggest /kernel:retrospective if learnings accumulated across sessions106```107</on_complete>108109</skill>