find-dead-code

Solid

Find dead code using parallel subagent analysis and optional CLI tools, treating code only referenced from tests as dead. Use when the user asks to "find dead code", "find unused code", "find unused exports", "find unreferenced functions", "clean up dead code", or "what code is unused". Analysis-only — does not modify or delete code.

AI & Automation 314 stars 25 forks Updated today MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
83
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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: 1. Check for config files: `package.json`, `tsconfig.json`, `pyproject.toml`, `setup.py`, `Package.swift`, `.xcodeproj`, `Cargo.toml`, `go.mod`, `pom.xml`, `build.gradle` 2. Glob for source files: `**/*.ts`, `**/*.py`, `**/*.swift`, `**/*.go`, `**/*.rs`, `**/*.java` 3. Identify source roots — where production code lives (e.g., `src/`, `lib/`, `Sources/`) 4. **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. | Language | Test file patterns | |----------|-------------------| | TS/JS | `*.test.{ts,tsx,js,jsx}`, `*.spec.{ts,tsx,js,jsx}`, `__tests__/**`, `__mocks__/**`, `*.stories.{ts,tsx,js,jsx}` | | Python | `test_*.py`, `*_test.py`, `tests/**`, `test/**`, `conftest.py` | | Swift | `*Tests.swift`, `*Test.swift`, `Tests/**`, `*UITests.swift`, `XCTestCase` subclasses | | Go | `*_test.go`, `testdata/**` | | Rust | `tests/**`, `benches/**`, `#[cfg(test)]` modules (inline test modules within source files) | | Java/Kotlin | `src/test/**`, `...

Details

Author
tobihagemann
Repository
tobihagemann/turbo
Created
2 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category