dead-code-cleanup

Identify and remove dead code, deprecated code, and unused exports from repositories.

1|Updated Dec 8, 2025
One-click install
npx skills add https://github.com/specvital/infra --skill dead-code-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dead-code-cleanup
Source: https://github.com/specvital/infra/tree/main/.claude/skills/dead-code-cleanup
Command: npx skills add https://github.com/specvital/infra --skill dead-code-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams identify and safely remove dead code, deprecated code, and unused exports from a codebase, reducing maintenance costs and preventing legacy bloat.

Core Features & Use Cases

  • Detect unused exports, functions, and classes with no references.
  • Identify deprecated code (with TODO/FIXME markers) and orphaned files that are no longer imported or referenced.
  • Enforce preservation rules to protect public APIs, tests, and critical build assets during cleanup.
  • Use case: clean up a large monorepo without breaking builds by running a dry-run first, then applying safe deletions.

Quick Start

Run the cleanup against your repository:

  • dead-code-cleanup --dry-run
  • dead-code-cleanup path/to/target
  • dead-code-cleanup --auto After each batch, run your standard build and tests to verify integrity.

Frequently Asked Questions about dead-code-cleanup

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

FAQPage Schema
How do I identify and remove dead code from a large codebase?

To remove dead code, analyze your repository to detect unused exports, deprecated functions, and orphaned files. You can run a dry-run first to report findings, then apply automated deletions while enforcing preservation rules for public APIs and tests.

Can I detect unused exports and orphaned files without breaking my current build?

Yes, detecting unused exports and orphaned files is safe when using a dry-run mode. This reports dead code without deleting it, allowing you to verify integrity and ensure your build passes before applying any actual changes.

What is the best way to clean up deprecated code marked with TODO and FIXME comments?

The best way to clean up deprecated code is to scan for TODO and FIXME markers, identify unreferenced functions, and remove them in batches. You must run your standard build and tests after each batch to maintain project integrity.

Does dead code cleanup preserve public APIs and critical test assets during deletion?

Yes, dead code cleanup enforces preservation rules to protect public APIs, tests, and critical build assets. This ensures that automated deletions of unused code never remove essential components required for your project to function.

How do I automate unused code removal across an entire repository?

You can automate unused code removal by running an auto-delete command against your repository path. This automatically prunes dead code while respecting preservation rules, though you must verify that the project builds and passes tests afterward.