speckit-refactor-clean

Identify and remove dead code after validating deletions with tests.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/a2mus/smart-da3m --skill speckit-refactor-clean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: speckit-refactor-clean
Source: https://github.com/a2mus/smart-da3m/tree/main/.agents/skills/speckit-refactor-clean
Command: npx skills add https://github.com/a2mus/smart-da3m --skill speckit-refactor-clean

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely identify and remove dead code while ensuring correctness through continuous test verification at every step.

Core Features & Use Cases

  • Analyze codebases to detect dead exports, unused dependencies, and redundant modules across multiple languages with tools like knip, depcheck, ts-prune, vulture, deadcode, and cargo-udeps.
  • Classify findings into SAFE, CAUTION, and DANGER, and perform safe deletions only after running full test suites, with rollback if needed.
  • Integrate into development workflows to maintain lean, well-tested codebases and improve maintainability.

Quick Start

Run the speckit-refactor-clean skill on your project to identify dead code, categorize findings, and delete safe items only after tests pass.

Frequently Asked Questions about speckit-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 multi-language codebase?

To safely remove dead code, you run static analysis tools like knip, ts-prune, vulture, deadcode, or cargo-udeps to surface unused exports and dependencies, then delete them only after your full test suite passes. This ensures behavior remains intact across JavaScript, Python, Go, and Rust projects.

What is the best way to find unused dependencies in JavaScript and Python?

The best way to find unused dependencies is using specialized static analysis tools like knip and depcheck for JavaScript or TypeScript, and vulture for Python. These tools surface unused modules and redundant code, allowing you to classify findings before safe deletion.

Does dead code removal work without a passing test suite?

Dead code removal does not work safely without a passing test suite. The safe deletion loop requires running unit and integration tests after each pruning step to validate correctness, automatically rolling back deletions if the tests fail to prevent breaking behavior.

How do I detect and prune dead exports in a Rust or Go project?

To detect and prune dead exports in a Rust or Go project, use cargo-udeps for Rust and deadcode for Go. These tools identify redundant modules and unused dependencies, which are then classified for safe deletion after test verification.

What are the limitations of using static analysis for dead code detection?

The limitation of using static analysis for dead code detection is the risk of false positives or breaking dynamic runtime behavior. To mitigate this, findings must be classified into caution and danger categories, requiring full test suite validation before any safe deletion occurs.