refactor-clean

Identify and remove dead code with test-backed verification.

182|28|Updated Nov 29, 2025
One-click install
npx skills add https://github.com/julianromli/ai-skills --skill refactor-clean-julianromli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-clean
Source: https://github.com/julianromli/ai-skills/tree/main/skills/refactor-clean
Command: npx skills add https://github.com/julianromli/ai-skills --skill refactor-clean-julianromli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely identify and remove dead code with test-backed verification to prevent regressions during refactors.

Core Features & Use Cases

  • Detect unused exports, dead utilities, and duplicate code across a codebase.
  • Recommend safe removals one at a time and verify with tests to guard against regressions.
  • Use during maintenance windows or before major refactors to prune tech debt without breaking behavior.

Quick Start

Establish a baseline, identify dead-code candidates, and remove one SAFE item at a time with immediate test verification.

Frequently Asked Questions about refactor-clean

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

FAQPage Schema
How do I safely remove dead code from a codebase without breaking existing behavior?▼

To safely remove dead code, establish a test baseline, categorize unused exports and stale utilities into risk levels, and delete one SAFE item at a time with immediate test re-verification to prevent regressions.

What is the best way to clean up unused exports and stale utilities before a major refactor?▼

The best way to clean up unused exports before a major refactor is to establish a test baseline, categorize dead-code candidates by risk, and incrementally remove SAFE items while verifying tests to guard against regressions.

How does test-backed verification work during dead code cleanup?▼

Test-backed verification works by enforcing a passing test baseline before deletion, then re-running tests immediately after removing one SAFE dead-code item to confirm no regressions occur.

When should I categorize dead code findings into SAFE, CAUTION, and DANGER levels?▼

You should categorize dead code findings into SAFE, CAUTION, and DANGER levels when pruning tech debt across modules and repositories, ensuring only SAFE items are deleted incrementally while higher-risk items require manual review.

Can I delete multiple dead code items at once during a maintenance window?▼

No, you should delete one SAFE dead-code item at a time. This incremental approach requires immediate test re-verification after each removal to ensure no unexpected regressions break the codebase.