What problem does it solve? Large refactors and rewrites often fail because behavior changes, structural moves, and cleanups get mixed into one unreviewable change with no way to roll back. This Skill turns a broad refactor goal into a staged, behavior-preserving roadmap with explicit test gates and recovery points. ## Core Features & Use Cases - Staged Refactor Decomposition: Splits work into prepare, mechanical move, parallel path, incremental consumer migration, and legacy removal slices. - Behavior Contract Mapping: Identifies public APIs, data shapes, CLI flags, and integration behaviors that must be preserved, along with the test evidence required for each. - Rollback and Compatibility Planning: Defines rollback boundaries, deprecation windows, feature flags, adapters, and dual-read or dual-write migration strategies. - Use Case: A team needs to migrate a monolith's data layer to a new ORM without breaking existing consumers. The Skill produces a roadmap starting with characterization tests, then an adapter-based parallel path, incremental caller migration, and gated legacy removal. ## Quick Start Ask the agent to break your planned refactor into safe stages with test gates and rollback points, describing the target area and the behavior that must stay unchanged.