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

  1. Identify primitives that carry domain meaning or repeated validation.

  2. Separate syntax checks from domain invariants.

  3. Add a domain primitive with a private constructor and smart constructor or parser.

  4. Store only valid values inside entities and aggregates.

  5. 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.
Installs
15
Repository
j5ik2o/ai-tools
GitHub Stars
27
First Seen
May 3, 2026
ddd-domain-primitives-and-always-valid — j5ik2o/ai-tools