| name | wrap |
| description | Close out a task — results generated from checklist and verification data plus a hand-written narrative delta, the amendment log drafted into meme, backlog reconciled, living docs swept for staleness |
| argument-hint | Optional — task path to document (e.g., docs/tasks/043-harness-redesign) |
Wrap
Close the loops a finished (or paused) task leaves open. Under the manifest-driven pipeline almost everything wrap used to author is now derivable data, so wrap generates instead of writing, and spends its only authored prose where derivation can't reach: the narrative delta. The checklist IS the session state — there is no separate state file to save; resume is /restore reading the first non-closed item.
Step 1: Gather
With $ARGUMENTS (a task path): read plan/checklist.json, verification.md, and the amendment entries in tests.manifest.json; skim git log over the task's commit range. Without a task path: git log for the session's work and any .claude/backlog.md stubs touched this session.
Step 2: Results — generated skeleton, authored delta
Write $ARGUMENTS/results.md in two parts:
- Generated (assemble mechanically from the checklist + verification + git — never from memory): phases with SHAs and status, rows proven (by tier), findings ledger (blockers fixed, follow-ups open), background run verdicts, benchmark result vs baseline, deferred ledger carried forward.
- Narrative delta — the only authored section, and the only one a future reader can't derive: what diverged from the ratified intent and why. One entry per divergence, classified Changed / Added / Dropped / Wrong-Assumption, each tracing to its amendment row (ratified drift) or explaining why no amendment was filed (that's a process finding in itself). Close with the spec takeaway: the one-sentence class of requirement this spec systematically missed.
Step 3: Capture — the amendment log is the harvest
The amendment log is a measured record of what the spec missed — the highest-value memory input this task produced. Draft task-level residue into meme (inactive drafts only; promotion is the user's, later, via the SessionStart trickle):
~/.claude/skills/meme/bin/meme draft --from-wrap $ARGUMENTS
Feed it, additionally and explicitly: each amendment row with why it surfaced mid-build rather than in the debate; escalations and what triggered them; routing feedback from review lanes; flaky-test rows. Absolute path always; if the command errors, note it and continue — never block wrap on capture.
Step 4: Backlog reconcile
Read the project's .claude/backlog.md. For each stub parked during this task's sessions: resolved in passing → delete; still live → leave for the session-start relay; grown urgent → surface to the user now with a one-line recommendation. Never let wrap end with a stub that this very task quietly resolved still sitting in the file.
Step 5: Staleness sweep
The code just changed; docs that describe it may now lie.
- Discover:
~/.claude/skills/meme/bin/meme sweep, plus ast-grep over the task's changed symbols intersected with the living-doc corpus (README, guides, CLAUDE.md files, .meme/*.md). The nearest CLAUDE.md of every changed directory is a mandatory candidate regardless of grep hits. Exclude task archives (docs/tasks/*) — frozen provenance, immutable by convention.
- Classify each candidate claim yourself — you are the cheapest evaluator this diff will ever get: still-true / stale / obsolete.
- Act: stale docs get surgical per-claim edits (never regenerate a file); obsolete facts get a retire proposal. If this session established a directory convention no
CLAUDE.md records, propose adding it at the lowest common ancestor directory — constraint-form only, hard cap ~30 lines per file.
- Consent-gate everything: show every proposed edit and retire; apply nothing without approval.
Step 6: Summary
Report: results.md written (generated sections + delta count); drafts fed to meme (or the noted skip); backlog stubs deleted / kept / surfaced; sweep candidates and proposed edits/retires awaiting consent; how to resume if the task is unfinished (/restore $ARGUMENTS).