refactor-clean

Identify and remove dead code with test verification during refactors.

Updated Sep 6, 2018
One-click install
npx skills add https://github.com/terakoya76/terakoya76-playbooks --skill refactor-clean-terakoya76
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-clean
Source: https://github.com/terakoya76/terakoya76-playbooks/tree/main/roles/dotfiles/files/claude/skills/refactor-clean
Command: npx skills add https://github.com/terakoya76/terakoya76-playbooks --skill refactor-clean-terakoya76

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps your development workflow identify and safely remove dead or unused code during refactoring, preventing regressions.

Core Features & Use Cases

  • Automated dead-code detection across codebases
  • Safe removal guided by test verification and guardrails
  • Integration with existing CI/tests and refactor workflows

Quick Start

Start the refactor-clean process by scanning the repository for dead code and validating changes against the test suite.

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 during a refactor without breaking existing behavior?

Safe dead code removal coordinates verification tests to validate that pruning unused paths does not break behavior. It scans the codebase, applies safe source file mutations, and validates changes against existing CI and test suites.

What is the process for detecting and cleaning up unused code paths?

Dead code detection uses static analysis to identify unused paths across the codebase, then validates removal through test verification with guardrails and fallback messaging to prevent regressions before mutating source files.

Do I need an existing CI or test suite to automate dead code removal?

An existing CI or test suite is required to verify safe dead code removal. The process relies on test verification to ensure pruning dead paths does not break behavior, making automated validation essential for safe refactoring.

Does this dead code removal approach work across different programming languages and frameworks?

Dead code removal applies to codebases across languages and frameworks where CI and test suites exist, coordinating verification tests to safely prune dead paths regardless of the specific technology stack being used.

What's the best way to integrate dead code analysis into an existing refactor workflow?

Dead code analysis integrates with existing refactor workflows by scanning the repository for unused code and validating changes against the test suite, ensuring safe removal with clear guardrails and fallback messaging during refactoring.

What happens if removing dead code causes test failures during the refactor?

When dead code removal causes test failures, the process provides clear fallback messaging and guardrails to prevent regressions, with test verification ensuring unsafe mutations are caught before source files are permanently changed.