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.
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.
Test File Patterns
Establish which files are test files. Code referenced ONLY from these locations is dead.