cleanup-unused
Installation
SKILL.md
Detect unused code, exports, files, and dependencies. Auto-delete only what's verifiably dead. Write a critical assessment with confidence ratings; defer ambiguous items to the human.
Preflight
- Detect language(s) by checking for:
package.json(TS/JS),pyproject.toml/requirements.txt(Py),go.mod(Go),Cargo.toml(Rust). Skip languages not present. - Check git state. If working tree is dirty, refuse to auto-apply — ask user to stash or commit first. The verify step needs a clean baseline to revert to.
- Create report dir:
mkdir -p .claude/cleanup-reports/. Add.claude/cleanup-reports/to.gitignoreif not already present. - Scan for dynamic-import patterns that defeat static analysis. Save the list — findings in these areas drop to MEDIUM confidence.
- JS/TS:
import(,require(,eval(,Function(,__webpack_require__, dynamic route file conventions (pages/,app/) - Python:
__import__,importlib,getattr, plugin entry-points insetup.py/pyproject.toml - Go:
reflect., plugin loader, build tags - Rust:
cfg(feature = ...)gates, proc-macros,extern crate
- JS/TS:
Detect
Run the right tool per language. Install on demand only after asking.