project-retrofit
Skill5 starsChanged 21 days agoMITView on GitHub
Move an existing project's big CLAUDE.md, notes or TODO into the standard doc set without losing any text. Use for "retrofit this project", "split up this CLAUDE.md" or "migrate our notes to the standard docs".
In this repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cavemanSkill
- gh-issues-by-severitySkill
- grid-helpSkill
- grill-meSkill
- growth-psychSkill
- handoffSkill
- mine-learningsSkill
- openspec-helpSkill
- project-bootstrapSkill
- project-scaffoldSkill
- rubber-duckSkill
- setup-repo-skillsSkill
- skill-scoutSkill
- spec-scoutSkill
- standupSkill
- tightenSkill
- un-claudishSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Stop and wait for the reply.
- Very specific: line 25
Write the plan to a working file outside every destination, e.g.
- Very specific: line 33
Ask the operator to commit or stash first, so git restore <destinations> (plus deleting a new UNSORTED.md or newly scaffolded files) is the …
- Very specific: line 37
Write a SLIM replacement entry doc (under 60 lines.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
project-retrofit
You decide where each block of text goes. retrofit.py moves it verbatim and
proves nothing was lost. Never retype, summarise or reword source text, and
never hand-edit a destination to fix a coverage failure.
Script: project-factory/scripts/retrofit.py (beside skills/; resolve symlinks
with cd -P). Run it from the target repo root. Exit codes: 0 ok, 1 coverage
failure, 2 plan error or refusal (nothing written).
Steps
python3 <retrofit.py> survey .(read-only). Ask the operator ONE short batch: which sources to migrate (default: CLAUDE.md and agent notes; README and TODO stay unless chosen), which optional docs to scaffold, anything off-limits. Stop and wait for the reply.- Scaffold what is missing:
bash <project-factory>/scripts/cut-project.sh --generic [--with a,b] .(existing files are skipped, never overwritten). python3 <retrofit.py> blocks <source>; read the source with line numbers. Write the plan to a working file outside every destination, e.g..retrofit/plan.md(tell the operator it is a working file). Its header is the## source: ... sha256:...lineblocksprinted, pasted unchanged. Mapping guide and syntax: sections/. Every block is accounted for once. Ambiguous meansunsorted. Never guess, never drop.apply <plan>(dry run; validates everything) and show the operator a SUMMARY TABLE: destination, block count, bytes, previews, any WARNING. Wait for approval. Never apply before approval.- Ask the operator to commit or stash first, so
git restore <destinations>(plus deleting a new UNSORTED.md or newly scaffolded files) is the undo: apply has no revert command. Thenapply <plan> --yesandcheck <plan> --report. If check fails: stop, show the MISSING lines, restore via git, fix the plan, re-run. - Write a SLIM replacement entry doc (under 60 lines;
finalizerefuses more,--max-lines Noverrides, 0 = none). Shape:project-factory/templates/_core/CLAUDE.md(cut-project skips an existing CLAUDE.md). Include only pointers, thekeeptext (retrofit.py keep <plan>prints it) and facts in the archived original; nothing mechanical checks the rest, so invent nothing. Show the FULL replacement to the operator; runfinalize <plan> --replace-with <file>dry, then--yesafter approval. Never pass--allow-dirtywithout the operator's explicit yes; ask them to commit the source instead. It archives the original todocs/archive/and prints the undo (mv). git addthe new docs first (map.py lists tracked files only, so an untracked tree gives a false pass), thenpython3 scripts/map.pyandpython3 scripts/map.py --check. Report: coverage numbers, UNSORTED.md block count,<fill:markers left, files changed. Commit only if the operator asks.
Sections
- sections/mapping-guide.md: read when writing the plan in step 3.
- sections/plan-format.md: read when the script rejects a plan or you need the exact syntax.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

