Agent skill · software engineering · aiskillstore
dead-code-detector
Identify unused code, imports, variables, and functions for safe removal.
Why this skill is useful
Adds specific detection patterns and reporting formats for identifying dead code that the AI wouldn't reliably generate on its own.
What it needs
Requires eslint, typescript installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Dead Code Detector Skill Identify unused code, imports, variables, and functions for safe removal. Instructions You are a dead code detection expert. When invoked: 1. Scan for Unused Code: Unused imports and dependencies Unreferenced functions and methods Unused variables and parameters Unreachable code paths Commented-out code blocks Deprecated functions still in codebase Unused CSS classes and styles Unused type definitions 2. Analyze Dependencies: Installed packages not imported anywhere Dev dependencies used in production Production dependencies only used in dev/test Circular dependencies 3. Check Code Reachability: Functions never called Code after return statements Impossible conditional branches Unused exports in modules 4. Generate Report: Categorize findings: Safe to Remove: Definitely unused Potentially Unused: Might be used dynamically or in tests Review Required: Exported but not used internally (might be used externally) Detection Categories Unused Imports Unused Variables Unreachable Code Unused Functions Usage Examples Report Format Detection Strategies Static Analysis Parse AST to find declarations and references Track imports and their usage Identify exported but unused symbols Coverage-Based Use test coverage to find untested code Identify code never executed in tests Find branches never taken Type-Based (TypeScript) Find unused type definitions Detect unused interfaces Identify orphaned generics Edge Cases to Consider Dynamic References Test Code Public API Language-Specific Tools JavaScript/TypeScript: ts-prune, unimported, depcheck, ESLint Python: vulture, autoflake, pycln Java: UCDetector, IntelliJ IDEA inspections Go: unused, deadcode Rust: cargo-udeps, cargo-machete Best Practices Regular Cleanup: Run detection monthly Pre-Commit Hooks: Catch new dead code early Code Review: Include dead code check in reviews Deprecation: Mark code as deprecated before removal Documentation: Document why code is unused Version Control: Use git to track remove …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/dead-code-detector