What problem does it solve?
This Skill provides a systematic, test-driven approach to restructuring code, ensuring that behavior remains unchanged and regressions are prevented during code improvements. It empowers developers to enhance code design without fear of introducing bugs.
Core Features & Use Cases
- Test Baseline Establishment: Emphasizes running all tests and measuring coverage before touching any code.
- Incremental Steps: Guides making small, verifiable changes one at a time, with testing after each step.
- Behavior Preservation: Focuses on rigorous verification to ensure functionality remains identical throughout the refactoring process.
- Use Case: Safely extract a large, complex function into several smaller, more manageable functions, ensuring all existing tests continue to pass after each incremental change and committing each step for easy rollback.
Quick Start
Use the refactoring-safety skill to guide me through extracting a helper function from my OrderProcessor class, ensuring I don't introduce any bugs.