What problem does it solve? Modifying legacy code without breaking existing behavior is risky, especially when callers, side effects, and edge cases are poorly documented. This Skill provides a disciplined methodology for analyzing current behavior, locking it in with characterization tests, and improving the code in small, verifiable steps. ## Core Features & Use Cases - ANALYZE-PRESERVE-IMPROVE Cycle: A structured three-phase workflow that requires understanding callers, side effects, and existing tests before any change, then pinning behavior with characterization tests before refactoring. - Safe Migration Patterns: Applies the Strangler Fig pattern and Branch by Abstraction to replace legacy implementations incrementally without breaking dependents. - Concrete Guardrails: Enforces rules such as no interface changes without tests, transformations under 50 lines, and @AX:ANCHOR tags for functions with fan_in >= 3. - Use Case: When asked to refactor a legacy Go function used across many modules, the Skill first documents current behavior with characterization tests, then improves the code in small steps while keeping all existing tests green. ## Quick Start Use the ddd skill to refactor this legacy function while preserving its existing behavior and adding characterization tests first.