What problem does it solve? Refactoring legacy or messy code is risky because changes can silently break existing behavior. This Skill provides a structured TDD refactor workflow that uses the existing test suite as a safety net, so every code improvement is verified against a green baseline before and after each change. ## Core Features & Use Cases - Code Smell Detection & Remediation: Identifies duplicated code, long methods, large classes, feature envy, and primitive obsession, then applies targeted refactorings like Extract Method and Move Method. - Design Patterns & SOLID Guidance: Applies creational, structural, and behavioral patterns plus SOLID principles only where they add clear value. - Incremental Safe Refactoring: Enforces small atomic changes with test runs after each step, performance measurement before and after, and a rollback recovery protocol if tests fail. - Use Case: You inherit a 300-line OrderProcessor method mixing validation, pricing, payment, and notifications. Use this Skill to decompose it into focused methods with value objects and dependency injection while all tests stay green. ## Quick Start Ask the agent to refactor a specific class or module using the TDD refactor phase, keeping all tests green and reporting before-and-after metrics.