Generates a polished session handover document for seamless cross-session continuity. Consolidates decisions, issues, and knowledge, archives stale entries, and produces a structured handover.md through user dialogue. Use this skill whenever the user says "handover", "ハンドオーバー", "セッション終了", "session end", "引き継ぎ書いて", "/sdd-handover", or mentions ending or wrapping up a session. Also triggers on combined requests like "リリースしてハンドオーバー". This is the manual-polish mode — richer than auto-draft because it consolidates session data, archives stale entries, and incorporates user dialogue for tone, nuance, and resume instructions.
Generate a polished session handover document at session end. The goal is to produce a handover.md that enables the next session's Lead to resume work without friction — capturing direction, decisions, warnings, tone, and concrete resume steps.
This is the "manual polish" mode. It differs from auto-draft in three ways:
(1) it consolidates and archives stale session data, (2) it enriches the
document through user dialogue, and (3) it omits the **Mode**: auto-draft
marker so the next Lead knows this was a deliberate handover.
Run a single Bash call to get all values needed upfront:
date +%Y-%m-%dT%H:%M:%S%z; date +%Y-%m-%d-%H%M; git branch --show-current
Output is 3 lines:
ISO_TS (for Generated field, archive headers, created_at)ARCHIVE_SLUG (for archive filenames)BRANCH (for handover header)Do not call date or git branch again after this step.
Read these files in parallel (use Glob first to check existence for files that may not exist):
.sdd/session/handover.md.sdd/session/decisions.yaml.sdd/session/issues.yaml.sdd/session/knowledge.yamlAlso Glob .sdd/project/specs/*/spec.yaml and read any that exist to capture pipeline state.
Read .sdd/lib/prompts/log/flush.md and follow its instructions to persist
any unpersisted decisions, issues, and knowledge from the current conversation
context.
This flush ensures nothing is lost before consolidation rewrites the files. After flush completes, proceed to Step 4.
This is the core maintenance step. First, create all archive directories in one call:
mkdir -p .sdd/session/decisions .sdd/session/issues .sdd/session/knowledge .sdd/session/handovers
Then process each file in order. Do not create empty archive files — if nothing qualifies for archival, skip that substep.
status: superseded.sdd/session/decisions/{ARCHIVE_SLUG}.yaml with this format:
# Archived from decisions.yaml at {ISO_TS}
# Entries: {count}
entries:
- ...
.sdd/session/decisions.yaml containing only status: active
entriesstatus: resolved or status: rejectedresolution
field. If the resolution contains a reusable structural insight (a pattern,
a workaround, a root cause that could recur), create a new knowledge.yaml
entry. Use judgment — operational fixes ("typo in line 42") are not worth
promoting; structural insights ("hatch-vcs caches metadata after tag") are.sdd/session/issues/{ARCHIVE_SLUG}.yaml (same header format as decisions).sdd/session/issues.yaml containing only status: open and
status: deferred entriesstatus: superseded. Only
mark entries when the current session provides clear evidence of
invalidity. When in doubt, keep activeframework/claude/sdd/settings/rules/lead/bash-security-heuristics.md
if framework/claude/ exists (sdd framework repo), otherwise
.sdd/settings/rules/lead/bash-security-heuristics.md. Note: the
.sdd/ version may be overwritten by install --force — the
knowledge.yaml entry serves as durable record regardless.sdd/session/knowledge/{ARCHIVE_SLUG}.yaml (same header format as decisions).sdd/session/knowledge.yaml (Step 4b may have appended
promoted entries since Step 2). Rewrite containing only status: active
entriesFor large entry sets (50+ active entries in any file), summarize by severity counts (e.g., "decisions: 12H / 18M / 5L") rather than listing every entry during user dialogue.
If .sdd/session/handover.md exists:
.sdd/session/handovers/{ARCHIVE_SLUG}.md
(directory already created in Step 4)If no handover.md exists, skip this step. The enrichment dialogue still runs — the user may want to set session context even for a first handover.
Present a summary of what was accomplished this session and the consolidation results (how many entries archived, any knowledge promoted, any duplicates detected for steering codification). Then proceed to Step 7.
Before generating handover.md, propose committing the session's work changes. This ensures handover.md's Immediate Next Action and Resume Instructions accurately reflect the post-commit state.
Run git status and git diff --name-only to identify uncommitted changes
Separate changes into logical commit units. Group by:
.sdd/session/ files — these are committed separately in Step 9If uncommitted work changes exist, use AskUserQuestion to present the proposed commit groups:
Session work を以下の粒度でコミットしますか?
- Commit A: {description} ({file list})
- Commit B: {description} ({file list})
- ...
Options:
If user approves, execute each commit using -m flags (not heredoc):
git add {specific files}
git commit -m "{scope}: {summary}" -m "Co-Authored-By: sync-sdd <noreply@sync-sdd>"
If no uncommitted work changes exist (clean tree except session data), skip this step silently
Write .sdd/session/handover.md using this structure (template reference:
.sdd/settings/templates/session/handover.md).
IMPORTANT: Immediate Next Action and Resume Instructions must reflect the current git state at this point. If all work was committed in Step 7, do NOT write "commit pending changes" as a next action. If the user declined to commit in Step 7, mention the uncommitted changes in Resume Instructions.
# Session Handover
**Generated**: {ISO_TS}
**Branch**: {branch}
**Session Goal**: {from user enrichment, or inferred from session work}
## Direction
### Immediate Next Action
{specific command or step the next Lead should execute first}
### Active Goals
{progress toward objectives — what is in flight, what is blocked, what is next}
### Key Decisions
**Continuing from previous sessions:**
{carry forward from previous handover — numbered, with decision IDs like D2, D214}
**Added this session:**
{new decisions — numbered, with decision IDs}
### Warnings
{constraints, risks, caveats — from user enrichment and Lead observations}
## Session Context
### Tone and Nuance
{from user enrichment — ephemeral session-specific preferences}
### Steering Exceptions
{intentional deviations — reference decisions.yaml IDs}
## Accomplished
### Work Summary (this session)
{work completed this session — concrete, specific}
### Previous Sessions (carry forward)
{summary of prior session work — carried forward from previous handover}
### Modified Files
{key files changed this session — helps next Lead understand scope}
## Open Issues
{table of open/deferred issues from issues.yaml: ID | Severity | Summary}
{only include if issues.yaml has open/deferred entries}
## Resume Instructions
{1-3 steps for next session startup — always include /sdd-start as first step}
Reference decision IDs in Key Decisions so the next Lead can look up full details in decisions.yaml. Keep the document concise but complete — the next Lead should be able to resume without reading the full conversation history.
Do NOT include **Mode**: auto-draft — its absence signals manual polish.
After handover.md is written, commit session data as a separate commit:
.sdd/session/ files (handover.md, decisions.yaml, issues.yaml,
knowledge.yaml, state.yaml, and any archive files created during
consolidation)git add .sdd/session/
git commit -m "session: handover + session data" -m "Co-Authored-By: sync-sdd <noreply@sync-sdd>"
This ensures handover.md is always committed (not lost) and session data forms its own atomic commit separate from work changes.
handovers/, decisions/, issues/, knowledge/)