moai-workflow-dddlisted
Install: claude install-skill modu-ai/moai-cowork
# Domain-Driven Development (DDD) Workflow
## Development Mode Configuration (CRITICAL)
[NOTE] This workflow is selected based on `.moai/config/sections/quality.yaml`:
```yaml
constitution:
development_mode: ddd # or tdd
```
**When to use this workflow**:
- `development_mode: ddd` → Use DDD (this workflow)
- `development_mode: tdd` → Use TDD instead (moai-workflow-tdd)
**Key distinction**:
- **DDD**: Characterization-test-first for existing codebases with minimal test coverage
- **TDD** (default): Test-first development for all work, including brownfield projects with pre-RED analysis
## Quick Reference
Domain-Driven Development provides a systematic approach for refactoring existing codebases where behavior preservation is paramount. Unlike TDD which creates new functionality, DDD improves structure without changing behavior.
Core Cycle - ANALYZE-PRESERVE-IMPROVE:
- ANALYZE: Domain boundary identification, coupling metrics, AST structural analysis
- PRESERVE: Characterization tests, behavior snapshots, test safety net verification
- IMPROVE: Incremental structural changes with continuous behavior validation
When to Use DDD:
- Refactoring legacy code with existing tests
- Improving code structure without functional changes
- Technical debt reduction in production systems
- API migration and deprecation handling
- Code modernization projects
- When DDD is not applicable because code already exists
- Greenfield projects (with adapted cycle - see below)
When NOT