j5ik2o-ddd-aggregate-transaction-boundary
Installation
SKILL.md
DDD Aggregate Transaction Boundary
One transaction should update one aggregate. If multiple aggregates must change, model coordination explicitly.
Workflow
-
Identify every aggregate loaded or modified by the use case.
-
Mark which aggregate owns the command's true invariant.
-
Keep that aggregate in the synchronous transaction.
-
Move other aggregate updates behind domain events, an outbox, a saga, or a process manager.
-
Define compensating behavior for failures and retries.
Checks
- A use case that saves two aggregate roots is suspect.