domain-event

Publish immutable domain events from entities with post-commit dispatch.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/yeeehaooo/WorkSpace --skill domain-event-yeeehaooo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-event
Source: https://github.com/yeeehaooo/WorkSpace/tree/main/skills/dotnet/patterns/domain-event
Command: npx skills add https://github.com/yeeehaooo/WorkSpace --skill domain-event-yeeehaooo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable domain entities to publish events when significant business events occur, allowing decoupled side effects across the system.

Core Features & Use Cases

  • Emit domain events from aggregates to notify other parts of the system.
  • Dispatch events after transaction commit to ensure consistency and eventual reliability.
  • Support multiple handlers and idempotent processing to build reactive, event-driven architectures.
  • Use Case: When an Order is created, raise an OrderCreatedEvent and trigger downstream actions (e.g., notifications, analytics) without coupling to the command flow.

Quick Start

Define and raise a domain event in your aggregate when a business rule is satisfied, then dispatch it after the unit of work commits.

Frequently Asked Questions about domain-event

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish domain events to decouple business logic in an event-driven architecture?

To publish domain events, define and raise immutable events from aggregates when business rules are satisfied, then dispatch them post-commit to notify other parts of the system without coupling to the command flow.

When should I dispatch domain events after a transaction commit?

You should dispatch domain events after a transaction commit to ensure consistency and eventual reliability, preventing side effects from executing if the unit of work rolls back before the aggregate's state is persisted.

How does event-driven architecture handle multiple handlers for a single domain event?

Event-driven architecture supports multiple handlers for a single domain event by allowing independent components to react to the same immutable event, enabling reactive processes like notifications and analytics simultaneously.

What is the best way to decouple side effects from domain entity command flows?

The best way to decouple side effects is to raise domain events from entities upon state changes, dispatching them post-commit to allow downstream actions to process idempotently without direct coupling to the command flow.

Can I implement idempotent processing for domain events across bounded contexts?

Yes, you can implement idempotent processing for domain events across bounded contexts by using immutable events and multiple handlers, ensuring reactive event-driven architectures process duplicate dispatches safely.

Why use immutable domain events when applying clean architecture across application layers?

You use immutable domain events in clean architecture to guarantee that once a business event occurs, its historical record remains unchanged across domain, application, and infrastructure layers, ensuring reliable post-commit dispatch.