What problem does it solve?
Refactoring code without a structured, safety-first process often leads to unintended behavior changes, broken functionality, and hours of debugging to fix issues introduced by structural changes. This Skill eliminates that risk by enforcing a disciplined, test-validated workflow for all code transformations.
Core Features & Use Cases
- Test-First Safety Net: Mandates full test coverage verification before, during, and after every refactoring step to ensure no behavior changes slip through.
- Standardized Refactoring Patterns: Provides step-by-step guidance for common, safe refactoring operations including extract method, rename variables/functions, extract class, and replace conditional with polymorphism.
- Use Case: A developer working on a legacy Python codebase with duplicated user validation logic can use this Skill to safely extract the shared validation into a reusable helper method without breaking any existing functionality.
Quick Start
Use the refactoring skill to safely extract the duplicated order discount calculation logic from the process_order method into a separate reusable helper function while keeping all existing tests passing.