pre-merge-audit
Installation
SKILL.md
Pre-Merge Audit
Three tiers by authority:
- Pre-commit pass (automatic, every commit) — clean the staged diff. May edit, but only within code the current change adds or modifies.
- Deep cleanup (explicit edit intent) — proven cuts anywhere in scope, applied end to end per references/cleanup.md, with structural targets from references/structure.md and concurrency/lifecycle protections from references/lifecycle-and-races.md.
- Survey (read-only) — investigate, rank, report; never edit. Same proof standards, and a report with zero safe candidates is a valid outcome.
Measure twice, cut once — and never force a deletion to look productive. Zero cuts is a valid outcome in every tier.
Pre-commit pass
Mandatory before EVERY commit, push, merge, or PR submission — even when nobody asks, and even for trivial or single-file changes. Only formatting-only changes may skip.
- Tidy the staged diff: remove dead code the diff introduces, obvious duplication within it, leftover debris (commented-out code, unused imports/variables, debug output), and structural bloat the diff adds (thin wrappers, needless indirection, one-off flags tangling existing flow). House compliance markers (
// ... guideline compliant ...) are contracts, not debris. - Cut only what the diff itself added or modified, and only with proof: no production consumers, unreachable, no behavior contract touched. Anything reaching beyond the diff is deep cleanup, not this pass.
- Run the smallest targeted checks covering the change (typecheck, lint, touched tests).
- Report what was cleaned — files/contracts removed, net reduction, check failures; the user still owns the commit itself.