dead-code-detector

Detects and categorizes unused code, imports, and dependencies in six programming languages.

27|4|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/CuriousLearner/devkit --skill dead-code-detector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-detector
Source: https://github.com/CuriousLearner/devkit/tree/main/skills/dead-code-detector
Command: npx skills add https://github.com/CuriousLearner/devkit --skill dead-code-detector

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify and remove dead code, unused imports, variables, and functions, leading to cleaner, more efficient, and smaller codebases.

Core Features & Use Cases

  • Unused Code Identification: Detects unreferenced functions, variables, and unreachable code paths.
  • Dependency Analysis: Flags unused imports and packages, including those misclassified between production and dev dependencies.
  • Use Case: After a large refactor, run this skill to ensure no leftover code or dependencies are bloating your application.

Quick Start

Run the dead-code-detector skill on the entire project to find all unused code.

Frequently Asked Questions about dead-code-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find unused code and dependencies in my codebase?

To find unused code, you can run an automated detector that analyzes code reachability and flags unreferenced variables, functions, and imports. It categorizes findings into 'Safe to Remove', 'Potentially Unused', and 'Review Required' to guide safe cleanup.

Does dead code detection work with TypeScript and Python projects?

Yes, dead code detection supports static, coverage-based, and type-based strategies across multiple languages. It is fully compatible with JavaScript, TypeScript, Python, Java, Go, and Rust codebases.

What is the best way to clean up unused imports after a large refactor?

The best way to clean up unused imports after a refactor is to run dependency analysis. This detects unreferenced packages and flags misclassified production or development dependencies to prevent codebase bloat.

How does code reachability analysis identify unreachable code paths?

Code reachability analysis identifies unreachable paths by tracking variable usage and function references throughout the project. It uses static, coverage-based, and type-based detection strategies to determine which code segments are never executed.

Can I automatically remove unused variables flagged as safe to delete?

While the detector categorizes findings into 'Safe to Remove', 'Potentially Unused', and 'Review Required', it primarily reports unused code rather than automatically deleting it. You should manually review and remove the flagged variables to ensure application stability.