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 changes, so refactoring never silently alters functionality. ## Core Features & Use Cases - ANALYZE Phase: Identifies domain boundaries, coupling and cohesion metrics, and problematic patterns like god classes and feature envy using AST-grep structural analysis. - PRESERVE Phase: Creates characterization tests and behavior snapshots that document what the code actually does, building a verified safety net before changes begin. - IMPROVE Phase: Executes incremental refactorings (extract method, extract class, move method, rename) with continuous test validation after every step. - Use Case: When modernizing a production module with minimal tests, run the DDD cycle to capture current behavior as tests, then restructure the code incrementally while the test suite confirms identical behavior at each commit. ## Quick Start Ask the AI to refactor a legacy module using the DDD workflow, starting with characterization tests to preserve its current behavior.