Claude Code Domain-Driven Design for Entities and Value Objects
Use domain language and invariants to distinguish identity, value equality, and aggregate boundaries. Outline the model before implementation.
中文Install in Claude Code
Use Claude Code with the pinned skill and a business scenario you can verify. Keep the strategic, tactical, and example references.
- Get the complete `plugins/spring-boot/skills/domain-driven-design` directory from the pinned GitHub checkout.
- Copy it under the target project's `.claude/skills/`. Confirm `.claude/skills/domain-driven-design/SKILL.md`, open Claude Code at the project root, and call `/domain-driven-design`.
Example task
Model a fictional event reservation. A reservation has an identity and can be canceled. Its slot consists of start and end times and end cannot precede start.What to check
Distinguish the identified reservation from the time slot defined by its values. Handle reservation state through its boundary and test the slot invariant separately.
Original SKILL.md on GitHub · Updated
Frequently asked question
Does a time slot need its own database ID?
Decide whether the domain tracks the slot independently. A slot defined by its values and owned by a reservation can be modeled as a value object.