ddd-entity
Installation
SKILL.md
One-line summary
An entity is a domain object identified by who it is, not by what it contains — its identity is stable across attribute changes and across time.
When to use this skill
- Modeling something tracked over time:
Customer,Order,Account,Shipment,Subscription. - Two instances with identical attributes are still distinct things ("two customers named John Smith are not the same customer").
- A concept has a lifecycle — created, modified, archived, deleted — and the same conceptual instance persists across those states.
When NOT to use this skill
- The concept is fully described by its attributes with no identity → use
ddd-value-object. - The "identity" is just a database autoincrement with no domain meaning → that suggests the concept might actually be a value object that the persistence layer is identifying for storage reasons.
- The concept exists only inside a single aggregate and is never referenced from outside → it may still be an entity, but reconsider whether it needs to be modeled separately at all.
Core content
Identity is the distinguishing feature. An entity's identity is assigned (often as a UUID, a business identifier like a customer number, or a natural key) and stable — it does not change when attributes change. Equality is by identity: two entities are equal if and only if their identifiers match, regardless of every other field.