code-quality-plugin/skills/code-dead-code/SKILL.md
Detect dead code, unused exports, unreachable branches, and orphaned files. Use when reducing maintenance burden, cleaning up after refactors, or auditing codebase health.
npx skillsauth add laurigates/claude-plugins code-dead-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect and report dead code across languages.
| Use this skill when... | Use something else when... | |---|---| | Cleaning up after a major refactor | Setting up dead code tooling → /configure:dead-code | | Auditing codebase for unused exports | Looking for duplicated code → /code:dry-consolidation | | Reducing bundle size by removing dead code | Looking for anti-patterns → /code:antipatterns | | Pre-merge cleanup of feature branches | Need full code review → /code:review |
find . -maxdepth 1 \( -name "package.json" -o -name "pyproject.toml" -o -name "Cargo.toml" \) -type ffind . -maxdepth 1 \( -name "knip.json" -o -name "knip.jsonc" -o -name ".knip.json" \) -type f$1: Path to scan (defaults to current directory)--tool: Force specific tool (knip, vulture, machete)--fix: Automatically remove detected dead code where safeExecute this dead code detection workflow:
Check which languages are present and which dead code tools are available:
If no tool is available, report which tool to install and suggest /configure:dead-code to set up the project.
JavaScript/TypeScript (Knip):
npx knip --reporter compact
If Knip is not configured:
npx knip --reporter compact --include files,exports,dependencies
Python (Vulture):
vulture ${1:-.} --min-confidence 80
Rust (cargo-machete):
cargo machete
Group results by severity:
| Category | Severity | Action | |---|---|---| | Unused dependencies | High | Remove from package manifest | | Unused exports | Medium | Remove export, check downstream | | Unused files | Medium | Delete after confirming no dynamic imports | | Unused variables/functions | Low | Remove if truly dead |
If --fix flag is set:
If --fix is not set, present a summary report with actionable items.
Print summary:
Dead Code Report
================
Unused files: N
Unused exports: N
Unused dependencies: N
Total dead code: N items
Top items to remove:
- [file:export] reason
npm prune or equivalent/configure:dead-code/test:run| Context | Command |
|---|---|
| Quick JS/TS scan | npx knip --reporter compact --include files,exports |
| Python scan | vulture . --min-confidence 80 |
| Rust scan | cargo machete |
| CI mode | npx knip --reporter json |
| Exports only | npx knip --include exports --reporter compact |
tools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.