create-domain-event

Create data-only domain events and NestJS OnEvent handlers for modular projects.

13|1|Updated Jun 28, 2023
One-click install
npx skills add https://github.com/jovicon/nestjs-clean-architecture-event-driven-template --skill create-domain-event
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-domain-event
Source: https://github.com/jovicon/nestjs-clean-architecture-event-driven-template/tree/main/.claude/skills/create-domain-event
Command: npx skills add https://github.com/jovicon/nestjs-clean-architecture-event-driven-template --skill create-domain-event

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create domain events and their framework-backed handlers to decouple domain logic from application services.

Core Features & Use Cases

  • Domain events: data-only definitions that carry payload
  • Event handlers: application-layer components using NestJS decorators
  • Use Case: connect a published domain event to reactive handlers across modules

Quick Start

Create a DomainEvent in the domain layer and a NestJS handler in the application layer that reacts to the event.

Frequently Asked Questions about create-domain-event

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

FAQPage Schema
How do I decouple domain logic from application services using domain events in NestJS?

Domain events decouple domain logic from application services by defining data-only DomainEvent payloads in the domain layer and framework-backed handlers in the application layer. This propagates events across NestJS modules for asynchronous reactions.

What is the best way to structure domain events and handlers in a DDD NestJS project?

The best way to structure domain events in a DDD NestJS project is to implement data-only DomainEvent definitions in the domain layer and nest their handlers in the application layer using the DomainEvent.base and OnEvent patterns.

When do I need domain events in a modular NestJS architecture?

You need domain events in a modular NestJS architecture when you want to connect a published domain event to reactive handlers across separate modules, enabling asynchronous reactions without tightly coupling domain logic to application services.

Can I use the OnEvent pattern to handle domain events across different NestJS modules?

Yes, you can use the OnEvent pattern to handle domain events across different NestJS modules. The application layer handler reacts to the data-only domain event propagated from the domain layer, maintaining clean module boundaries.

Does this approach to creating domain events require any external NestJS dependencies?

Creating domain events using this approach requires no external dependencies. It implements data-only DomainEvent definitions and framework-backed handlers using the DomainEvent.base and OnEvent patterns natively within your NestJS project.

Why should domain events be data-only definitions in the domain layer?

Domain events should be data-only definitions in the domain layer to carry payload without coupling to framework code. This ensures the domain logic remains clean while the application layer handles asynchronous reactions using NestJS decorators.