handoff
Generate a project-level context snapshot for resuming work in a fresh session
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- handoff
- type
- shipping
- version
- v0.2
- description
- Generate a project-level context snapshot for resuming work in a fresh session
- argument-hint
- [focus area] [--target=codex]
- required_conventions
- [ "alignment-page" ]
02 资源文件 2
- 参考文档ALIGNMENT-PAGE.md51.5 KB
- 参考文档CHANGELOG.md544 B
03 SKILL.md 正文
Handoff
Generate a self-contained context document that captures exactly where you left off in a project, so a fresh Claude session can pick up immediately without re-reading the entire codebase.
Process
-
Gather current state:
- Read
tasks/todo.mdfor the current phase detail and active step. - Read
tasks/roadmap.mdfor overall progress context (which phases are done, what's ahead). - Read
tasks/manual-todo.md(if it exists) for pending manual tasks. - Read
tasks/record-todo.mdandtasks/recurring-todo.md(if they exist) for advisory task counts. - Read
CLAUDE.mdfor project conventions. - Run
git statusandgit log --oneline -10for recent activity. - Run
git diff --statif there are uncommitted changes. - Check for any blockers or notes in
tasks/todo.md.
- Read
-
Identify the work in progress:
- What phase/step was being worked on.
- What files were being modified (from git status/diff).
- What technical decisions were made during this session.
- What approach was being taken and why.
-
Check for loose ends:
- Uncommitted changes that need attention.
- Failing tests.
- TODOs or FIXMEs added during the session.
- Blockers or open questions.
-
If
$ARGUMENTSspecifies a focus area, emphasize that in the handoff context. -
If
$ARGUMENTScontains--target=codex, produce a cross-CLI approval packet before writing the handoff doc. Requiresjqon PATH:scripts/approved-plan.sh draft(step 5.4) and the pretty-print in step 5.5 both invokejq; if absent,scripts/approved-plan.sh'srequire_jq_write(atscripts/approved-plan.sh:21) dies withERROR: jq required for write operations. Install with: brew install jq (macOS) or apt install jq (Debian/Ubuntu).before any packet is drafted. No degraded path — installjqand retry.- Resolve the effective agent mode via
./scripts/agent-mode.sh. If the resolved mode iscodex-only, stop immediately with amode-mismatch:error — Claude is not the planner in that mode. - Require a clean tracked tree. If
git status --porcelainreports dirty paths, the user must pass repeatable--allow-dirty <glob>flags covering every dirty path. Glob semantics match the Step 4 consumer (scripts/approved-plan.sh check) —case "$path" in $glob)shell globbing, not regex. - Derive
phase/step/titlefromtasks/todo.md. Read the first unchecked- [ ]under the### Active Step Planblock; if no such block exists, fall back to the first unchecked- [ ]under the current## Phase Nheader. Parse thePhase NandStep N.Xtokens out of the surrounding context; use the checkbox line's text (stripped of- [ ] **Step N.X** —) astitle. - Call
./scripts/approved-plan.sh draft --phase "Phase N" --step "Step N.X" --title "<title>"plus any--allow-dirty <glob>flags the user supplied. Surface the helper's single-line failure reason verbatim if it fails. - Pretty-print the drafted packet with
jq . .agents/approved-plan.json, then ask exactly one concise question: "Approve this packet for Codex execution?". On yes →./scripts/approved-plan.sh approve. On no → leave the packet atdraftand tell the user they can approve it later with./scripts/approved-plan.sh approveor discard it with./scripts/approved-plan.sh supersede. - When writing
tasks/handoff.mdin the next step, add a Cross-CLI handoff section naming.agents/approved-plan.json(JSON, gitignored),tasks/approved-plan.md(committable mirror), and the resume command:$exec --execute-approved(Codex).
- Resolve the effective agent mode via
-
Write the handoff to
tasks/handoff.md:
Handoff Document Format
# Handoff — [Project Name] — [Date]
## Current State
- **Phase**: X — [phase name]
- **Step**: Y — [step name]
- **Status**: in-progress / blocked / ready-for-next
- **Branch**: [branch name]
- **Last commit**: [hash] [message]
## What Was Done This Session
- [Concise bullet list of completed work]
## Work In Progress
- [What's partially done, with file paths]
- [Technical decisions made and why]
- [Approach being taken]
## Uncommitted Changes
- [List of modified files and what changed, or "none"]
## Blockers / Open Questions
- [Any blockers, or "none"]
## Pending Manual Tasks
- [Unchecked items from `tasks/manual-todo.md`, or "none"]
- [Note any that block upcoming automated steps]
## Pending Advisory Tasks
- [Record/recurring task counts from `tasks/record-todo.md` and `tasks/recurring-todo.md`, or "none"]
- [Note that these are not execution blockers unless promoted to `tasks/todo.md`]
## Next Steps
- [Exactly what to do next, specific enough to execute without re-reading context]
- [Files to read first]
- [Commands to run]
## Key Files for Context
- [List of 3-5 files most relevant to the current work]
Output
After writing the handoff, report:
- Path to the handoff document
- One-line summary of the project state
- Whether there are uncommitted changes that should be committed first
Constraints
- The handoff must be self-contained — a fresh session should be able to read only this file,
tasks/todo.md, and optionallytasks/roadmap.mdto start working. - Do not include full file contents — only paths and brief descriptions.
- Keep it concise — the handoff should be under 100 lines.
- Do not commit the handoff document automatically — let the user decide.
- If there are uncommitted changes, warn the user to commit or stash before switching contexts.
Alignment Page
Follow the shared alignment-page convention via the packaged convention resolver; output path is alignment/handoff-{topic}.html. By default, report results inline and write only this skill's normal durable artifacts; create an alignment page only when explicitly requested or when a concrete clarification/review need cannot be handled cleanly inline.
Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
04 同仓库更多 Skills
source-checkout-allowed
Valid source-checkout-only fixture.
deck-install-valid
Valid deck install fixture.
codex-pack-guard-valid
Valid Codex Pack Availability Guard fixture.
codex-missing-skill-valid
Valid Codex missing skill fallback fixture.
codex-base-skill-fallback-valid
Valid Codex base skill fallback fixture.
claude-pack-guard-valid
Valid Claude Pack Availability Guard fixture.