# Pre-push repo hygiene audit Use this checklist when auditing one or more GitHub-connected project repos for clutter before/after a batch of dispatched-worker commits, or whenever a user asks to check "what shouldn't be on GitHub." ## 1. Find large tracked files ``` git ls-files -z | xargs -0 du -h 2>/dev/null | sort -rh | head -15 ``` Anything in the multi-MB range deserves a look: is it a real shipped asset (app icon, bundled voice sample) or a leftover QA/exploration artifact? ## 2. Find stray root-level docs ``` git ls-files | grep -E '\.md$' ``` Dot-prefixed files (`.{role}-task-*.md`, e.g. `.-task-*.md`, `.-task-*.md`) are near-certainly a dispatched worker's own scratch notes, not project documentation — see the orthogonal rule in SKILL.md. Files literally named with an iteration/trash marker (`-v2`, `-v3-cop`, `-fix`, `-devam`) are the same pattern. ## 3. Before deleting any asset, confirm it is actually unreferenced ``` grep -rl "" README.md docs/*.md src/ 2>/dev/null ``` No hits across docs/README/source = safe to remove. A hit means it's a real dependency (e.g. referenced in a build workflow or doc) even if it looks like clutter by name alone. ## 4. Find old-name / personal-path leakage in committed text ``` grep -rln "\|" --include="*.md" . ``` Distinguish files that are LEGITIMATELY about a rename (a `docs/-to--rename/RAPOR.md` mentioning the old name on purpose) from incidental leakage (a QA report's file-path dump that happens to include the operator's home directory). Only the latter needs scrubbing; don't blank out a rename's own history doc. ## 5. Detect accidentally tracked build output / dependency trees ``` git ls-files | grep -c '^node_modules/' # or vendor/, build/, dist/, .venv/ ``` Any non-zero count: `git rm -r --cached --quiet`, add the dir to `.gitignore`, commit, push. These should never be tracked regardless of size. ## 6. Confirm whether a repo has ever actually been pushed ``` git ls-remote origin # empty output = nothing on the remote yet git pull origin main --quiet # "couldn't find remote ref main" = same signal ``` Either signal means local history (including any clutter in earlier local commits) has never reached GitHub — clean the working tree, commit, and the first-ever push goes up already clean. No history-rewrite is needed in this case since nothing was ever public. ## 7. Verify a cleanup push actually landed ``` git fetch origin --quiet git ls-tree -r origin/main --name-only | grep -c '^node_modules/' # expect 0 ``` Check the REMOTE tree, not just local `git log`, to prove the removal is live. ## 8. When several candidate assets exist and none is clearly "the chosen one" If a build script, packaging workflow, or doc doesn't unambiguously name which variant among several (e.g. 4 icon-concept folders from an exploration phase) is actually shipped, do NOT guess and delete the "losers" — deleting the wrong one silently breaks packaging. Leave all variants in place and surface the ambiguity to the user instead of resolving it yourself. ## Scope note This is a HEAD-only cleanup (`git rm --cached` + `.gitignore` + commit). It does not purge the removed content from earlier commits' history — that needs `git filter-repo`/BFG, a much heavier operation that rewrites commit hashes. Only reach for that if the user explicitly asks for full history removal.