What problem does it solve?
This Skill helps you improve the structure of existing code without changing behavior by identifying code smells and applying safe, test-protected refactoring moves—especially in legacy systems with little or no test coverage.
Core Features & Use Cases
- Code smell identification and mapping: Detects common smells (e.g., Long Method, God Class, Duplicate Code, Shotgun Surgery) and links each to named refactoring actions.
- Behavior-preserving refactoring workflow: Enforces small-step refactoring, running tests after every move, and clearly separating refactoring from feature work.
- Legacy code transformation strategy: Guides characterization tests and legacy migration patterns (e.g., Strangler Fig) to reduce risk when modifying untested systems.
- Refactoring command support: Provides standardized operational commands such as generating a refactoring plan, assessing technical debt, and ensuring safe refactoring.
Usage examples
- Refactor a monolithic service by extracting methods/classes in small, test-backed steps.
- Reduce technical debt by turning identified smells into an ordered execution plan.
- Work on legacy modules by first establishing characterization tests and then applying safe moves around seams.
Quick Start
Ask for a refactoring plan by providing the relevant code snippet or file area and the symptoms (e.g., “long method” or “shotgun surgery”), and request the exact smell(s) found plus the ordered safe refactoring moves with before/after guidance.