What problem does it solve?
This skill solves the pain of working with messy, hard-to-maintain code that slows down development, introduces hard-to-diagnose bugs, and makes onboarding new team members time-consuming, all without risking breakage of existing functionality during improvements.
Core Features & Use Cases
- Incremental, Behavior-Preserving Workflow: Applies proven refactoring moves from Fowler's catalog one at a time, with explicit verification that observable behavior remains unchanged after each change.
- Code Smell Detection & Prioritization: Identifies common anti-patterns like god files, long functions, duplicated code, and deep nesting, then ranks fixes by severity to tackle the highest-impact issues first.
- Guided Best Practices: Enforces core principles including single responsibility, meaningful naming, DRY without over-abstraction, and guard clauses over deep nesting, drawing from established refactoring literature.
- Use Case: For example, if you have a 500-line utility file with duplicated logic and a 40-line function that's hard to follow, this skill will guide you to split it into focused, reusable components while keeping all existing functionality intact.
Quick Start
Ask the AI to refactor the attached user authentication module to reduce duplication and improve readability, following the iterative protocol outlined in the skill.