What problem does it solve? Refactoring legacy or messy code without breaking existing behavior is risky, especially when test coverage is low or deadlines are tight. This Skill provides a disciplined, evidence-based process for restructuring code safely. ## Core Features & Use Cases - Safety Net First: Establishes characterization tests and golden master snapshots before touching any code, ensuring existing behavior is documented and protected. - Incremental Strategy: Enforces small, atomic changes with test runs and commits after each step, preventing large risky rewrites. - Strategic Patterns: Applies proven patterns like Strangler Fig, Parallel Change with feature flags, and Branch by Abstraction for large-scale migrations. - Use Case: When modernizing a legacy module, use this Skill to write characterization tests, wrap old code behind an abstraction layer, run old and new implementations in parallel, and roll back instantly via a kill switch if errors spike. ## Quick Start Help me safely refactor this legacy payment module using a test-first incremental approach with a rollback plan.