/ddd-ts-kit:integration-event <producer-context> <Aggregate> <Fact>from ddd-ts-kit
Generates integration event contracts and handlers for DDD bounded contexts. Handles outbox patterns, versioned payloads, and idempotent consumers across RabbitMQ, Kafka, NATS, or Redis Streams.
Ships in ddd-ts-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Event under discussion: $ARGUMENTS
A domain event stays inside its context. What crosses a boundary is an integration event: a
contract the producer owns, in its published-language/, the only folder another context
may import.
npx ddd-ts-kit generate integration-event <ctx> <Aggregate> <Fact> --json
writes the declaration published-language/<fact>.v1.integration-event.ts
(defineIntegrationEvent({ type, version, payload })), its export, the publisher in
application/integration/publishers/ (a reaction to the domain event, which it creates when
missing; always in the default before-commit phase, so the outbox row commits with the state
change) and the specs. Fill the todos places:
<context>.<aggregate>.<fact>, past tense (events/name-format).personal: { subject: 'customerId', fields: ['email'] }: the catalog, AsyncAPI (x-personal-data) and the register read it.
privacy/event-payload-declared (a warning) reports a field named like personal data that the
option does not list.IntegrationEventPublisher and nothing else
(events/outbox-required). Never publish to a broker from a handler.The payload is a contract between two owners: agree on it before the consumer is built, and
commit it first (skill ddd-ts-kit:parallel-work).
The relationship is declared first (skill ddd-ts-kit:context-map); the generator refuses
otherwise.
npx ddd-ts-kit generate integration-handler <ctx> <upstream> <event-type>[@v<n>] --json
writes application/integration/handlers/<name>.integration-handler.ts and its spec. The type
is taken as list prints it, with or without @v<n> (the newest version without one). The name
comes from the event; when the design names the handler after what it does here, pass
--name <Name>: the file, the class, the consumer name and the system actor follow it.
CommandBus, as systemActor('<context>.<name>'). No business logic in it.@IntegrationEventHandler(definition, { consumer }). The consumer
name is a string literal, stable and unique in the project (generated as
<context>.<handler-name>): the identity of its subscription and of its idempotency mark
(events/consumer-idempotent). Renaming it replays or loses messages.Record<ProductListedV1Payload['state'], InvoiceStatus>, or writes 'issued' satisfies ProductListedV1Payload['state'] in a case,
never InvoiceStatus.Issued (language/declared-vocabulary). Better still, the producer
declares those values as a vocabulary of its published language.privacy/erasure-reaches-copies reports
the consumer that erases nothing) declares the copy with personalFields
(generate repository --personal) and erases it on privacy.data-subject.erased, the
event the platform publishes at the end of privacy:erase: npx ddd-ts-kit generate erasure-handler <ctx> writes that handler over the erasure of the context (needed when the
context runs as a service of its own; in the monolith the platform erases it directly, and
the handler then reaches nothing, idempotently). An event-sourced context has no such
table: the generator refuses it, because privacy:erase (eraseDataSubject) destroys the
key of the subject and the sealed values (personalData) are erased everywhere; a retention
date there is a scheduled job of yours that calls the same key destruction.npx ddd-ts-kit generate acl <ctx> <upstream>.npx ddd-ts-kit generate e2e <ctx> <UseCase> publishes the upstream event through the running application
(application.publish), awaits settled() and leaves what to observe; --event <eventType> when handlers of several events send that command. A use case only a job
starts gets await application.runJob('<ctx>.<job>') instead of the publication, one a
background job starts await application.runDueJobs() after the request that enqueues.Inside a version, changes are additive and optional; consumers ignore unknown fields.
Anything else (removal, rename, change of type or meaning) is
generate integration-event ... --version <n+1>, published next to the old version until
every consumer has moved.
The application knows IntegrationEventPublisher and IntegrationEventSubscriber only. The
provider is stack.broker, wired in src/platform/events/: in memory by default (tests,
one process), or @ddd-ts-kit/rabbitmq, @ddd-ts-kit/kafka, @ddd-ts-kit/nats,
@ddd-ts-kit/redis/event-bus, each with one durable subscription per consumer, bounded
retries and dead letters. Relay and consumer strategy per transport:
docs/ARCHITECTURE.md, "Outbox, by transport", and each package README. A custom provider
passes eventBusContract of @ddd-ts-kit/testing/contracts. Handlers do not change with
the provider.
npm run events:generate # catalog and AsyncAPI, committed with the code
npx ddd-ts-kit check --rule events/name-format --rule events/defined-in-published-language \
--rule events/consumer-idempotent --rule context/published-language-only
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ddd-ts-kit/ddd-ts-kit --plugin ddd-ts-kit26 skills in this plugin
/access-controlUse when adding a permission, a role or an ownership rule, when code needs the connected user or the tenant, when filtering a list by rights, or on an authz/* rule. Authentication, authorization, access scopes, policies, RBAC, ABAC, ReBAC./bootstrapChooses the stack and creates the project with the ddd-ts-kit CLI: config, platform, database, pipeline, contexts, in an empty directory or an existing backend. Run by the user with /ddd-ts-kit:bootstrap./bounded-contextsUse when cutting a system into bounded contexts, when a concept has no home, a context grows two vocabularies or too large, two contexts need each other, or on boundaries, subdomains, sub-contexts, modules, splitting or merging contexts. Core, supporting or generic./clean-codeUse when a clean/*, purity/* or language/* rule is reported, or when asked to clean, simplify, rename or make code more readable: business names, small functions, stepdown order, comments only for what code cannot say, no escape hatches, Clock, IdGenerator./commit-disciplineUse when about to commit, when asked to commit, to write a commit message or to split a change, or when the guard reports too many uncommitted changes. One use case or concept per commit, messages scoped by context./context-mapUse when two contexts depend on each other, a context needs data or a reaction from another, when choosing upstream, downstream and pattern (customer-supplier, conformist, anti-corruption layer, open-host service, shared kernel, published language), or on context/* rules.Other plugins' skills for the same job