refactor-cleaner

Detect dead code and unused exports in TypeScript projects with knip, depcheck, and ts-prune.

5|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/Bamose/everything-codex-cli --skill refactor-cleaner-bamose
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-cleaner
Source: https://github.com/Bamose/everything-codex-cli/tree/main/skills/refactor-cleaner
Command: npx skills add https://github.com/Bamose/everything-codex-cli --skill refactor-cleaner-bamose

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Dead code, unused exports, and duplicate definitions accumulate technical debt, bloating builds and slowing maintenance.

Core Features & Use Cases

  • Detect dead code, unused exports, and dependencies with knip, depcheck, and ts-prune.
  • Consolidate duplicates and guide safe refactoring with an auditable DELETION_LOG.md.
  • Applicable during large-scale refactors, monorepo cleanups, and ongoing code health improvements.

Quick Start

Run the detection tools and begin a safe cleanup workflow, then record changes in docs/DELETION_LOG.md.

Frequently Asked Questions about refactor-cleaner

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

FAQPage Schema
How do I find and remove dead code in a TypeScript project?

To find and remove dead code in a TypeScript project, run static analysis tools like knip, depcheck, and ts-prune to identify unused exports and dependencies, then follow a safe removal workflow.

What is the best way to clean up unused dependencies during a monorepo refactoring?

The best way to clean up unused dependencies during a monorepo refactoring is to coordinate detection across the workspace with depcheck and knip, ensuring you track removed modules in an audit log.

How does tracking deleted code in a DELETION_LOG.md improve refactoring safety?

Tracking deleted code in a DELETION_LOG.md improves refactoring safety by creating an auditable record of removed dead code and unused exports, allowing you to review and reverse changes if needed.

Can I use knip and ts-prune together for static analysis of unused exports?

Yes, you can use knip and ts-prune together for static analysis of unused exports; coordinating multiple detection tools helps catch a wider range of dead code and duplicate definitions in TypeScript.

When should I consolidate duplicate definitions in my codebase?

You should consolidate duplicate definitions during large-scale refactors or ongoing code health improvements to reduce bloat, eliminate technical debt, and streamline maintenance across your project.