reducing-entropy
Reducing Entropy
Auto-activates on: code review, refactor requests, cleanup requests, "remove dead code", "this is getting messy"
Prefer a tooled sweep over an eyeball sweep — for a codebase-wide dead-code/duplication pass, drive it from a static-analysis inventory (fallow or equivalent), adversarially verify every liveness claim before deleting, and hand the result to whatever tracker you use. This skill is the CONTRACT such a sweep grades against, and stays directly loadable for targeted cleanup within an active change.
Use fallow for the heavy lifting
The grep-based heuristics below were written when fallow (Rust-native AST analyzer) was not available. When fallow is in the toolbelt, prefer it for all dead-code detection — it's type-aware, handles barrel re-exports, resolves dynamic imports more accurately than grep, and emits structured JSON with actions arrays. The patterns in this skill remain valid as a mental model and grep fallback when fallow is not installed.
Trade-off: fallow requires pnpm exec fallow (or a global install) and is JS/TS only. For non-T3 repos or one-off greps the patterns below still apply.
# Replace most of the patterns below with one call
pnpm exec fallow dead-code --format json --quiet || true