add-domain-event

Create domain event records and mediator-based handlers for cache invalidation and side effects.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/tthanhtung9922/blog-platform --skill add-domain-event
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-domain-event
Source: https://github.com/tthanhtung9922/blog-platform/tree/main/.claude/skills/add-domain-event
Command: npx skills add https://github.com/tthanhtung9922/blog-platform --skill add-domain-event

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinating domain events and handlers across aggregates is error-prone without a structured pattern for cache invalidation and cross-aggregate side effects.

Core Features & Use Cases

  • Define domain events as records that raise in aggregates and trigger handlers across layers.
  • Provide ready-made patterns for cache invalidation, notifications, and cross-aggregate side effects.
  • Use in a blog platform to attach events like PostPublishedEvent and UserRegisteredEvent with corresponding handlers.

Quick Start

Create a new event by defining an Event record and then add handlers to respond to it across the application.

Frequently Asked Questions about add-domain-event

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

FAQPage Schema
How do I handle cache invalidation with domain events in C#?

Domain events in C# automate cache invalidation by defining event records raised in aggregates and wiring handlers through a mediator-based dispatch model to invalidate caches and manage cross-aggregate side effects.

What is the best way to structure domain events and handlers in a .NET application?

Structuring domain events in .NET involves defining events as records, organizing them into recommended namespaces and filenames, and using a mediator-based dispatch model to route events to handlers for cache invalidation and notifications.

When do I need domain events for cross-aggregate side effects?

You need domain events for cross-aggregate side effects when coordinating changes across multiple aggregates becomes error-prone and requires a structured event-driven pattern to handle cache invalidation and notifications reliably.

How do I create and wire a domain event handler in a dotnet project?

To create a domain event handler in dotnet, define the event as a record, place it in the correct namespace, and implement a handler class that responds through the mediator dispatch model to perform cache invalidation or cross-aggregate updates.

Can I use this event-driven domain event pattern for notifications and cache consistency?

Yes, this event-driven pattern provides ready-made structures for cache invalidation, notifications, and cross-aggregate updates by attaching event records like PostPublishedEvent to aggregates and routing them to corresponding handlers.