find-dead-code
Installation
SKILL.md
Find Dead Code
Identify dead code in a codebase. Core rule: code only used in tests is still dead code. Only production usage counts.
In an incomplete or abandoned implementation, a declared-but-unused symbol may be intended-but-not-yet-used. When git history shows it was added as a deliberate part of an unfinished stack, recommend investigate rather than delete.
Step 1: Detect Languages, Scope & Test Boundaries
Determine the project structure:
- Check for config files:
package.json,tsconfig.json,pyproject.toml,setup.py,Package.swift,.xcodeproj,Cargo.toml,go.mod,pom.xml,build.gradle - Glob for source files:
**/*.ts,**/*.py,**/*.swift,**/*.go,**/*.rs,**/*.java - Identify source roots — where production code lives (e.g.,
src/,lib/,Sources/) - Partition the codebase into analysis units by top-level source directories (e.g.,
src/auth/,src/api/,src/utils/,lib/models/). Each directory becomes one subagent's scope in Step 3.
If the user specified a scope, restrict analysis to that scope.