dead-code-eliminator

Identifies and analyzes unused code in Python projects via AST, producing markdown reports.

142|14|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill dead-code-eliminator-arabelatso
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-eliminator
Source: https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/dead-code-eliminator
Command: npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill dead-code-eliminator-arabelatso

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you identify and remove unused or redundant code from your Python projects, leading to cleaner, more maintainable, and efficient software.

Core Features & Use Cases

  • Unused Code Detection: Finds unused functions, methods, variables, and imports.
  • Unreachable Code Analysis: Identifies code blocks that can never be executed.
  • Redundancy Identification: Flags duplicate logic and unnecessary conditional statements.
  • Use Case: After a large refactoring effort, use this Skill to quickly scan the codebase and ensure no leftover, dead code remains, preventing future confusion and potential bugs.

Quick Start

Run the dead code eliminator skill on the '/path/to/your/project' directory to find and report all unused code.

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 unused functions and variables in a Python project?

To find unused functions and variables in a Python project, you can run an AST-based code analysis tool that scans directories and generates markdown reports listing unused code with line numbers and severity ratings.

What is the best way to detect unreachable code blocks in Python?

The best way to detect unreachable code blocks is to perform AST analysis on your Python source files, which identifies redundant logic and conditional statements that can never execute during runtime.

Can I identify unused imports in Python automatically?

Yes, you can identify unused imports automatically by triggering a dead code scan that parses Python files and flags any imported modules or names that are not referenced elsewhere in the codebase.

Does dead code analysis work for cleaning up code after a large refactoring effort?

Dead code analysis works effectively for cleaning up after a large refactoring effort by scanning the codebase to ensure no leftover redundant functions, methods, or variables remain, preventing future confusion.

How does AST analysis help find redundant logic in Python?

AST analysis helps find redundant logic by parsing Python code into an abstract syntax tree, tracking function and variable usage across files, and identifying unreachable blocks and unnecessary statements.

What does a dead code report include?

A dead code report includes markdown documentation of unused code findings, complete with line numbers, severity ratings, and specific recommendations for removing or refactoring the flagged elements.