create-domain-event

Generate C# domain event records, handlers, and service integrations for .NET.

Updated Nov 13, 2025
One-click install
npx skills add https://github.com/changjian-wang/dawning --skill create-domain-event-changjian-wang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-domain-event
Source: https://github.com/changjian-wang/dawning/tree/main/.github/skills/create-domain-event
Command: npx skills add https://github.com/changjian-wang/dawning --skill create-domain-event-changjian-wang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of domain events, their corresponding handlers, and the necessary service integrations, reducing boilerplate code and ensuring consistency in event-driven architectures.

Core Features & Use Cases

  • Event Definition: Generates C# record types for domain events, adhering to the IDomainEvent interface.
  • Event Handler Implementation: Creates handler classes that implement IDomainEventHandler<T>, ready to process specific events.
  • Service Integration: Provides examples of how to dispatch domain events from within service methods.
  • Use Case: When a new user is created in the system, you need to log this event for auditing and potentially trigger other downstream processes. This Skill helps you set up the UserCreatedEvent, a UserAuditEventHandler, and integrate the event dispatching into your UserService.

Quick Start

Use the create-domain-event skill to generate a UserCreatedEvent, a UserAuditEventHandler, and integrate it into the UserService.

Frequently Asked Questions about create-domain-event

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

FAQPage Schema
How do I generate domain events and handlers in C# to reduce boilerplate code?

To generate domain events and handlers in C#, this Skill creates event definition records and handler classes implementing the IDomainEventHandler interface. It streamlines service integrations and reduces boilerplate code for your event-driven architecture.

What is the best way to implement event-driven patterns for user management in a .NET application?

The best way to implement event-driven patterns for user management in a .NET application is by defining domain events as C# records and dispatching them through dedicated event handlers within your service methods to ensure consistency.

How do I dispatch a domain event from within a C# service method?

To dispatch a domain event from within a C# service method, you integrate the event dispatching mechanism directly into your service logic. This Skill provides examples of triggering events like UserCreatedEvent from inside your UserService.

Does this domain event generation approach adhere to DDD principles and standard C# patterns?

Yes, the domain event generation approach adheres to DDD principles and standard C# patterns. It uses standard C# record types for events and ensures handlers implement the IDomainEvent interface for consistent event-driven design.

Can I use this to set up an audit event handler for a newly created user?

Yes, you can use this to set up an audit event handler for a newly created user. It generates a specific UserCreatedEvent and a corresponding UserAuditEventHandler ready to process the event for auditing and downstream processes.