What problem does it solve?
Refactor code to improve structure and readability while preserving externally visible behavior, reducing technical debt and making future changes safer.
Core Features & Use Cases
- Incremental refactoring: Plan and apply small, low-risk changes that clarify intent without changing APIs or outputs.
- Parity-driven validation: Use existing tests and reasoning to ensure behavior is preserved after each change.
- Documentation of rationale: Record decisions, tradeoffs, and residual debt to guide future maintenance.
- Use Case: When a module is messy, with duplicated logic or unclear names, run a targeted refactor to improve structure and maintainability while keeping behavior intact.
Quick Start
Use the refactor skill to identify a candidate module with high cyclomatic complexity, then propose a minimal change set and track parity with the test suite.