← ClaudeAtlas

maintenance-code-cleanup-repolisted

Full file-by-file repo cleanup — dead code, duplicated rules, doc drift, and organization — run as an audit → adversarial-verify → fix → re-verify loop that keeps the build and tests green throughout. Use for "clean up the repo", "clean up the codebase", "find dead code", "make this DRY", "the README is out of date", "reorganize this repo", or any request to remove rot without breaking behaviour. Also use before a big refactor, so the refactor starts from a repo with no dead weight in it.
skowalskidev/dotclaude · ★ 0 · AI & Automation · score 72
Install: claude install-skill skowalskidev/dotclaude
# Repo cleanup Cleanup is not a tidying pass. It is an audit that produces claims, a verification step that kills most of them, and only then a set of edits. Skipping the middle step is how a cleanup deletes something load-bearing and nobody notices for a month. ## The one rule that governs everything else **A tool reports what nothing IMPORTS. That is not the same as what nothing NEEDS.** Every finding is a hypothesis until you have personally grepped for it. This is not caution for its own sake — on the run this skill was written from, the first pass flagged nine "unused" files, and three of them were live entry points invoked by node, playwright and the Next runtime rather than by an import. Deleting on the tool's word would have removed a migration script. ## Order of work — do not reorder Config first, then measure, then audit, then verify, then fix. Each step's output is the next step's input, and doing them out of order produces confident nonsense. ### 0. Fix the config that governs the cleanup, first If the repo has its own agent instructions (`CLAUDE.md`, `.claude/rules/*.md`, `AGENTS.md`), those are the yardstick you are about to measure the code against. Check the yardstick before using it: does every path it names exist, does every count it states still hold, does every rule it states match what the code does? A cleanup driven by a stale rule file enforces last quarter's conventions. Same for `~/.claude` when the task touches it. `hooks/config-contract.te