Automated Refactoring & Test Safety
Executes structured, autonomous code cleanup and architectural improvements while strictly maintaining test integrity.
The Refactor skill provides a rigorous, multi-stage framework for improving code quality without introducing regressions. It guides Claude through a systematic process—Prep, Main Refactoring, Final Evaluation, and Summary—that prioritizes test safety and self-documenting code. By enforcing a strict policy where test assertions remain untouched and every change is validated by a test suite, it ensures that code remains functional throughout the transformation. The skill autonomously identifies cleanup opportunities like dead code removal, method extraction, and domain-driven renaming, while maintaining a detailed REFACTORING_SUMMARY.md and creating granular, traceable commits.