retrofit
Skill6 starsChanged 3 months agoMITView on GitHub
Audit an existing repo against a profile and offer to fix what's drifted. TRIGGER when the user says "retrofit this repo", "fix this repo's hygiene", "bring this repo into compliance", "remediate drift", "fix what's drifted", "make this repo match the profile", "my repo is half set up, finish it", "I already have some hooks but they're incomplete", "fill in the gaps", "upgrade this repo to nyann standards", "apply the profile to this existing repo". ALSO trigger when doctor finishes with drift (exit 4 or 5) and the user says "fix it", "remediate", "yes fix those", "go ahead and fix". Do NOT trigger on "is this repo healthy" / "check hygiene" / "audit docs" — those are doctor (read-only). Do NOT trigger on "set up this project" from scratch — that's bootstrap-project.
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- blyatiful1/ultrawebtheir own version, first seen Sep 2, 2026
- soltraveler-sri/Steerable-Protocoltheir own version, first seen Jul 17, 2026
- piyushverma0/android-agent-skillstheir own version, first seen Mar 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- piyushverma0/android-agent-skills★ 15same name
- blyatiful1/ultraweb★ 1same name
- soltraveler-sri/Steerable-Protocol★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository41 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-team-sourceSkill
- bootstrap-projectSkill
- check-prereqsSkill
- cleanup-branchesSkill
- commitSkill
- diagnoseSkill
- diff-profileSkill
- doctorSkill
- explain-diffSkill
- explain-stateSkill
- fleet-retrofitSkill
- fleetSkill
- gen-ciSkill
- gen-claudemdSkill
- gen-dependency-updaterSkill
- gen-devcontainerSkill
- gen-templatesSkill
- gh-protectSkill
- hotfixSkill
- iac-applySkill
- iac-planSkill
- inspect-profileSkill
- learn-profileSkill
- migrate-profileSkill
- new-branchSkill
- optimize-claudemdSkill
- prSkill
- record-decisionSkill
- releaseSkill
- route-docsSkill
- settingsSkill
- setupSkill
- shipSkill
- suggestSkill
- syncSkill
- sync-team-profilesSkill
- undo-bootstrapSkill
- undoSkill
- wait-for-pr-checksSkill
- watchSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Check if the repo's CLAUDE.md (inside <!-- nyann:start --> markers) declares an active profile name.
- Very specific: line 30
If the user passed --profile <name>, use that.
- Distinctive: line 31
If neither, ask the user which profile to audit against.
- Very specific: line 40
Run bin/detect-stack.sh --path <target> to get the StackDescriptor.
- Very specific: line 57
If the user said something like "only fix the docs drift", "leave my hooks alone", "just the gitignore", or otherwise wants to remediate …
- Very specific: line 75
When the report covers fewer than the full 7 categories, the rendered text adds a Scope: <csv> line under the heading.
- Distinctive: line 82
If the user did NOT specify a scope AND the resulting report shows drift in more than one category, prompt before remediation:
- Distinctive: line 117
When drift exists (exit 4 or 5) and the user confirms they want to fix it:
- Very specific: line 128
Misplaced docs (v1.9.0+): If the DriftReport's misplaced[] array is non-empty, docs exist at non-canonical paths.
- Very specific: line 146
If Yes: write the misplaced[] array to a temp file and run bin/reorganize-docs.sh --target <cwd> --moves <temp.json> --apply before the …
- Distinctive: line 153
If No: proceed normally — scaffold-docs creates fresh templates at canonical paths (existing non-canonical files remain untouched).
- Very specific: line 159
Archetype-aware retrofit (v1.6.0+): if the profile sets documentation.use_archetype_scaffolds: true, the resolved DocumentationPlan will …
- Very specific: line 166
When the profile leaves use_archetype_scaffolds unset/false, retrofit does NOT auto-flip it.
- Distinctive: line 207
Re-run doctor: after remediation to confirm the drift is resolved.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
retrofit
Audit an existing repo's drift from a profile and remediate what's missing or misconfigured. This is the "fix it" counterpart to doctor's "tell me what's wrong."
1. Resolve the profile
Same logic as doctor — the audit is only meaningful against an intended baseline:
- Check if the repo's CLAUDE.md (inside
<!-- nyann:start -->markers) declares an active profile name. - If the user passed
--profile <name>, use that. - If neither, ask the user which profile to audit against. List available profiles (starters + any user/team profiles). Don't silently default — the wrong baseline produces misleading drift.
Load via bin/load-profile.sh <name>. If exit 2 (not found), show the
list the loader reports and ask again.
2. Run detection
Run bin/detect-stack.sh --path <target> to get the StackDescriptor. This
ensures the remediation step has stack context for gitignore templates, hook
phases, and CLAUDE.md rendering.
3. Run the drift audit
bin/retrofit.sh --target <cwd> --profile <resolved-name>Do not pass --report-only — that's doctor's flag. Retrofit's default
mode renders the report AND offers remediation guidance.
Pass --json only if the user explicitly asks for machine-readable output.
3a. Narrow scope (v1.7.0+)
If the user said something like "only fix the docs drift", "leave my
hooks alone", "just the gitignore", or otherwise wants to remediate
one part of the audit without touching others, pass --scope <csv>
to retrofit:
| User intent | --scope |
| "fix only the docs" | docs |
| "fix hooks but leave docs alone" | hooks |
| "fix the gitignore" | gitignore |
| "fix only docs and hooks" | docs,hooks |
| "fix the github protection settings" | github |
| "fix everything" / unstated | omit (default all) |
The accepted categories are docs, hooks, branching, gitignore,
editorconfig, github, history, all. Unknown values exit
non-zero; surface the error to the user verbatim.
When the report covers fewer than the full 7 categories, the rendered
text adds a Scope: <csv> line under the heading. The remediation
plan in step 5 uses the same --scope so that bootstrap only writes
the matching files.
3b. Multi-category prompt (when scope is unstated)
If the user did NOT specify a scope AND the resulting report shows drift in more than one category, prompt before remediation:
{
"questions": [{
"question": "Drift detected across multiple categories. Which to fix?",
"header": "Scope",
"multiSelect": true,
"options": [
{"label": "Docs", "description": "CLAUDE.md size, doc scaffolds, links, orphans, staleness"},
{"label": "Hooks", "description": "Husky, commitlint, pre-commit.com, core hooks"},
{"label": "Gitignore", "description": "Missing stack-typical entries"},
{"label": "Branching", "description": "Profile-declared base/long-lived branches"},
{"label": "GitHub", "description": "CI workflow, PR template, branch + tag protection"},
{"label": "Editorconfig","description": ".editorconfig presence"},
{"label": "All", "description": "Apply every remediation"}
]
}]
}Map the labels back to the --scope value: e.g. {Docs, Hooks} →
docs,hooks. If the user picks "All", omit the flag.
4. Interpret the exit code
| Code | Meaning | What to do |
| 0 | clean | "No drift detected. Repo matches the profile." Done. |
| 4 | warnings | Show the report. Offer to remediate (step 5). |
| 5 | critical | Show the report. Strongly recommend remediation (step 5). |
5. Remediate
When drift exists (exit 4 or 5) and the user confirms they want to fix it:
Build an ActionPlan from the drift report. Map missing items to
writes[]entries:- Missing
.gitignore→ gitignore combiner handles it - Missing
.husky/*,commitlint.config.js→install-hooks.sh --jsts - Missing
.pre-commit-config.yaml→install-hooks.sh --python - Missing
docs/*,memory/*→scaffold-docs.sh - Missing/oversized
CLAUDE.md→gen-claudemd.sh - Missing
.editorconfig→ include in plan if profile declares it
Misplaced docs (v1.9.0+): If the DriftReport's
misplaced[]array is non-empty, docs exist at non-canonical paths. Before scaffolding new docs, offer to reorganize the existing ones:{ "questions": [{ "question": "Found docs at non-standard paths. Reorganize to nyann conventions?", "header": "Doc layout", "options": [ {"label": "Yes, reorganize", "description": "Move docs to canonical paths (uses git mv). Content is preserved."}, {"label": "No, scaffold fresh", "description": "Leave existing files and create new ones at canonical paths."} ], "multiSelect": false }] }If Yes: write the
misplaced[]array to a temp file and runbin/reorganize-docs.sh --target <cwd> --moves <temp.json> --applybefore the scaffold step. (Without--apply, the script previews only — pass--applyafter the user confirms.) After moves complete, the scaffold step detects the files at canonical paths and skips creation — preserving user content.If No: proceed normally — scaffold-docs creates fresh templates at canonical paths (existing non-canonical files remain untouched).
- Missing
Route docs via
bin/route-docs.sh --profile <path>to get the DocumentationPlan (needed by bootstrap for scaffold-docs and gen-claudemd).Archetype-aware retrofit (v1.6.0+): if the profile sets
documentation.use_archetype_scaffolds: true, the resolved DocumentationPlan will include the per-archetype doc set (api-reference / runbook / deployment / glossary as applicable).compute-driftwill surface any missing files from that set asmissingentries, and remediation will scaffold them.When the profile leaves
use_archetype_scaffoldsunset/false, retrofit does NOT auto-flip it. Per the v1.6.0 design, opt-in stays opt-in — surface the absent flag as informational only: "This profile could enable archetype-aware scaffolds. Run/nyann:migrate-profileor setuse_archetype_scaffolds: truein your profile to opt in."- Render merge previews via
bin/render-plan.sh --plan <plan.json> --target <cwd> --profile <profile.json> --doc-plan <doc-plan.json> --templates-csv <jsts|python|...> --output <plan.rendered.json>sopreview.shcan diff.gitignoreandCLAUDE.mdmerges against the current files. Skip render-plan only when neither path appears as a merge action in the plan. - Preview the rendered plan via
bin/preview.sh --plan <plan.rendered.json> --target <cwd>. Pass--targetso the merge-diff renderer resolves.pathentries against the actual repo. Show the user what will be created/merged. Respect skip requests. - Execute via
bin/bootstrap.sh --source retrofit. The--sourceflag labels the boot record so/nyann:undo-bootstrapcan tell remediation runs apart from initial setups. Capture the plan SHA-256 first viabin/preview.sh --emit-sha256, then pass it through as--plan-sha256so bootstrap can verify the plan bytes haven't changed between the user's confirmation and execution. The SHA binding is required; bootstrap refuses to run without it.
Bootstrap is idempotent — existing user content is preserved, hooks are merged (not overwritten), gitignore entries are deduplicated.sha=$(bin/preview.sh --plan <confirmed-plan.json> --emit-sha256) bin/bootstrap.sh \ --target <cwd> \ --plan <confirmed-plan.json> \ --plan-sha256 "$sha" \ --profile <path> \ --doc-plan <doc-plan.json> \ --stack <stack.json> \ --source retrofit - Re-run doctor after remediation to confirm the drift is resolved. Show the before/after delta.
6. What retrofit does NOT do
- History rewrites. Non-compliant commits are flagged, never fixed. Tell the user: "Past commits are informational only. Future commits will be validated by the hooks we just installed."
- Application scaffolding. Retrofit adds git workflow infrastructure, not app code.
- Dependency installation. It writes hook configs but won't run
npm installorpip install. Tell the user to run their package manager after retrofit.
7. Output summary
End with a compact report:
- Profile audited against.
- Drift found: N missing, N misconfigured, N non-compliant commits.
- Files created/merged (count).
- Hook phases run.
- Whether CLAUDE.md is now within budget.
- Remaining items that need manual attention (if any).
When to hand off
- "Just tell me what's wrong, don't fix it" → hand off to
doctor. - "Set up from scratch" → hand off to
bootstrap-project. - "I want a different profile" → ask which one, then re-run retrofit with the new profile.
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.

