pre-merge-audit

Installation
SKILL.md

Pre-Merge Audit

Three tiers by authority:

  1. Pre-commit pass (automatic, every commit) — clean the staged diff. May edit, but only within code the current change adds or modifies.
  2. 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.
  3. 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.

  1. 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.
  2. 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.
  3. Run the smallest targeted checks covering the change (typecheck, lint, touched tests).
  4. Report what was cleaned — files/contracts removed, net reduction, check failures; the user still owns the commit itself.
Installs
10
First Seen
Aug 27, 2026