dead-code-eliminator

Identify dead code candidates using static analysis and code coverage data.

1|2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill dead-code-eliminator-santosomar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-eliminator
Source: https://github.com/santosomar/general-secure-coding-agent-skills/tree/main/skills/code-quality/dead-code-eliminator
Command: npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill dead-code-eliminator-santosomar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill identifies and safely removes code that is never executed, such as unreachable branches, uncalled functions, and dead feature flags, helping to reduce codebase size and complexity.

Core Features & Use Cases

  • Identify Dead Code: Detects various classes of dead code, from syntactically unreachable code to public functions with no apparent callers.
  • Safe Removal Workflow: Guides users through a verification and deprecation process before deletion to prevent accidental removal of essential code.
  • Use Case: After migrating a feature, use this Skill to clean up the old, now-unused code paths and associated tests, improving maintainability and reducing build times.

Quick Start

Use the dead-code-eliminator skill to find and list all dead code candidates in the current project.

Frequently Asked Questions about dead-code-eliminator

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

FAQPage Schema
How do I find and remove dead code in my software project?

To find and remove dead code, this Skill uses static analysis, code coverage data, and grep to identify unreachable branches, uncalled functions, and dead feature flags. It then guides you through a verification and deprecation workflow to ensure safe removal.

What is the safest way to clean up unused functions and dead feature flags?

The safest way to clean up unused functions and dead feature flags is using a structured workflow that verifies candidates before deletion. This approach prevents accidental removal of essential code by guiding you through deprecation and verification steps.

Do I need code coverage data to identify unreachable code branches?

Yes, code coverage data is required alongside static analysis and grep to accurately identify unreachable code branches. This combination ensures comprehensive detection of dead code candidates within your software project.

Can I use this to reduce technical debt by removing uncalled public functions?

Yes, you can reduce technical debt by removing uncalled public functions. The Skill detects public functions with no apparent callers and facilitates their safe deletion, improving overall codebase maintainability and reducing complexity.

What's the best way to clean up old code paths after a feature migration?

The best way to clean up old code paths after a feature migration is to identify now-unused functions and associated tests for safe removal. This reduces codebase size, lowers technical debt, and improves build times.

When should I avoid deleting dead code candidates?

You should avoid deleting dead code candidates immediately if they might be called dynamically or through reflection. The Skill uses a verification and deprecation process precisely to prevent accidental removal of essential code during static analysis.