SuperAPI AI Directory

nuke-sweep

Coding & development

View repository

Updated 10-15 17:23

About this skill

Nuke Sweep

A small helper: 0 agents, in-session, no artifacts. nuke-lean's self-sweep unbundled — runnable over any diff at any moment, not just after a lean-chartered task. Scope is the changed lines and what they touch, never the whole repo: repo-wide hunting is nuke-audit's job; the sweep judges only what this session (or a cheaper model before it) just added.

The sweep list — delete what fails, line by line

Walk the diff (git diff, re-read from disk — never from memory) hunting:

  1. Narrating comments — restating the code below them, or talking to the reviewer ("added X to fix Y"). A comment survives only by stating a constraint the code cannot.
  2. Defensive noise — null checks on values just produced, try/catch with no recovery action, re-validation of already-validated data (nuke-lean rules 2–4 applied to the diff).
  3. Speculative additions — options with one value, helpers with one caller, exports nothing imports (grep to confirm before deleting).
  4. Debug leftovers — print/console/log lines added for this task, probes, temp files, commented-out attempts.
  5. AI-voice naming — enhanced/robust/improved/comprehensive/graceful identifiers renamed to what the thing does.
  6. Type escapes introduced by the diff — the language's vocabulary per references/stack-adapters.md table B; fix the type or justify the escape in one comment, never leave it bare.

Deletion discipline: grep before deleting anything referenced elsewhere; behavior is never changed — a sweep edit that would alter behavior is out of scope and reported instead.

Hand-back

One block, always:

sweep: 4 deletions, 1 rename
- retry.ts:12 — comment restated the call below it
- retry.ts:30-38 — try/catch, no recovery path
- api.ts:7 — console.log leftover
- utils.ts:44 — helper with one caller, inlined
- fetchDataRobustly → fetchWithRetry
gates: pnpm test → 31 passed (unchanged)

or sweep: clean. Run the narrowest matching gate after a sweep with deletions — a sweep that broke the build is worse than no sweep; the gate line is part of the contract.

When NOT to apply

  • The diff is a ceremony's output mid-run — its own validator owns cleanup.
  • Repo-wide slop hunting → nuke-audit (slop lens), not a sweep.
  • Style opinions about unchanged code — the sweep never touches lines the diff did not.