dead-code-cleanup

Detect and safely remove unused exports, deprecated code, and orphaned files from codebases.

1|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/kubrickcode/cine-mirror --skill dead-code-cleanup-kubrickcode
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dead-code-cleanup
Source: https://github.com/kubrickcode/cine-mirror/tree/main/.agents/skills/dead-code-cleanup
Command: npx skills add https://github.com/kubrickcode/cine-mirror --skill dead-code-cleanup-kubrickcode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate unused exports, deprecated functions, and orphaned files over time, increasing maintenance burden and confusion. Manually identifying dead code is error-prone because public APIs, dynamic imports, and framework conventions can be mistaken for unused code. ## Core Features & Use Cases - Systematic Dead Code Detection: Finds unused exports, deprecated code without migration plans, orphaned files, and unreachable code paths across TypeScript, JavaScript, and Go projects. - Preservation Rules: Automatically protects public APIs, framework conventions (Next.js routes, NestJS modules), test infrastructure, dynamic imports, and planned features marked with TODO tickets. - Safe Incremental Deletion: Deletes in small batches with build, test, and lint verification after each batch, plus git-based rollback on failure. - Use Case: Run a dry-run analysis on a legacy directory to get a confidence-classified report of dead code candidates, then auto-delete only HIGH confidence items while reviewing ambiguous cases. ## Quick Start Ask the AI to analyze the src/legacy directory for dead code in dry-run mode and produce a cleanup report without deleting anything.

Frequently Asked Questions about dead-code-cleanup

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

FAQPage Schema
How do I find and remove unused code in my codebase?▼

Run the cleanup in dry-run mode first to get a report of unused exports, deprecated code, and orphaned files classified by confidence level. Then use auto mode to delete HIGH confidence items, with build and test verification after each batch.

How to safely delete dead code without breaking the build?▼

Delete in small batches of 5-10 items and run the build, test, and lint commands after every batch. If any verification fails, immediately roll back the failed files using git checkout before continuing.

Does dead code detection work with Next.js or NestJS projects?▼

Yes, the analysis detects framework conventions and preserves path-based routes like Next.js pages and app directories, plus NestJS modules. It also checks package.json exports and index.ts re-exports to protect public API surfaces.

What code is never deleted during dead code cleanup?▼

Public APIs, test fixtures, dynamic imports, build script dependencies, GraphQL schemas, and code with TODO tickets referencing planned work are always preserved. Deprecated code with a future deadline is also kept.

Why is some detected dead code skipped instead of deleted?▼

Items with string references, comment mentions, or ambiguous usage are classified as MEDIUM or LOW confidence and skipped for safety. The final report documents each skip reason and recommends a next step for manual review.