domain-events

Emit and subscribe to typed domain events via a central event bus.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/aydadevelop/turborepo-starter --skill domain-events
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: domain-events
Source: https://github.com/aydadevelop/turborepo-starter/tree/main/.agents/skills/domain-events
Command: npx skills add https://github.com/aydadevelop/turborepo-starter --skill domain-events

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust and type-safe system for emitting and subscribing to domain-specific events within the application, decoupling services and enabling event-driven architecture.

Core Features & Use Cases

  • Event Emission: Allows domain services to publish events with typed payloads.
  • Event Subscription: Enables modules to register as listeners for specific event types.
  • Test Utilities: Provides clearEventPushers for isolated testing of event-driven logic.
  • Use Case: When a booking:created event is emitted, the notifications module can automatically subscribe and send an email to the customer, while the calendar module subscribes to booking:confirmed to update the booking's calendar entry.

Quick Start

Register a new event pusher to handle the 'booking:confirmed' event.

Frequently Asked Questions about domain-events

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

FAQPage Schema
How do I implement an event bus for pub/sub communication in TypeScript?β–Ό

An event bus enables pub/sub communication by allowing modules to register as listeners for typed domain events while domain services emit events with structured payloads, achieving decoupled event-driven architecture.

How do I decouple services using domain events in TypeScript?β–Ό

Decouple services by registering modules as event pushers on a central event bus, enabling domain services to emit typed events like 'booking:created' that other modules subscribe to without direct dependencies.

Can I test event-driven logic in isolation without triggering all subscribers?β–Ό

Yes, you can test event-driven logic in isolation by calling the clearEventPushers utility, which clears event subscriptions to ensure subscribers are not triggered during testing.

Does TypeScript event-driven architecture support typed payloads for domain events?β–Ό

TypeScript event-driven architecture supports typed payloads for domain events, providing a type-safe system where domain services publish structured data that subscribers receive with full type checking.

What is the best way to structure event subscriptions across decoupled modules?β–Ό

The best way to structure event subscriptions is through a central event bus where modules register as listeners for specific event types, allowing domain services to emit structured events that automatically trigger the correct subscribers.

When should I not use a central event bus for domain events?β–Ό

A central event bus for domain events should not be used when modules require synchronous, tightly coupled execution or when the testing overhead of managing and clearing event subscriptions outweighs the benefits of decoupling.