Skip to content
Back to skills

Dead Code Eliminator

ASecurity

Identify and safely remove dead, unused, and unreachable code from codebases

  • 1,760 stars
  • 0 votes
  • 3 copies
  • 5 views
  • Added September 2, 2026
ai-agentsjavascripttypescriptpythonrustgojavabashrefactoringbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add a5c-ai/babysitter --skill dead-code-eliminator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dead Code Eliminator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dead Code Eliminator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a5c-ai-dead-code-eliminator-babysitter/badge)](https://www.skillsdirectory.com/skills/a5c-ai-dead-code-eliminator-babysitter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dead-code-eliminator
description: Identify and safely remove dead, unused, and unreachable code from codebases
allowed-tools: ["Bash", "Read", "Write", "Grep", "Glob", "Edit"]
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:code-migration-modernization]
  skillAreas: [skill-area:dead-code-elimination, skill-area:code-analysis-linting]
  roles: [role:backend-engineer, role:refactor-bot]
  workflows: [workflow:technical-debt-reduction]
  topics: [topic:refactoring]
---

# Dead Code Eliminator Skill

Identifies and safely removes dead code, unused functions, unreachable code paths, and orphaned files from codebases to reduce complexity and maintenance burden.

## Purpose

Enable safe dead code removal for:
- Codebase simplification
- Migration preparation
- Technical debt reduction
- Build size optimization
- Maintenance cost reduction

## Capabilities

### 1. Unused Function Detection
- Find uncalled functions
- Identify unused exports
- Detect unreferenced methods
- Map call graphs

### 2. Unreachable Code Identification
- Analyze control flow
- Find code after returns
- Detect impossible conditions
- Identify dead branches

### 3. Unused Variable Detection
- Find unread variables
- Identify write-only variables
- Detect unused parameters
- Flag shadowed variables

### 4. Orphan File Detection
- Find unimported modules
- Identify orphaned assets
- Detect unused configuration
- Map file dependencies

### 5. Safe Removal Verification
- Verify no runtime references
- Check dynamic imports
- Validate reflection usage
- Test after removal

### 6. Impact Analysis
- Estimate removal scope
- Calculate size reduction
- Assess risk level
- Document dependencies

## Tool Integrations

| Tool | Language | Integration Method |
|------|----------|-------------------|
| ts-prune | TypeScript | CLI |
| unimported | JavaScript | CLI |
| deadcode | Python | CLI |
| UCDetector | Java | Eclipse Plugin |
| unused | Rust | CLI |
| deadcode | Go | CLI |
| webpack-bundle-analyzer | JavaScript | CLI |

## Output Schema

```json
{
  "analysisId": "string",
  "timestamp": "ISO8601",
  "deadCode": {
    "functions": [
      {
        "file": "string",
        "name": "string",
        "line": "number",
        "confidence": "high|medium|low",
        "reason": "string"
      }
    ],
    "variables": [],
    "files": [],
    "unreachable": []
  },
  "impact": {
    "filesAffected": "number",
    "linesRemovable": "number",
    "estimatedSizeReduction": "string"
  },
  "risks": [],
  "recommendations": []
}
```

## Integration with Migration Processes

- **code-refactoring**: Pre-refactoring cleanup
- **legacy-decommissioning**: Feature removal
- **monolith-to-microservices**: Service extraction prep

## Related Skills

- `static-code-analyzer`: Combined analysis
- `code-smell-detector`: Related smell detection

## Related Agents

- `legacy-decommissioning-specialist`: Uses for cleanup
- `code-transformation-executor`: Executes removal

Files in this skill

  • README.md1.4 KB
  • SKILL.md2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.