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 377 stars 29 forks Updated today MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
86
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. 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: 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`, ...

Details

Author
tobihagemann
Repository
tobihagemann/turbo
Created
4 months ago
Last Updated
today
Language
Shell
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Solid

dead-code-expert

This skill should be used when the user wants to find, audit, or remove dead code, unused imports, unused functions, unused variables, duplicate implementations, parallel/split-brain implementations across architectural boundaries, dead assets/configuration/infrastructure, or simplify a codebase. Works across all programming languages and stacks (SwiftUI, Rust, TypeScript/React, .NET, Python, C++, Go, Java). Relevant when the user says "find dead code", "remove dead code", "remove unused imports", "find duplicate code", "split brain", "parallel implementations", "client server validation drift", "dead config", "orphan assets", "unused environment variables", "simplify this codebase", "find unused functions", "find unused code", "remove commented out code", "what code is unused", "find orphaned files", "detect duplicate implementations", "find unreachable code", "clean up this codebase", or "audit for unused code".

11 Updated today
johnkozaris
AI & Automation Listed

dead-code-finder

Find genuinely unused code — unreferenced exports, unreachable files, and unused dependencies — and remove it safely with build/test verification. Use when trimming a codebase or untangling years of accreted cruft.

1 Updated 1 weeks ago
imtiazrayhan
AI & Automation Solid

ide-dead-code-hunter

Find unused exports, dead functions, and unreachable code across the workspace using LSP analysis. Cross-verifies detectUnusedCode with findReferences to eliminate false positives. Use to clean up technical debt or before a major refactor.

29 Updated 3 days ago
Oolab-labs