Add /retrofit command for Part 3 of the playbook

Automate the per-project retrofit (git audit, verify, scope, commit,
validate) as a main-thread slash command that asks for the judgment
calls. Step 1 (mining a past chat) stays manual — the command surfaces
which conversation to mine and hands back, since it can't resume one.
This commit is contained in:
Keysat
2026-06-12 19:42:42 -05:00
parent 8352592835
commit 85f8cb405a
3 changed files with 158 additions and 3 deletions
+10 -3
View File
@@ -46,6 +46,13 @@ Read the table — now you know which projects are protected, which are repos in
## Part 3 — Per-project retrofit (~2025 min each)
> **Shortcut once you know the why:** the `/retrofit` command drives this whole part for
> you — git audit, then verify/scope/commit/validate — pausing to ask you the judgment
> calls. The one step it can't do is Step 1: it can't resume a past conversation, so it
> surfaces *which* old chat to mine and hands back to you. Read the steps below at least
> once (the point is learning the rhythm); reach for `/retrofit` on repo #3 onward.
> Guide: `guides/retrofit.md`.
### Step 0 — Open the project and audit git
```
@@ -73,9 +80,9 @@ Paste, one after another:
> **A — knowledge:** Based on everything we've done in this project, write an AGENTS.md at the repo root that a fresh coding-agent session could read and be immediately productive with. Include: a one-line description; the stack/versions that matter; the exact build, test (including how to run a single test), lint, and run commands; the directory layout worth knowing on day one; the conventions you've learned I follow here; and an Always/Never list of the gotchas and decisions we hit — especially anything you got wrong earlier that I corrected. Under 200 lines, markdown headers and short bullets, concrete and verifiable, no history. Don't invent commands or paths — mark anything you're unsure of as TODO. No API keys, tokens, or secrets — reference env-var names instead. Write the file now, then create a symlink so Claude Code loads it: ln -s AGENTS.md CLAUDE.md
> **B — state:** Now append a "## Current state" section to the bottom of CLAUDE.md: what's built and working, what's in progress and exactly where it stands, decisions we made that aren't implemented yet, known bugs, and the next 35 concrete steps. 15 lines max, present tense, no history. Longer-term backlog goes in a separate ROADMAP.md.
> **B — state:** Now append a "## Current state" section to the bottom of AGENTS.md: what's built and working, what's in progress and exactly where it stands, decisions we made that aren't implemented yet, known bugs, and the next 35 concrete steps. 15 lines max, present tense, no history. Longer-term backlog goes in a separate ROADMAP.md.
> **C — secrets sweep:** Scan CLAUDE.md and anything else you just wrote for secrets — API keys, tokens, passwords, account numbers, private URLs. Replace each with its env-var name and a note about where the real value lives.
> **C — secrets sweep:** Scan AGENTS.md and anything else you just wrote for secrets — API keys, tokens, passwords, account numbers, private URLs. Replace each with its env-var name and a note about where the real value lives.
Then `/exit`. The old chat's job is done forever.
@@ -95,7 +102,7 @@ Type:
Because a CLAUDE.md already exists, it proposes improvements instead of overwriting — accept what looks right. Then paste:
> Now actually run every build, test, lint, and run command listed in CLAUDE.md and fix whatever's wrong, updating CLAUDE.md to match reality. Resolve every TODO the same way: verify it by running it, then replace it.
> Now actually run every build, test, lint, and run command listed in AGENTS.md and fix whatever's wrong, updating AGENTS.md to match reality. Resolve every TODO the same way: verify it by running it, then replace it.
### Step 3 — Trim and scope (same session)