skills/smart-compaction/SKILL.md
Anchor session context into prove primitives before compaction and rehydrate from them after. Built-in compaction summarizes by recency and drops the claude-prove state an agent needs to reorient; this skill externalizes volatile context into durable anchors (scrum tasks, decisions, run-state, a compact-anchors pointer file) pre-compact, then runs a deterministic reorientation sequence post-compact. Use before a manual /compact, when context is about to auto-compact, or immediately after a compaction. Triggers on "smart compact", "prepare for compaction", "anchor before compact", "context is getting long", "rehydrate", "reorient after compact".
npx skillsauth add mjmorales/claude-prove smart-compactionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Dispatch on the first token of $ARGUMENTS:
| Subcommand | Purpose |
|------------|---------|
| anchor | Externalize volatile context into prove anchors, emit /compact instructions |
| rehydrate | Reorient from anchors after a compaction |
| (none) | Auto-detect: .prove/compact-anchors.md exists → rehydrate; otherwise → anchor |
Remaining tokens are a free-form note (extra context for the anchor sweep).
Boundary with /prove:task handoff: handoff serializes full context for a
fresh session or different agent. Smart compaction serves the same session
surviving an in-place context squeeze — the post-compact agent still has the
summary and CLAUDE.md, so anchors are pointers, never serialized content.
Ending the session? Use /prove:task handoff instead.
The SessionStart hooks (matcher compact) inject a mechanical run/scrum digest
automatically after compaction. Treat that digest as the cue to run
rehydrate, not as a replacement for it — the digest reports state; rehydrate
re-reads the working set and resumes.
anchor — Externalize Before CompactionThe conversation holds knowledge the store does not. Move it into durable
anchors so the compaction summary can lose it safely. Consult
references/anchor-map.md for the full context-kind → anchor mapping.
Compare what this session knows against what the store records. Persist every gap:
claude-prove scrum task create --title "..." [--milestone <m>] [--tag <t>]claude-prove scrum decision record ...claude-prove scrum task status <id> blocked (note the blocker in the description)ready →
claude-prove scrum task status <id> in_progressSkip anything already derivable from git history, the scrum store, or run artifacts — anchors point, they do not duplicate.
claude-prove scrum status --human
claude-prove run-state current
git status --porcelain && git log --oneline -3
Note the active run (branch/slug/current step), in-progress task IDs, and uncommitted paths.
.prove/compact-anchors.mdPointers only — no file content, no store duplication. Target under 40 lines:
# Compact Anchors
<!-- Written by smart-compaction anchor. Read + deleted by rehydrate. -->
## Identity
- Branch: <branch> · Run: .prove/runs/<branch>/<slug>/ (step <n>) — omit if no run
- Active scrum tasks: <id> (<status>), ...
## Now
- Immediate next action: <one concrete sentence — "fix the failing assertion in
store.test.ts:214 caused by the new ULID format", not "continue the store work">
## In-Flight Files
- <path> — <one-line why it is mid-change>
## Gotchas
- <max 3 bullets: non-obvious session knowledge a reorienting agent would trip on>
## Rehydrate
Run `/prove:compact rehydrate` (or follow skills/smart-compaction/SKILL.md).
Report what was anchored (task IDs created/updated, decisions recorded, anchor file path). Then emit a paste-ready instruction line — do not run compaction yourself; the operator triggers it (or auto-compact fires):
/compact Preserve: active task IDs <ids>, run <branch>/<slug> step <n>, paths
under change, and that .prove/compact-anchors.md holds rehydration anchors.
Drop: resolved explorations, raw tool output, superseded approaches.
scrum status / run-state show / git log can answer — point at the source instead so rehydrate re-derives it.anchor overwrites the anchor file — each run is a fresh snapshot.rehydrate — Reorient After CompactionRead .prove/compact-anchors.md. Missing → proceed with Step 2 anyway
(mechanical-only rehydration) and note that no anchor file was found.
claude-prove scrum status --human
claude-prove scrum next-ready
claude-prove scrum alerts
claude-prove run-state current
git status && git log --oneline -5
Active run → also claude-prove run-state show --branch <b> --slug <s> --format md.
Recent decision context → claude-prove scrum decision list --limit 5.
Navigating unfamiliar code next → claude-prove cafi context before any Glob/Grep.
Re-read every path under "In-Flight Files", then any task plan / run artifacts the anchors reference. Priority: run plan > in-flight files > recent decisions.
rm .prove/compact-anchors.md
Confirm reorientation in one short block — what was in flight, the immediate next action, the branch — then resume immediately. Do not ask the user to repeat the task; the anchors and store carry it.
tools
Apply model-driven CONTENT reshaping to stored run artifacts that sit behind the current schema, on explicit operator invocation only. Triggers on "migrate runs", "migrate run artifacts", "run content migration", "reshape run artifacts", "bring runs to current schema". You are the driver: the `run-state migrate-runs` CLI mechanically detects which artifacts are behind and emits a plan naming each one plus its migration-instruction file; you read the instructions and reshape the prose/findings, gated by the operator. The deterministic `schema migrate` handles structural column moves; this skill covers only the content reshaping beyond them. Never run as a background or resident loop — only when the operator asks.
tools
Synthesize the 7-section risk-forward Review Brief from a run's reasoning log. Triggers on "reasoning brief", "review brief", "synthesize the brief", "generate the brief", "brief the run", "brief for review", "story brief". You are the driver: the `acb brief` CLI renders a mechanical preservation-safe backbone and proves preservation; you synthesize the narrative prose (summary + changes), single-pass or multipass over episode chunks, then gate it through Stage-1 (mechanical, blocking) and Stage-2 (prose judge, advisory).
tools
Prune stale cached versions of the prove plugin from Claude Code's plugin cache. Use when superseded versions pile up under plugins/cache and agents read stale skills/references from them, or when reclaiming plugin-cache disk space. Triggers on "clean up cached plugin versions", "prune the plugin cache", "remove old prove versions", "stale plugin cache".
development
Gather charter, team, or decomposition-kickoff answers through a self-contained HTML intake form instead of a conversational interview, then drive the same writer the conversation would. Triggers on "intake form", "fill out a form", "charter form", "team form", "decompose form", "HTML form", "render an intake form", "form instead of questions". You are the driver: render the form with `claude-prove intake render`, hand the operator the file to fill and copy, read the pasted-back payload, validate it with `claude-prove intake validate`, and map the validated answers onto the existing writer (bootstrap for charter, `scrum team` for team, the decompose ladder for decompose). The form and the interview are two front-ends to ONE writer — never a second writer.