← ClaudeAtlas

design_data_modellisted

Use this skill when designing domain models, entities, value objects, aggregates, or the conceptual structure of the business domain — separate from database schema or ORM concerns. Triggers on: "how should I model this domain?", "what entities do I need?", "design the domain model for X", "should this be an entity or value object?", "what are the aggregates?", "how should these concepts relate?", "DDD domain modeling", "model this business concept in code". Also use when translating requirements into objects and relationships before writing any code.
feralbureau/luminy · ★ 0 · AI & Automation · score 68
Install: claude install-skill feralbureau/luminy
# design_data_model Domain modeling is the act of translating business concepts into a structured representation in code. A good domain model makes the code read like the business; a bad one creates an impedance mismatch where understanding the code requires translating it back to business terms. ## Domain-Driven Design Vocabulary ### Entity A thing that has identity and continuity. It's tracked through changes by its identity (usually an ID). An entity is the same entity even if its attributes change — a `User` remains the same `User` even after changing their email address. ```python @dataclass class Order: id: int # identity — this is what makes it an Order user_id: int status: OrderStatus items: list[OrderItem] total: Decimal ``` ### Value Object A thing defined entirely by its attributes. Two value objects with the same attributes are identical — they have no identity. Prefer immutable value objects. Good candidates: Money, Address, DateRange, Coordinates, Email. ```python @dataclass(frozen=True) # immutable — can't change an address, replace it class Address: street: str city: str country: str postal_code: str # Two addresses with same fields ARE the same — no ID needed a1 = Address("Main St", "London", "UK", "SW1A 1AA") a2 = Address("Main St", "London", "UK", "SW1A 1AA") assert a1 == a2 # True @dataclass(frozen=True) class Money: amount: Decimal currency: str # "GBP", "USD", etc. def __add