repo-janitor
Use BEFORE committing and whenever tidying the repo — removes regenerable build/scan artifacts (dist/, coverage.out, sbom.cdx.json, junit.xml, binaries) and prevents them from being committed. Pairs w
SKILL.md.claude/skills/repo-janitor/SKILL.md
GitHubRepo Janitor
Goal: keep regenerable artifacts out of the repo. Two layers:
- Deterministic, pre-commit —
mise run clean:check(scripts/clean-artifacts.sh --check) runs FIRST in the gitpre-commithook: it removes known untracked artifacts from the worktree, then BLOCKS the commit if any staged file is a build/scan artifact. - AI review (this skill) — before you (Claude)
git commit, the PreToolUse hook injects this checklist so you double-check that nothing regenerable or stray is being committed.
What counts as a removable / never-commit artifact
- Build output:
dist/, theunpixelbinary,*.exe,*.test - Test/scan output:
coverage.out/coverage.*,junit.xml,sbom.cdx.json,*.out - Editor/OS junk:
.DS_Store, swap files - Local-only config that slipped in:
mise.local.toml,.env*
All of these are gitignored and regenerated by mise run …; they must never be tracked.
How to act
- Before committing, run
mise run clean(full clean) or let the pre-commit gate auto-tidy. - If the gate blocks a staged artifact:
git restore --staged <file>, confirm it is in.gitignore, and re-commit. - If a NEW kind of generated file appears, add it to
.gitignoreAND to theartifacts/glob_artifactslists inscripts/clean-artifacts.shso the janitor knows about it. - Never delete tracked source — the script only removes untracked paths.
Notes
- The janitor only deletes paths git does not track, so it is safe.
- Tasks:
mise run clean(full),mise run clean:check(gate behavior).