iteration-close — distill, shed, prove takeover, rehearse bootstrap, seed next
A product that iterates forever accumulates two silent debts, and this skill pays both down at
every iteration boundary — safely (nothing is lost) but ruthlessly (nothing dead is kept):
- Dead files linger and rot into two-truths — a deprecated tree sits around for weeks; a runbook
keeps claiming a component is "not built" long after it shipped.
- Knowledge that lives only in a chat window dies with it — whole working pipelines have died in
scratchpads; hard-won decisions die with the session. Keep the lesson, not the artifact.
It is generic: it works on any repo by reading that repo's own conventions, and where a
convention is absent it creates the minimum rather than assuming or erroring. "A fresh window or
new machine can continue" is a HOPE until it is TESTED; being current (pull) is always safe, but
publishing (push) is a deliberate choice. Respond in the language the user is working in.
Two ways to run
- Full close (default): all five phases, in order. Use when an iteration/slice is done and
the user wants it closed out end to end.
- Shed-only (standalone cleanup): when the user only asks to clear old/dead/superseded files,
run Phase 2 alone — do NOT force the full five-act close on them. Preconditions still apply:
run Step 0 (orient), the fail-closed refusal checks, and a Phase 1 spot-check scoped to the
deletion inventory — any item whose lesson or decision lives only in chat gets distilled into a
tracked file first, or stays out of the inventory. Every Phase 2 rule applies unchanged,
including the explicit-yes gate and the quarantine rule.
Step 0 — orient to THIS repo (discover, else plan to create)
Read whichever entry doc exists — CLAUDE.md / AGENTS.md / README / a docs/ index — and
discover six things. Use what you find; where something is absent, note it as a gap this close
will fill (each phase below says how), never invent a path that isn't there.
- Lesson/decision record — where does this repo bank decisions? (
CHANGELOG, docs/adr/,
DECISIONS.md, or a repo-specific register.) If none, Phase 1 creates a single DECISIONS.md.
- Confirmed-upload command — a deliberate push step (
bin/sync, make deploy, a documented
git push discipline)? If yes, that IS the upload channel; never bypass it. If none, Phase 3a
uses plain git push after a diffstat + confirm.
- Bootstrap command — how does a fresh clone come alive? (
bin/bootstrap, bin/sync-setup,
install.sh, make setup, a package-manager install.) If none, Phase 4 creates one.
- Test command — from CI config,
package.json scripts, a Makefile, or the language default
(pytest / go test / cargo test / npm test). If none is discoverable, the repo has no
runnable suite yet: treat that as an explicit state below — never read it as "green", never
REFUSE on a repo that legitimately has none.
- Grounding / gate skill — a product-grounding or pre-build gate skill? If so, its
"after-build" checklist is your pre-close gate. (Product-specific gates live inside the product
repo; this skill stays generic and defers to them.)
- Declared data / recovery / quarantine directories — directories the entry doc names as
holding real data, recovery material, or quarantined files. These are exempt from every
"archive-shaped dirs must not exist" rule below and must never appear on a deletion inventory.
Refuse to run (fail-closed)
Do not close mid-iteration — you lose skin AND flesh. REFUSE (in both run modes) if: the
directory is not a git repository (stop and say so — running git init is the user's
decision); the test
suite exists and is actually FAILING (an absent suite is not a failing one — see Step 0.4); an
adversarial gate, if the repo has one, is pending or CHANGES-REQUIRED; or another agent/lane has
uncommitted mid-slice work in paths you'd touch. Say what's blocking and stop.
In a full close, run the phases IN ORDER. Each has an exit test; never proceed past a failed exit.
Phase 1 — DISTILL (salvage gate: nothing dies before its lesson is banked)
- Sweep this iteration's chat-born decisions into the repo's decision record (Step 0.1), each
with its status and source. If the repo banks decisions nowhere yet, creating the record is
part of this phase — a single
DECISIONS.md at repo root is enough. A decision that exists
only in a chat window does not exist; do not leave distilled decisions with no tracked home.
- New invariants/rules discovered this iteration → the repo's contracts file, or lacking that the
decision record — ideally each as a test. If neither exists, create the decision record and put
them there. Delete the artifact, keep the invariant.
- Session-only-capability check: did this iteration rely on anything living ONLY in a prompt, a
scratchpad, or someone's memory? Promote it into the repo (code / skill / doc) or record its
deliberate exclusion. Name each one explicitly — this is where pipelines die.
- If the STRUCTURE changed, update — or, if none exists and the structure is now nontrivial,
create — a short architecture/system note so it still describes reality. Bring any status board
(e.g. a progress doc) current if the repo has one.
EXIT TEST: grep this iteration's key decisions and invariants inside the repo — every one findable
in a tracked file. Anything findable only in chat = Phase 1 not done.
Phase 2 — SHED (ruthless deletion; git history is the ONLY archive)
- Build a deletion inventory with evidence, one line each:
path | why dead | what supersedes it.
Cover superseded modules/specs, dead/empty dirs, dev residue (scratch files, mktemp-style
junk, test rows in real-shaped stores), completed plan/TODO docs, and STALE DOCS — run a
docs-vs-code contradiction pass; a doc that asserts what the code contradicts is worse than none.
Mark each line TRACKED or UNTRACKED (git ls-files --error-unmatch <path>), because the two
have different fates (rules 3 and 4).
- Present the COMPLETE inventory to the user and wait for an explicit yes before deleting
anything. Partial approval is fine — act only on approved lines. The agent never presses
irreversible buttons on its own; "the user asked for a cleanup" authorizes building the list,
not executing it.
- Tracked files:
git rm only. NO _archive/ dirs, NO .bak, NO old-/legacy- renames, NO
commented-out corpses. Recovery = git history, one git revert away — that is the archive; a
checkpoint commit before deleting makes it bulletproof.
- Untracked or gitignored files: NEVER
rm directly — git history cannot recover what was
never committed. This is the data-safety line. Move them into the repo's declared quarantine
directory (Step 0.6) instead. If none is declared, create one now: .iteration-quarantine/ at
repo root, added to .gitignore, declared in the entry doc with one line ("quarantine for
untracked files pending deletion — emptied manually by the user"). Emptying quarantine is the
user's act — offer it at a future close, with its own explicit yes; never silently.
- Never shed the product's real DATA as if it were dev residue. User/customer state, saved
sessions, real archives of user content look like clutter and are the product's soul. When a
directory could be either, treat it as data and keep it; verify before any
git rm.
- Commit deletions in themed groups; each message says WHY + what supersedes it.
- Post-deletion checks (all that apply must pass): if the repo has a test suite, it is green;
dangling-reference grep for every deleted module/symbol is empty (an import of a deleted file
crashes at startup — a real scar); the entry doc and skill docs reference no deleted path.
EXIT TEST: git status clean, no archive-shaped dirs exist — except directories the entry doc
declares as data, recovery, or quarantine (Step 0.6) — dangling grep empty, and the test suite
green if one exists.
Phase 3 — TWO READINESS CHANNELS (different needs; verify separately)
Uploading and being-continuable are NOT the same problem. Conflating them is how a repo gets
"pushed to the cloud" while its real state still lives in a chat log. Verify each on its own.
3a. Confirmed cloud upload (the TRANSPORT problem)
- Secret scan on TRACKED files only (sk-ant / ghp_ / gho_ / github_pat / AKIA / xox[baprs] /
consumer_secret / access_token / Bearer / BEGIN PRIVATE KEY / .env shapes). Any hit → stop,
scrub, re-scan.
- Check
git remote. If there is NO remote, upload needs one the USER provides — adding a remote
is a config change, so confirm it with the user or record "no remote yet — publish deferred"
and skip to 3b rather than erroring on a bare git command.
- With a remote: show
git log @{u}..HEAD --oneline + diffstat (fall back to "all local commits"
when there is no upstream yet) — exactly what will leave this machine.
- Upload via the repo's confirmed-upload command (Step 0.2) after the user confirms; if the repo
has none,
git push after the diffstat and a yes. Never auto-push.
3b. Zero-context takeover (the KNOWLEDGE-COMPLETENESS problem) — the cold-start probe
- Get ONE genuinely context-free reader onto the repo — in Claude Code: spawn a fresh subagent
(Task tool); in Codex: run a fresh
codex exec or a new session with no prior context; on any
bare harness: open a new session and paste ONLY the repo path plus the questions, never this
conversation. Give it only the repo path and: "Read this repo cold from its entry doc. Then
answer: (1) what is this product, in one sentence; (2) where does the work stand (done / next);
(3) what would you do next and why; (4) name three things you must never do here."
- Grade its answers against the repo's canonical docs. If the repo has no entry/canonical doc
at all, creating a minimal one (the product in one sentence, current state done/next, three
never-dos) is part of this close — it is the artifact the probe grades. Do not run the probe
against nothing.
- Every wrong or missing answer is a TAKEOVER-DOC BUG, not the probe's fault. Fix (or create) the
doc, re-run with a NEW fresh reader. Loop until a cold reader scores 4/4, capped at 3 rounds —
if it still fails after 3, list the remaining gaps and hand the decision to the user.
EXIT TEST: probe passes 4/4. Only then is "any new window / machine can continue" a tested fact.
Phase 4 — ONE-COMMAND BOOTSTRAP (rehearsed, not assumed)
- Ensure the repo's bootstrap (Step 0.3) exists and is current — idempotent, safe to re-run:
verify toolchain versions; wire sync/config; install deps; run the test suite if one exists;
print the current status + the NAMES of any missing local secrets (never values, e.g.
"config.local.json absent — needed only for live publish"); exit non-zero on any failure with a
one-line reason. If no bootstrap exists yet, this is the iteration to create one.
- REHEARSE it: clone the repo into a scratch dir (from the origin URL, or from the local repo path
when there is no remote yet) and run the bootstrap there. It must end green with ZERO manual
steps. Delete the rehearsal clone after.
- The new-machine story must be one line and TRUE after this rehearsal:
git clone <origin-url> <dir> && cd <dir> && <bootstrap command>. If no remote exists yet, note
that this line is not yet true until the user sets one — don't publish it as if it works.
EXIT TEST: the rehearsal clone bootstraps green, untouched by hands.
Phase 5 — CLOSE + SEED (continuity)
- Tag the iteration:
git tag iter-<N>-<slug> (annotated, one-line summary). N = 1 + the count of
existing iter-* tags (git tag --list "iter-*"); the first close is iter-1.
- Update the status board / log with one line, if the repo has one: what was distilled, how many
files shed, probe 4/4, bootstrap rehearsed.
- Emit the NEXT-ITERATION SEED into chat: the open questions this iteration surfaced + a
paste-ready kickoff prompt for the next slice (goal, acceptance, and a reminder to run the
repo's grounding gate before building, if it has one).
Major iteration — when the STRUCTURE itself is replaced (same rules, bigger skin)
A structural overhaul — new architecture, new module tree, even "the old approach was wrong" — is
still an ITERATION of one organism, not a restart. It keeps its git history, its decisions, its
lessons; only the skin is new. Restarts bleed: every time a project is reborn in a fresh repo,
lesson-grade material gets left behind. So:
- Grow the new structure IN THIS REPO alongside the old (strangler pattern): the new tree earns
tests and ownership first; the old tree dies in Phase 2 only once nothing references it.
- Opening a NEW repo is the expensive exception, not the default — it requires a recorded decision
stating why THIS history must be abandoned, approved before any files move.
- Same five phases; the deletion inventory is just larger and the cold-start probe matters more —
the new structure's docs have never met a stranger.
- If the product's name or entry command changes, Phase 4's one-line story updates in the SAME
iteration. Two live names is a two-truths bug.
Guardrails (non-negotiable)
- Phase order is the safety mechanism: NEVER shed (Phase 2) before distill (Phase 1) exits — in
shed-only mode, the Phase 1 spot-check on the inventory is that gate.
- The complete deletion inventory is shown to the user, and NOTHING is deleted without their
explicit yes. The agent never presses irreversible buttons on its own.
- Untracked or gitignored files are quarantined, never
rm'd — git history cannot recover them.
- Deletion needs evidence of supersession, not vibes. Genuinely unsure? Keep it ONE more iteration
and record the doubt in the decision record — not in an archive dir.
- Push is a confirmed act, always. No auto-push, no bypassing the repo's upload step.
- The cold-start reader must be genuinely context-free (fresh subagent /
codex exec / new
session — repo only) or the probe is theater.
- If the repo runs multiple agents/lanes in parallel, don't touch another lane's uncommitted paths;
hand off through its board if it has one.
- When this skill and the repo disagree about the repo's conventions, the repo wins.
1---2name: iteration-close3description: Close out a development iteration, sprint, or milestone in any repo, distill chat-born decisions into the repo's own record, then shed superseded files — git history is the archive (no _archive dirs, .bak, or legacy- renames), the full deletion list needs the user's explicit yes before anything is removed, and untracked files are quarantined, never rm'd. Verify two separate readiness channels (a confirmed upload AND a tested zero-context takeover probe), rehearse the one-command bootstrap on a fresh clone, then tag and seed the next iteration. Runs the cleanup phase alone when the user only wants dead files cleared. Trigger on: "close out this iteration", "wrap up this sprint and clean out the dead files", "could a fresh machine take this over?", "clear the superseded files from the repo", "milestone's done — tidy and tag it", 收口 / 迭代收口 / 迭代收尾 / 收尾 / 封版 / 甩包袱 / 清旧账 / 蜕壳 / 这个迭代做完了 / 可以发版了 / 这版可以发版了 / 收尾上云. NOT a casual end-of-day sign-off; NOT how-to-publish-a-package questions. Works in Claude Code and Codex.4---56# iteration-close — distill, shed, prove takeover, rehearse bootstrap, seed next78A product that iterates forever accumulates two silent debts, and this skill pays both down at9every iteration boundary — safely (nothing is lost) but ruthlessly (nothing dead is kept):10- Dead files linger and rot into two-truths — a deprecated tree sits around for weeks; a runbook11 keeps claiming a component is "not built" long after it shipped.12- Knowledge that lives only in a chat window dies with it — whole working pipelines have died in13 scratchpads; hard-won decisions die with the session. Keep the lesson, not the artifact.1415It is generic: it works on any repo by reading that repo's own conventions, and where a16convention is absent it creates the minimum rather than assuming or erroring. "A fresh window or17new machine can continue" is a HOPE until it is TESTED; being current (pull) is always safe, but18publishing (push) is a deliberate choice. Respond in the language the user is working in.1920## Two ways to run2122- **Full close** (default): all five phases, in order. Use when an iteration/slice is done and23 the user wants it closed out end to end.24- **Shed-only** (standalone cleanup): when the user only asks to clear old/dead/superseded files,25 run Phase 2 alone — do NOT force the full five-act close on them. Preconditions still apply:26 run Step 0 (orient), the fail-closed refusal checks, and a Phase 1 spot-check scoped to the27 deletion inventory — any item whose lesson or decision lives only in chat gets distilled into a28 tracked file first, or stays out of the inventory. Every Phase 2 rule applies unchanged,29 including the explicit-yes gate and the quarantine rule.3031## Step 0 — orient to THIS repo (discover, else plan to create)3233Read whichever entry doc exists — `CLAUDE.md` / `AGENTS.md` / `README` / a `docs/` index — and34discover six things. Use what you find; where something is absent, note it as a gap this close35will fill (each phase below says how), never invent a path that isn't there.36371. **Lesson/decision record** — where does this repo bank decisions? (`CHANGELOG`, `docs/adr/`,38 `DECISIONS.md`, or a repo-specific register.) If none, Phase 1 creates a single `DECISIONS.md`.392. **Confirmed-upload command** — a deliberate push step (`bin/sync`, `make deploy`, a documented40 `git push` discipline)? If yes, that IS the upload channel; never bypass it. If none, Phase 3a41 uses plain `git push` after a diffstat + confirm.423. **Bootstrap command** — how does a fresh clone come alive? (`bin/bootstrap`, `bin/sync-setup`,43 `install.sh`, `make setup`, a package-manager install.) If none, Phase 4 creates one.444. **Test command** — from CI config, `package.json` scripts, a Makefile, or the language default45 (`pytest` / `go test` / `cargo test` / `npm test`). If none is discoverable, the repo has no46 runnable suite yet: treat that as an explicit state below — never read it as "green", never47 REFUSE on a repo that legitimately has none.485. **Grounding / gate skill** — a product-grounding or pre-build gate skill? If so, its49 "after-build" checklist is your pre-close gate. (Product-specific gates live inside the product50 repo; this skill stays generic and defers to them.)516. **Declared data / recovery / quarantine directories** — directories the entry doc names as52 holding real data, recovery material, or quarantined files. These are exempt from every53 "archive-shaped dirs must not exist" rule below and must never appear on a deletion inventory.5455## Refuse to run (fail-closed)5657Do not close mid-iteration — you lose skin AND flesh. REFUSE (in both run modes) if: the58directory is not a git repository (stop and say so — running `git init` is the user's59decision); the test60suite exists and is actually FAILING (an absent suite is not a failing one — see Step 0.4); an61adversarial gate, if the repo has one, is pending or CHANGES-REQUIRED; or another agent/lane has62uncommitted mid-slice work in paths you'd touch. Say what's blocking and stop.6364In a full close, run the phases IN ORDER. Each has an exit test; never proceed past a failed exit.6566## Phase 1 — DISTILL (salvage gate: nothing dies before its lesson is banked)67681. Sweep this iteration's chat-born decisions into the repo's decision record (Step 0.1), each69 with its status and source. **If the repo banks decisions nowhere yet, creating the record is70 part of this phase — a single `DECISIONS.md` at repo root is enough.** A decision that exists71 only in a chat window does not exist; do not leave distilled decisions with no tracked home.722. New invariants/rules discovered this iteration → the repo's contracts file, or lacking that the73 decision record — ideally each as a test. If neither exists, create the decision record and put74 them there. Delete the artifact, keep the invariant.753. Session-only-capability check: did this iteration rely on anything living ONLY in a prompt, a76 scratchpad, or someone's memory? Promote it into the repo (code / skill / doc) or record its77 deliberate exclusion. Name each one explicitly — this is where pipelines die.784. If the STRUCTURE changed, update — or, if none exists and the structure is now nontrivial,79 create — a short architecture/system note so it still describes reality. Bring any status board80 (e.g. a progress doc) current if the repo has one.8182EXIT TEST: grep this iteration's key decisions and invariants inside the repo — every one findable83in a tracked file. Anything findable only in chat = Phase 1 not done.8485## Phase 2 — SHED (ruthless deletion; git history is the ONLY archive)86871. Build a deletion inventory with evidence, one line each: `path | why dead | what supersedes it`.88 Cover superseded modules/specs, dead/empty dirs, dev residue (scratch files, `mktemp`-style89 junk, test rows in real-shaped stores), completed plan/TODO docs, and STALE DOCS — run a90 docs-vs-code contradiction pass; a doc that asserts what the code contradicts is worse than none.91 Mark each line TRACKED or UNTRACKED (`git ls-files --error-unmatch <path>`), because the two92 have different fates (rules 3 and 4).932. **Present the COMPLETE inventory to the user and wait for an explicit yes before deleting94 anything.** Partial approval is fine — act only on approved lines. The agent never presses95 irreversible buttons on its own; "the user asked for a cleanup" authorizes building the list,96 not executing it.973. Tracked files: `git rm` only. NO `_archive/` dirs, NO `.bak`, NO `old-`/`legacy-` renames, NO98 commented-out corpses. Recovery = git history, one `git revert` away — that is the archive; a99 checkpoint commit before deleting makes it bulletproof.1004. **Untracked or gitignored files: NEVER `rm` directly — git history cannot recover what was101 never committed. This is the data-safety line.** Move them into the repo's declared quarantine102 directory (Step 0.6) instead. If none is declared, create one now: `.iteration-quarantine/` at103 repo root, added to `.gitignore`, declared in the entry doc with one line ("quarantine for104 untracked files pending deletion — emptied manually by the user"). Emptying quarantine is the105 user's act — offer it at a future close, with its own explicit yes; never silently.1065. **Never shed the product's real DATA as if it were dev residue.** User/customer state, saved107 sessions, real archives of user content look like clutter and are the product's soul. When a108 directory could be either, treat it as data and keep it; verify before any `git rm`.1096. Commit deletions in themed groups; each message says WHY + what supersedes it.1107. Post-deletion checks (all that apply must pass): if the repo has a test suite, it is green;111 dangling-reference grep for every deleted module/symbol is empty (an import of a deleted file112 crashes at startup — a real scar); the entry doc and skill docs reference no deleted path.113114EXIT TEST: `git status` clean, no archive-shaped dirs exist — except directories the entry doc115declares as data, recovery, or quarantine (Step 0.6) — dangling grep empty, and the test suite116green if one exists.117118## Phase 3 — TWO READINESS CHANNELS (different needs; verify separately)119120Uploading and being-continuable are NOT the same problem. Conflating them is how a repo gets121"pushed to the cloud" while its real state still lives in a chat log. Verify each on its own.122123### 3a. Confirmed cloud upload (the TRANSPORT problem)1241. Secret scan on TRACKED files only (sk-ant / ghp_ / gho_ / github_pat / AKIA / xox[baprs] /125 consumer_secret / access_token / Bearer / BEGIN PRIVATE KEY / .env shapes). Any hit → stop,126 scrub, re-scan.1272. Check `git remote`. If there is NO remote, upload needs one the USER provides — adding a remote128 is a config change, so confirm it with the user or record "no remote yet — publish deferred"129 and skip to 3b rather than erroring on a bare git command.1303. With a remote: show `git log @{u}..HEAD --oneline` + diffstat (fall back to "all local commits"131 when there is no upstream yet) — exactly what will leave this machine.1324. Upload via the repo's confirmed-upload command (Step 0.2) after the user confirms; if the repo133 has none, `git push` after the diffstat and a yes. Never auto-push.134135### 3b. Zero-context takeover (the KNOWLEDGE-COMPLETENESS problem) — the cold-start probe1361. Get ONE genuinely context-free reader onto the repo — in Claude Code: spawn a fresh subagent137 (Task tool); in Codex: run a fresh `codex exec` or a new session with no prior context; on any138 bare harness: open a new session and paste ONLY the repo path plus the questions, never this139 conversation. Give it only the repo path and: "Read this repo cold from its entry doc. Then140 answer: (1) what is this product, in one sentence; (2) where does the work stand (done / next);141 (3) what would you do next and why; (4) name three things you must never do here."1422. Grade its answers against the repo's canonical docs. **If the repo has no entry/canonical doc143 at all, creating a minimal one (the product in one sentence, current state done/next, three144 never-dos) is part of this close — it is the artifact the probe grades. Do not run the probe145 against nothing.**1463. Every wrong or missing answer is a TAKEOVER-DOC BUG, not the probe's fault. Fix (or create) the147 doc, re-run with a NEW fresh reader. Loop until a cold reader scores 4/4, capped at 3 rounds —148 if it still fails after 3, list the remaining gaps and hand the decision to the user.149150EXIT TEST: probe passes 4/4. Only then is "any new window / machine can continue" a tested fact.151152## Phase 4 — ONE-COMMAND BOOTSTRAP (rehearsed, not assumed)1531541. Ensure the repo's bootstrap (Step 0.3) exists and is current — idempotent, safe to re-run:155 verify toolchain versions; wire sync/config; install deps; run the test suite if one exists;156 print the current status + the NAMES of any missing local secrets (never values, e.g.157 "config.local.json absent — needed only for live publish"); exit non-zero on any failure with a158 one-line reason. If no bootstrap exists yet, this is the iteration to create one.1592. REHEARSE it: clone the repo into a scratch dir (from the origin URL, or from the local repo path160 when there is no remote yet) and run the bootstrap there. It must end green with ZERO manual161 steps. Delete the rehearsal clone after.1623. The new-machine story must be one line and TRUE after this rehearsal:163 `git clone <origin-url> <dir> && cd <dir> && <bootstrap command>`. If no remote exists yet, note164 that this line is not yet true until the user sets one — don't publish it as if it works.165166EXIT TEST: the rehearsal clone bootstraps green, untouched by hands.167168## Phase 5 — CLOSE + SEED (continuity)1691701. Tag the iteration: `git tag iter-<N>-<slug>` (annotated, one-line summary). N = 1 + the count of171 existing `iter-*` tags (`git tag --list "iter-*"`); the first close is iter-1.1722. Update the status board / log with one line, if the repo has one: what was distilled, how many173 files shed, probe 4/4, bootstrap rehearsed.1743. Emit the NEXT-ITERATION SEED into chat: the open questions this iteration surfaced + a175 paste-ready kickoff prompt for the next slice (goal, acceptance, and a reminder to run the176 repo's grounding gate before building, if it has one).177178## Major iteration — when the STRUCTURE itself is replaced (same rules, bigger skin)179180A structural overhaul — new architecture, new module tree, even "the old approach was wrong" — is181still an ITERATION of one organism, not a restart. It keeps its git history, its decisions, its182lessons; only the skin is new. Restarts bleed: every time a project is reborn in a fresh repo,183lesson-grade material gets left behind. So:184185- Grow the new structure IN THIS REPO alongside the old (strangler pattern): the new tree earns186 tests and ownership first; the old tree dies in Phase 2 only once nothing references it.187- Opening a NEW repo is the expensive exception, not the default — it requires a recorded decision188 stating why THIS history must be abandoned, approved before any files move.189- Same five phases; the deletion inventory is just larger and the cold-start probe matters more —190 the new structure's docs have never met a stranger.191- If the product's name or entry command changes, Phase 4's one-line story updates in the SAME192 iteration. Two live names is a two-truths bug.193194## Guardrails (non-negotiable)195196- Phase order is the safety mechanism: NEVER shed (Phase 2) before distill (Phase 1) exits — in197 shed-only mode, the Phase 1 spot-check on the inventory is that gate.198- The complete deletion inventory is shown to the user, and NOTHING is deleted without their199 explicit yes. The agent never presses irreversible buttons on its own.200- Untracked or gitignored files are quarantined, never `rm`'d — git history cannot recover them.201- Deletion needs evidence of supersession, not vibes. Genuinely unsure? Keep it ONE more iteration202 and record the doubt in the decision record — not in an archive dir.203- Push is a confirmed act, always. No auto-push, no bypassing the repo's upload step.204- The cold-start reader must be genuinely context-free (fresh subagent / `codex exec` / new205 session — repo only) or the probe is theater.206- If the repo runs multiple agents/lanes in parallel, don't touch another lane's uncommitted paths;207 hand off through its board if it has one.208- When this skill and the repo disagree about the repo's conventions, the repo wins.