repo-hygiene
Skill0 starsChanged 3 months agoMITView on GitHub
Version control hygiene — identify and clean content that shouldn't be in the repo: third-party source, decompiled/generated artifacts, nested repos, local config files, large binaries, secrets. Quarantine before commit. Covers the 'tracked vs untracked ignore' gotcha. Use when the user says 'about to commit', 'why isn't gitignore working', 'repo has large files / third-party code / submodules', 'confirm clean before new dev'.
- Reads credentials
15 other projects use a version of this.
Adopted by
Most recently taken up by
- Smaui94/ClaudeSkillCollectiontheir own version, first seen Nov 8, 2026
- robinbril/claude-code-harnesstheir own version, first seen Nov 1, 2026
- yunsii/wezdecktheir own version, first seen Oct 25, 2026
- arndvs/ctrlshfttheir own version, first seen Oct 15, 2026
- talas9/anti-halltheir own version, first seen Oct 13, 2026
- baseballyama/rsveltetheir own version, first seen Oct 9, 2026
Used with
Projects with it also use systematic-debugging.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- baseballyama/rsvelte★ 249same name
- marcfargas/skills★ 4same name
- marcoguillermaz/Tierward★ 4same name
- yunsii/wezdeck★ 4same name
- robinbril/claude-code-harness★ 3same name
- rikvanriel/code-hygiene★ 2same name
- talas9/anti-hall★ 2same name
- Asher-Plihal/claude-skills★ 1same name
- jedarden/jeds-curated-skills★ 1same name
- SamuelNDCE/ai-workbench★ 1same name
5 more not listed
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 repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skill-recapSkill
- comm-link-debuggingSkill
- deep-comparison-analysisSkill
- industry-practice-surveySkill
- tech-selection-convergenceSkill
- dev-recap-docsSkill
- guide-and-manualSkill
- readme-syncSkill
- change-recapSkill
- code-reviewSkill
- error-handlingSkill
- legacy-code-dispositionSkill
- phase-trackingSkill
- workspace-consistencySkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Before starting new dev, confirm the repo is clean.
- Very specific: line 58
Use trailing slash path/ for directories, no trailing slash for files.
- Distinctive: line 75
No untracked files waiting to be added (except local references).
- Very specific: line 87
After adding ignore rules, the decompiled directory still showed up → ls-files revealed it was already tracked (~14,000 files) → ignore was …
“Common” is measured: kept by at least 6 in 10 of the 14 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
repo-hygiene — Version Control Hygiene
When to use
- About to commit and want to confirm nothing improper slipped in.
- "gitignore rule added but it's not working".
- Found third-party code / decompiled artifacts / nested repos / large files / secrets / personal local config in the repo.
- Before starting new dev, confirm the repo is clean.
When NOT to use
- Active feature work — this is end-of-work cleanup, not in-flight changes.
- Pure formatting / linting issues — use the appropriate tools.
Output
A clean repo: no improperly committed content, reasonable commit granularity, ignore rules working correctly.
The core gotcha (memorize this first)
Ignore rules only affect untracked files. Adding ignore to an already-tracked file has no effect — you must first remove it from tracking (keeping the local copy) and then add ignore.
This is the most common cause of "gitignore not working": the file was committed long ago, and a rule added after the fact cannot block a file already tracked.
Methodology
1. Identify content types that should not be in the repo
| Type | Identification |
| Third-party / decompiled / generated artifacts | Someone else's code, decompiled output, build output (usually large) |
| Nested repos | Directory contains its own VCS metadata, committed as a gitlink (mode 160000) |
| Personal local config | .local suffix, machine-specific paths, personal keys |
| Large binaries | Images / archives / data packs / models |
| Secret credentials | .env / *.key / tokens |
2. Layered verification tools (use as needed)
status— change overview.check-ignore <path>— whether the path is blocked by some ignore rule (no output = not blocked).ls-files <path>— whether the path is already tracked (output = tracked, ignore has no effect on it).status -uall— expand collapsed untracked directories (regularstatuscollapses directories containing non-ASCII paths or all-untracked content).
To judge whether adding ignore will help: first run
ls-filesto see if the file is tracked. Tracked → ignore won't work, go to step 4 to remove from tracking. Untracked → ignore works directly.
3. Inspect the ignore rules themselves
- Wrong path syntax (extra prefix characters, wrong case, wrong slash direction) — incorrect rules fail silently.
- Use trailing slash
path/for directories, no trailing slash for files.
4. Disposition
| Situation | Action |
| Tracked file that should not be in repo | Remove from tracking (keep local) + add ignore: git rm --cached -r <path> then commit |
| Untracked file | Just add ignore |
| Nested repo (gitlink) | First identify (mode 160000 + no modules config = dangling gitlink), then choose one: ① ignore (local reference) ② convert to a proper submodule ③ remove inner VCS and commit as ordinary files |
5. Commit granularity
Code / docs / config / cleanup go in separate commits so history is clear and each can be reverted independently. Avoid one giant commit mixing all types.
6. Pre-dev cleanliness check
- Working tree clean (no uncommitted changes).
- No untracked files waiting to be added (except local references).
- No dangling gitlinks.
- Ignore rules correct (improperly committed content removed from tracking).
Red lines (reasoned, not absolute)
- Do not run
git add .(stage everything) without checking first — it sweeps improperly committed content (especially large files / third-party code) into the commit. - Do not just add ignore without removing from tracking — for already-tracked files, ignore alone has no effect (the core gotcha).
- Do not physically delete local files for cleanup — use "remove from tracking, keep local" (
git rm --cached), not actual deletion.
Worked example: one repo slim-down (sanitized)
- After adding ignore rules, the decompiled directory still showed up →
ls-filesrevealed it was already tracked (~14,000 files) → ignore was ineffective. - The original ignore rule had an extra character in the path prefix causing silent failure → fixed the rule.
- A nested repo (peer code cloned in) was committed as a dangling gitlink → removed from tracking + ignore (kept local as reference).
- Personal local permission config (
.local) kept changing → removed from tracking + ignore. - Split into multiple commits: code / docs / cleanup separated.
This is one instance, not the methodology itself.
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.

