What problem does it solve?
This Skill helps you refactor an existing codebase when the architecture feels tangled or outdated, so you can extract modules, invert dependencies, and migrate to a healthier structure without breaking behavior.
Core Features & Use Cases
- Diagnose structural issues first: produces a DIAGNOSE REPORT with named anti-patterns, hotspots, and a clear structural root cause before proposing changes.
- Choose an explicit architectural target: proposes 2–3 concrete refactoring targets (patterns, boundaries, dependency direction) and requires user confirmation via a refactoring gate.
- Execute atomic, test-backed migrations: creates a MIGRATION PLAN of small steps with TDD/testing requirements, runs tests and build per step, and updates the spec to prevent drift.
- Differentiate refactoring from cleanup: focuses on architectural redesign (not dead-code removal) and can also improve outcomes after reverse-spec.
Quick Start
Tell your AI agent to “Use /refactor to redesign my codebase architecture: diagnose the current anti-patterns, propose a target with an ADR, request my confirmation, then produce an atomic migration plan with tests before moving any code.”