Domain modeling

From rnavarych/alpha-engineer · View interactive version

Domain modeling is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Domain-Driven Design: aggregates, bounded contexts, ubiquitous language, value objects, domain events, repository pattern, anti-corruption layer. When to use DDD vs simple CRUD. Entity vs value object distinction. TypeScript implementations with invariant enforcement. Use when designing domain model

How to use this skill

Skill file

Domain Modeling (DDD)

When to use

Core principles

  1. Ubiquitous language is the contract — code names must match business terms; if business says "Invoice", your class is Invoice, not Bill or Document
  2. Aggregates enforce invariants — all business rules for a cluster of objects enforced by the root
  3. Value objects are immutable — Money, Email, Address: no identity, defined by value
  4. Domain events record facts — OrderCancelled not cancelOrder(), past tense
  5. DDD is overkill for CRUD — if it's just data in / data out, use simple CRUD; DDD pays off when business rules are complex

References available

Assets available

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.