remove-deadcode
Installation
SKILL.md
Remove Dead Code
Delete code that is provably unreferenced — without breaking anything. The rule
is simple: prove it's dead before you delete it. A confident-looking unused
symbol is often reached through a barrel export, a test, reflection, or a
framework entry point. Verify first. For behavior-preserving complexity
reduction (simplify without deleting), use the simplify skill.
Phase 1: Scan (parallel)
Fire independent detectors at once and collect candidates:
- Compiler / linter unused flags — e.g. TypeScript
tsc --noUnusedLocals --noUnusedParameters, ESLintno-unused-vars, Godeadcode/staticcheck, Pythonvulture, Rustcargo +nightly udeps/ dead-code warnings. - Orphaned files — source files not imported by any other file.
- Unused exports — exported symbols never imported elsewhere.
- LSP references — "find all references" returning only the definition.