repo-hygiene
Skill1 starsChanged 4 months agoMITView on GitHub
Clean up proven-junk stray files that accumulate in a repo (Git-Bash heredoc-splitting artifacts, empty scratch dirs) once real work is safely committed, flag (never silently delete) regenerable build caches like target/ or node_modules/, and default every newly created repo to private. Use when the user mentions disk bloat, 'clean up old files', 'useless files', a messy `git status`, or when about to create a new GitHub/git repo.
- Installs packages
15 other projects use a version of this, 1 of them edited.
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
- Donemeb/Donemeb-Skillstheir own version, first seen Oct 13, 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 · 1
- SamuelNDCE/claude-super-skill-library★ 1100% same
Wrote their own version · 14
- 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
- arndvs/ctrlshft★ 0same name
4 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 repository25 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- braindump-autoSkill
- braindumpSkill
- Capability Claim GroundingSkill
- Derived Figure AuditSkill
- design-review-loopSkill
- Dictation Garble CatcherSkill
- Discord Todo OpsSkill
- Full Account Security AuditSkill
- Large Task Session SplitSkill
- Personal Dashboard StyleSkill
- Pre-Push Secret ScanSkill
- Project Design DocSkill
- Public Repo Leak RetractionSkill
- Repo Index Drift CheckSkill
- Safe Section DeletionSkill
- Session HandoffSkill
- Skill Overlap AuditSkill
- superbraindumpSkill
- ui-change-visual-verifySkill
- Verify, Don't TrustSkill
- Windows Process Restart (Safe)Skill
- Windows Shell Tool SelectionSkill
- Worktree Task-Pack VerificationSkill
- Zombie Process SweepSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 14 edited versions we read keep these.
3
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 11
New repos are private by default: Never create a public repo unless the user explicitly says so.
- Distinctive: line 12
Clean up proven junk, never guess at junk: Only auto-delete files that are *provably* garbage (exact known bug signature).
- Very specific: line 18
When creating a repo via gh repo create, mcp__github__create_repository, or any equivalent:
- Very specific: line 19
Always pass --private / private: true unless the user has explicitly said "public" or "open source" for that specific repo.
- Distinctive: line 56
Only flag a candidate when the corresponding source directory is confirmed already committed (git status clean for the source files it 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: Stray-File Cleanup & Private-by-Default
Overview
Two standing rules:
- New repos are private by default. Never create a public repo unless the user explicitly says so.
- Clean up proven junk, never guess at junk. Only auto-delete files that are provably garbage (exact known bug signature). Everything else (regenerable caches, anything with real content) gets flagged with a size/count for the user to decide, never deleted automatically.
This skill exists because of a recurring problem in a large multi-project agent repo: 315 untracked garbage-named files had piled up from a known Git-Bash bug (see Rule 2), and separately a Rust target/ build cache alone was eating 4.76GB. See wiki/Mistakes & Fixes/2026-07-11-repo-hygiene-stray-file-sweep.md.
Rule 1: New repos default to private
When creating a repo via gh repo create, mcp__github__create_repository, or any equivalent:
- Always pass
--private/private: trueunless the user has explicitly said "public" or "open source" for that specific repo. - Flipping an existing repo from private → public is a visibility/access-control change: per the global safety rules this needs explicit user confirmation in chat every time. It is never inferred from a prior approval.
Rule 2: Stray-file cleanup, safe detection only
The bug: passing multi-line strings to node -e (or even running a normal .js/.py/.rs file) through Git Bash on Windows can silently mangle a fragment of the script into a literal file on disk, e.g. a script containing !ids.has(e.source) creates an actual empty file named !ids.has(e.source). The real script still runs correctly, so this goes unnoticed unless git status is checked. See wiki/Mistakes & Fixes/2026-07-04-node-e-multiline-creates-stray-files-gitbash.md.
Detection algorithm, both conditions must hold before deleting anything:
- File is exactly 0 bytes (or, for a directory, recursively empty).
- Name is unambiguously a code fragment: starts with punctuation like
!,(,{,,,$,', backtick, or contains unbalanced brackets/parens, or is a truncated expression (.slice(0,.md\)`, etc.), not a plausible intentional filename.
$root = "<repo root>"
$strays = git -C $root status --porcelain=v1 -uall | Where-Object {$_ -match '^\?\? '} | ForEach-Object { $_.Substring(3) }
$zeroFiles=@(); $skip=@()
foreach ($f in $strays) {
$p = Join-Path $root $f
if ((Test-Path -LiteralPath $p -PathType Leaf) -and ((Get-Item -LiteralPath $p -Force).Length -eq 0)) {
$zeroFiles += $f
} else {
$skip += $f # anything with content, or that doesn't match the bug signature, never touch
}
}Never auto-delete:
- Anything with nonzero size, even if untracked/uncommitted (could be a real one-off script, a generated deliverable, vendored library, or work in progress).
- Anything with a plausible real filename, even if 0 bytes (could be an intentionally-created placeholder).
Always report what was skipped (count + list) so the user can decide: commit it, or delete it themselves.
When to run this: at the end of a task/session that used node -e, multiline heredocs, or any script execution through this Bash tool, and before committing. Also whenever the user mentions "clean up", "useless files", or disk bloat.
Rule 3: Regenerable build caches, flag only, ask before deleting
Folders like target/ (Rust), node_modules/, .venv/, dist/, build/, __pycache__/ are the actual source of large disk usage (a single target/ dir hit 4.76GB in this workspace), but they are never auto-deleted:
- Regenerating them costs real time/bandwidth (
cargo build,npm install,pip install), so silent deletion is disruptive even when "safe." - Only flag a candidate when the corresponding source directory is confirmed already committed (
git statusclean for the source files it was built from). Deleting a cache next to uncommitted source risks looking like data loss even though the cache itself holds no unique data. - Report folder + size, and ask before running
Remove-Item -Recurse -Forceor equivalent. This is a destructive, hard-to-reverse-in-the-moment action (re-fetching everything takes time) even though no unique data is lost.
Get-ChildItem -Path <root> -Directory -Recurse -Depth 2 -Force -ErrorAction SilentlyContinue |
Where-Object { $_.Name -in @('target','node_modules','.venv','dist','build','__pycache__') } |
ForEach-Object {
$size = (Get-ChildItem $_.FullName -Recurse -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum
[PSCustomObject]@{Path=$_.FullName; SizeGB=[math]::Round($size/1GB,2)}
} | Sort-Object SizeGB -DescendingWhy not a broader heuristic sweep
Per wiki/Mistakes & Fixes/2026-07-11-dead-parent-heuristic-kills-live-processes.md: never build an automated cleanup/killer tool around a system-wide heuristic unless the signal has zero false positives. A "delete anything old" or "delete anything that looks unused" scan is exactly that trap. This skill only ever acts on the exact, proven-safe zero-byte + code-fragment-name signature, and only ever flags everything else.
Related: git-workflow
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.

