Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Covers tactical DDD patterns: aggregate rules, entities, value objects, domain events, repositories, domain services, and anti-patterns.
91% 96%+4 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 21 of 23 without it.
This test ran on v1. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
File and folder placement of aggregates and value objects follows the File layout section of nw-code-craftsmanship.
Implementation patterns within a bounded context. Tactical DDD answers: "How do we structure the domain model?"
An aggregate is a consistency boundary -- a cluster of domain objects that must be transactionally consistent.
Model true invariants in consistency boundaries: Only include elements that MUST be consistent within the same transaction. If two entities don't share an invariant, they belong in separate aggregates.
Design small aggregates: ~70% of aggregates contain only a root entity with value-typed properties. Large aggregates create concurrency contention, scalability failures, and memory pressure.
Reference other aggregates by identity: Use ProductId not Product. Direct object references create accidental cross-aggregate transactions and prevent independent scaling.
Use eventual consistency outside the boundary: Domain events communicate across aggregates. One transaction = one aggregate. If you need to update two aggregates "atomically," reconsider your boundaries.
| Smell | Signal | Fix |
|---|---|---|
| God Aggregate | >5 entities, frequent concurrency conflicts | Split by invariant analysis |
| Anemic Aggregate | All logic in services, aggregate = data bag | Move business rules into aggregate methods |
| Cross-Aggregate Transaction | Two aggregates modified in one DB transaction | Use domain events + eventual consistency |
| Deep Nesting | Aggregate root -> entity -> entity -> value | Flatten; promote nested entities to own aggregates |
| Missing Aggregate | Business rules scattered in application services | Identify invariant cluster, create aggregate |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.