dead-code-eliminator
Installation
SKILL.md
Dead Code Eliminator
Dead code is code that cannot execute under any input. It's not "rarely used" — it's never reachable. The distinction matters: deleting rarely-used code is a product decision; deleting dead code is housekeeping.
Deadness classes — from certain to uncertain
| Class | How to prove dead | Confidence |
|---|---|---|
Code after return/throw/exit |
Syntactic — compiler/linter catches this | Certain |
| Private function, zero callers | Grep the module. Private = no external callers possible. | Certain |
| Branch with constant-false condition | if False:, if (1 == 2). Constant folding. |
Certain |
| Public function, zero callers in repo | Grep. But: reflection, plugins, DI, external callers? | Uncertain — see below |
| Feature flag hard-wired off | if config.NEW_CHECKOUT: and the flag is False everywhere, permanently |
High (check all envs first) |
else branch of exhaustive match |
All enum values covered above; else can't fire |
High (until someone adds an enum value) |
| Zero coverage in tests | Covered-by-nobody. But tests don't cover everything users hit. | Low — absence of test ≠ absence of use |
The public-symbol problem
Static analysis says doThing() has zero callers. Before deleting, check: