j5ik2o-ddd-domain-primitives-and-always-valid
Installation
SKILL.md
Domain Primitives And Always-Valid Models
Make illegal states unrepresentable when the domain rule is stable enough to deserve a type.
Workflow
-
Identify primitives that carry domain meaning or repeated validation.
-
Separate syntax checks from domain invariants.
-
Add a domain primitive with a private constructor and smart constructor or parser.
-
Store only valid values inside entities and aggregates.
-
Keep formatting, localization, and transport parsing outside the core type unless they are domain rules.
Use A Domain Primitive When
- The value has a domain name.