domain-events-generator

Generate domain events, handlers, and Outbox integration using MediatR.

69|13|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/ronnythedev/dotnet-clean-architecture-skills --skill domain-events-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-events-generator
Source: https://github.com/ronnythedev/dotnet-clean-architecture-skills/tree/main/sample/POS/.claude/skills/09-domain-events-generator
Command: npx skills add https://github.com/ronnythedev/dotnet-clean-architecture-skills --skill domain-events-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a ready-to-use framework for capturing domain events, defining their structure, and wiring up event handlers using MediatR and the Outbox pattern in a Clean Architecture context.

Core Features & Use Cases

  • Event Modeling: Create IDomainEvent markers, a base DomainEvent, and concrete events for each aggregate.
  • Event Dispatch: Raise events from entities and handle them with dedicated INotificationHandler implementations.
  • Reliable Delivery: Integrate with the Outbox pattern to persist and publish events reliably.
  • Template-Driven: Includes templates for events, handlers, and outbox integration to accelerate development.
  • Use Cases: Apply to aggregate roots like Order or Customer to emit Created/Updated/Deleted domain events and trigger side effects.

Quick Start

Use the domain-events-generator skill to scaffold domain events for an example aggregate (e.g., Order) with Created and Updated events and a basic outbox setup.

Frequently Asked Questions about domain-events-generator

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

FAQPage Schema
How do I generate domain events and handlers for a DDD aggregate?

You generate domain events and handlers by creating IDomainEvent markers, a base DomainEvent class, and concrete event records for aggregates, then wiring up corresponding MediatR handlers to enable event-driven behavior.

What is the outbox pattern for reliable domain event delivery in Clean Architecture?

The outbox pattern provides reliable domain event delivery by persisting events to an outbox during aggregate state changes, ensuring they are safely published even if external systems temporarily fail.

How does MediatR work with domain events in a Clean Architecture application?

MediatR dispatches domain events as INotification messages to dedicated INotificationHandler implementations, allowing aggregates to raise events that trigger side effects without direct dependencies on the handlers.

Can I use this domain event generator for aggregates like Customer and Order?

Yes, you can apply the domain event generator to aggregates like Customer and Order to emit Created, Updated, and Deleted domain events, complete with templates for event definitions, handlers, and outbox integration.

Do I need to manually implement outbox integration when scaffolding domain events?

No, you do not need to manually implement outbox integration because the generator provides ready-to-use templates and guidance for outbox-based delivery alongside event definitions and handler scaffolding.

Related Skills