ddd-when-to-wrap-primitives
Installation
SKILL.md
When To Wrap Primitives
Wrap primitives when the wrapper changes correctness, not when it only signals virtue.
Wrap When
-
The value has a domain name and invariant.
-
Two values of the same primitive type can be confused.
-
Validation is repeated or easy to forget.
-
Behavior naturally belongs with the value.
-
Invalid states cause meaningful business risk.
Do Not Wrap Yet When
- The value has no behavior or invariant.