domain-modeling
Domain-Driven Design: aggregates, bounded contexts, ubiquitous language, value objects, domain events, repository pattern, anti-corruption layer. When to use DDD vs simple CRUD. Entity vs value object distinction. TypeScript implementations with invariant enforcement. Use when designing domain mo...
SKILL.md
Full skill instructions
Domain Modeling (DDD)
When to use
- Designing domain model for complex business logic
- Identifying bounded contexts and aggregate roots
- Translating business rules into code invariants
- Deciding between entities and value objects
- Mapping existing code to DDD building blocks
Core principles
- Ubiquitous language is the contract — code names must match business terms; if business says "Invoice", your class is
Invoice, notBillorDocument - Aggregates enforce invariants — all business rules for a cluster of objects enforced by the root
- Value objects are immutable — Money, Email, Address: no identity, defined by value
- Domain events record facts —
OrderCancellednotcancelOrder(), past tense - DDD is overkill for CRUD — if it's just data in / data out, use simple CRUD; DDD pays off when business rules are complex
References available
references/ddd-strategic.md— bounded context mapping, context map patterns, ACL implementationreferences/ddd-decision-guide.md— DDD vs CRUD decision tree, subdomain classification, team topology alignmentreferences/event-driven-integration.md— events over sync calls, transactional outbox pattern, event versioningreferences/event-storming.md— workshop facilitation guide, sticky note vocabulary, phases 1-7references/aggregate-design.md— command/event/rule structure, read model derivation, event storming discoveriesreferences/ubiquitous-language.md— naming convention rules, element type table, what to avoidreferences/domain-glossary.md— glossary entry format, e-commerce examples, maintenance cadencereferences/term-conflict-resolution.md— 5-step conflict resolution protocol, cross-context disambiguation
Assets available
assets/domain-model-template.md— aggregate skeleton, value object template, repository interface template
