event

Create domain and integration events with transactional outbox delivery in TypeScript and Go backends.

4|Updated Jul 30, 2026
One-click install
npx skills add https://github.com/gabriellst/codm --skill event-gabriellst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: event
Source: https://github.com/gabriellst/codm/tree/main/.claude/skills/event
Command: npx skills add https://github.com/gabriellst/codm --skill event-gabriellst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deciding how to signal that something significant happened in a DDD/CQRS backend — and wiring that signal correctly — is error-prone: events get published synchronously from use cases, payloads leak entity references, and naming drifts. This Skill codifies the exact patterns for creating domain events (same bounded context, InternalMediator) and integration events (cross-context, ExternalMediator) with durable, at-least-once delivery via the transactional outbox. ## Core Features & Use Cases - Language-dispatched playbooks: A hub SKILL.md routes to TypeScript or Go variants by file extension, each with its own registry.yaml of mandatory patterns and bad practices. - Transactional outbox enforcement: Events are saved inside the same transaction as the entity and delivered asynchronously by the OutboxDispatcher — direct mediator publishes from use cases are flagged as critical violations. - Intent-based activation decision: A decision table distinguishes events (reactive facts, audit) from CommandQueue (durable single-executor commands), Mailbox (serialized turns), and direct synchronous use case calls. - Use Case: When a transcoding job starts, scaffold a TranscodingJobStartedEvent in Go (type alias over types.DomainEvent[T], past-tense const name, primitive payload with JSON tags), raise it inside the entity method, and let the repository drain it to the outbox. ## Quick Start Ask the agent to create a domain event for a significant occurrence in your bounded context, for example: create an event for when a collaborator is invited in the collaborator context.

Frequently Asked Questions about event

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

FAQPage Schema
How do I create a domain event in a DDD TypeScript backend?

Define a payload schema with z.domainEvent(), create a class extending BaseDomainEvent with a static past-tense name like 'collaborator.collaborator.invited', and save it via domainEventRepository.save inside the same transaction as the entity. The OutboxDispatcher delivers it asynchronously.

What is the difference between a domain event and an integration event?

Domain events stay within one bounded context and are delivered via the outbox to InternalMediator handlers. Integration events cross context or service boundaries, live in a shared events module, and are published by a named handler through ExternalMediator.

Why should use cases never publish events directly to a mediator?

Direct publishing loses durability: if the process crashes after the database commit but before dispatch, the event is lost. Saving the event to the outbox in the same transaction guarantees at-least-once delivery by the polling dispatcher.

How do I define a domain event in Go with generics?

Declare a payload struct with plain primitives and JSON tags, then create a type alias like type MyEvent = types.DomainEvent[MyPayload] so it satisfies DomainEventI automatically. Add a NewMyEvent constructor taking entityID, ownerID, and payload.

When should I use a command queue instead of an event?

Use a command queue when something must happen with retry and a single executor, rather than when a fact occurred that others may react to. Events exist for reactive, audit, or event-sourcing purposes — never to command an action.

What fields are allowed in an event payload?

Payloads must use plain serializable primitives such as strings, numbers, booleans, dates, and enum references. Entity pointers, live class instances, value objects, and non-serializable runtime objects like HTTP requests are prohibited because they break outbox serialization.