.agent/skills/speckit-refactor-clean/SKILL.md
Safely identify and remove dead code with test verification at every step.
npx skillsauth add a2mus/smart-da3m speckit-refactor-cleanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Safely identify and remove dead code with test verification at every step.
Run analysis tools based on project type:
| Tool | What It Finds | Command |
|------|--------------|---------|
| knip | Unused exports, files, dependencies | npx knip |
| depcheck | Unused npm dependencies | npx depcheck |
| ts-prune | Unused TypeScript exports | npx ts-prune |
| vulture | Unused Python code | vulture src/ |
| deadcode | Unused Go code | deadcode ./... |
| cargo-udeps | Unused Rust dependencies | cargo +nightly udeps |
If no tool is available, use exact Grep searches to find unused exports.
Sort findings into safety tiers: | Tier | Examples | Action | |------|----------|--------| | SAFE | Unused utilities, test helpers, internal functions | Delete with confidence | | CAUTION | Components, API routes, middleware | Verify no external consumers | | DANGER | Config files, entry points, type definitions | Investigate before touching |
For each SAFE item:
Before deleting CAUTION items:
import(), require(), __import__After removing dead code, look for:
Report results:
Dead Code Cleanup
──────────────────────────────
Deleted: X unused functions
Y unused files
Z unused dependencies
Skipped: X items (tests failed)
Saved: ~X lines removed
──────────────────────────────
All tests passing ✅
testing
Perform cross-artifact consistency analysis across spec.md, plan.md, and tasks.md. Use after task generation to identify gaps, duplications, and inconsistencies before implementation.
development
Run comprehensive verification on current codebase state.
testing
Intelligently sync your fork with the upstream spec-kit repository. Reads both versions of every changed file, compares quality, and produces the richest possible result by blending the best of each.
development
Impeccable UI design workflow — create distinctive, production-grade interfaces or enhance existing ones. Integrates design context gathering, anti-pattern detection, heuristic scoring, and systematic polish. Works after speckit-brainstorm (new design) or on existing UI code (enhancement mode).