domain-events
Installation
SKILL.md
Domain Events Pattern
Sources: Eric Evans — Domain-Driven Design (2003); Vaughn Vernon — Implementing DDD (2013)
Pain Signals — You Are in This Branch When:
- An aggregate directly calls a method on another aggregate after saving
- Side effects (send email, update inventory, log audit trail) are called directly inside domain methods
- Adding a new reaction to a domain operation requires modifying the operation itself
- A business transaction spans two aggregates that must stay consistent
- Tests of a domain operation fail because a side-effect dependency is missing
- The same domain operation triggers a growing list of unrelated follow-on actions
Core Principle
A Domain Event represents something that happened in the domain that domain experts care about. It is a fact — immutable, past tense, cannot be rejected. Other parts of the system react to it; they do not modify it.