agentsclimarketplace

Dead code eliminator

Skill a5c-ai/babysitter/library/specializations/code-migration-modernization/skills/dead-code-eliminator

Identify and safely remove dead, unused, and unreachable code from codebasesFrom its SKILL.md

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

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.9 KB, 581 tokens by cl100k_base, as published. Nobody here has run it

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

ToolLanguageIntegration Method
ts-pruneTypeScriptCLI
unimportedJavaScriptCLI
deadcodePythonCLI
UCDetectorJavaEclipse Plugin
unusedRustCLI
deadcodeGoCLI
webpack-bundle-analyzerJavaScriptCLI

Output Schema

{
  "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

What ships with it: 1 file

1.4 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.