cleanup-unused

Solid

Detect and delete unused code, exports, files, and dependencies. Runs knip/vulture/staticcheck/cargo-machete appropriate to the language, writes a critical assessment, and auto-applies HIGH-confidence deletions. Use when the user asks to remove dead code, find unused exports, clean up dependencies, or run dead-code analysis. Example queries — "find dead code", "what's unused in this repo", "are there unused npm deps", "kill the cruft".

AI & Automation 78 stars 9 forks Updated today MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
63
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

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 1. **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. 2. **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. 3. **Create report dir**: `mkdir -p .claude/cleanup-reports/`. Add `.claude/cleanup-reports/` to `.gitignore` if not already present. 4. **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 in `setup.py`/`pyproject.toml` - Go: `reflect.`, plugin loader, build tags - Rust: `cfg(feature = ...)` gates, proc-macros, `extern crate` ## Detect Run the right tool per language. Install on demand only after asking. ### TypeScript / JavaScript ```bash # Knip is the gold standard. Most TS/JS repos already have it wired up. bunx knip --reporter json > /tmp/knip.json 2>/dev/null || npx knip --reporter json > /tmp/knip.json ``` Parse `files`, `exports`, `types`, `dependencies`, `devD...

Details

Author
raintree-technology
Repository
raintree-technology/agent-starter
Created
7 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category