What problem does it solve? Refactoring legacy code without breaking existing behavior is risky when test coverage is thin. This Skill provides a structured Domain-Driven Development workflow that captures current behavior with characterization tests before making any structural change, so refactoring never silently alters what the code does. ## Core Features & Use Cases - ANALYZE Phase: Identify domain boundaries, coupling and cohesion metrics, and problematic structural patterns using AST-grep analysis. - PRESERVE Phase: Create characterization tests and behavior snapshots that document what the code actually does, building a verified safety net. - IMPROVE Phase: Apply incremental refactorings (extract method, extract class, move method, rename) with continuous test validation after every change. - Use Case: When modernizing a production module with few tests, run the DDD cycle to map callers, lock in current behavior with characterization tests, then restructure the code step by step while the test suite confirms nothing changed. ## Quick Start Ask the AI to refactor a legacy module using the DDD workflow, starting with an analysis of its callers and characterization tests before any code changes.