What problem does it solve?
Refactor code to improve maintainability without changing external behavior. This skill helps teams progressively improve code quality by extracting functions, renaming variables for clarity, breaking down large functions, strengthening type safety, eliminating code smells, and introducing proven design patterns. It is less drastic than a full rewrite and is intended for gradual improvements.
Core Features & Use Cases
- Incremental extraction: Break large functions into focused units.
- Renaming & typing improvements: Improve readability and type safety with minimal risk.
- Gradual pattern introduction: Introduce design patterns and structure without altering behavior.
- Use Case: When you have a monolithic function that's hard to test, refactor it step by step.
Quick Start
Start with a clearly delimited area of code identified for improvement. Write or run tests to lock in current behavior, then apply one focused refactor (e.g., extract a function, rename a variable) and run tests again. Repeat in small steps, committing frequently.