Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation. Do NOT use for domain-event discovery (use `event-storming`), broad interface contracts (use `system-interface-contracts`), inbound provider webhook mechanics (use `webhook-integration`), or HTTP endpoint design (use `api-design`). Do NOT use for discover the domain events, commands, and policies in this business process. Do NOT use for define every boundary contract between services, jobs, and APIs. Do NOT use for verify inbound provider webhook signatures and retry behavior. Do NOT use for design REST endpoints, status codes, and pagination.
Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation.
Coverage
Design asynchronous event contracts for producers and consumers. Covers event envelope, schema, event type, topic/channel naming, producer ownership, consumer expectations, required and optional fields, idempotency keys, ordering, causation and correlation IDs, schema evolution, replay, dead-letter behavior, compatibility, observability, and machine-readable documentation such as AsyncAPI or CloudEvents-style metadata.
Philosophy of the skill
An event is a public promise once another consumer depends on it. If the payload, ordering, retry, or compatibility rules are implicit, every consumer invents its own interpretation and the event stream becomes shared folklore.
Do not confuse event discovery with event contracts. Discovery asks what happened in the domain. Contract design asks what exactly will be published, consumed, replayed, and evolved.
Method
Name the producer, owner, intended consumers, and event purpose.
Separate business event type from transport topic or queue name.
Define envelope fields: id, type, source, time, subject, schema version, correlation, causation, tenant, and idempotency key.
Define payload schema with required, optional, nullable, and deprecated fields.
State ordering, delivery, retry, replay, and dead-letter expectations.
Add observability fields needed to reconstruct publishing and consumption failures.
Provide at least one positive and one negative contract fixture.
Evals
This skill ships a comprehension-eval artifact at examples/evals/event-contract-design.json. The checklist below is the authoring gate for async event contracts; the eval file is the grader surface.
Verification
Producer, owner, and consumers are named
Event type, topic/channel, envelope, and payload are distinct
Required, optional, nullable, and deprecated fields are explicit
Idempotency, ordering, retry, replay, and dead-letter behavior are stated
Compatibility rules distinguish additive from breaking changes
Correlation and causation IDs cross async boundaries
Positive and negative fixtures exist for contract testing
Do NOT Use When
Use instead
When
event-storming
You are still discovering domain events, commands, policies, aggregates, or timelines.
system-interface-contracts
The boundary is not specifically asynchronous events or messages.
webhook-integration
You are implementing inbound provider webhooks, signatures, retries, and raw payload handling.
api-design
You are designing HTTP endpoints, status codes, pagination, filtering, or error envelopes.
observability-modeling
The event contract is settled and the task is telemetry design.
Skill Graph context
Classification
Subject: software-architecture
Public: true
Domain: architecture/events
Scope: Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation. Do NOT use for domain-event discovery (use event-storming), broad interface contracts (use system-interface-contracts), inbound provider webhook mechanics (use webhook-integration), or HTTP endpoint design (use api-design).
When to use
design the event contract for publishing OrderPaid to downstream consumers
define topic names, payload schema, idempotency, and versioning for this event stream
review this outbound webhook event schema before customers integrate with it
write the compatibility rules for consumers of these async messages
Not for
discover the domain events, commands, and policies in this business process
define every boundary contract between services, jobs, and APIs
verify inbound provider webhook signatures and retry behavior
design REST endpoints, status codes, and pagination
1---2name: event-contract-design3description: Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation. Do NOT use for domain-event discovery (use `event-storming`), broad interface contracts (use `system-interface-contracts`), inbound provider webhook mechanics (use `webhook-integration`), or HTTP endpoint design (use `api-design`). Do NOT use for discover the domain events, commands, and policies in this business process. Do NOT use for define every boundary contract between services, jobs, and APIs. Do NOT use for verify inbound provider webhook signatures and retry behavior. Do NOT use for design REST endpoints, status codes, and pagination.4license: MIT5---6# Event Contract Design78## Concept of the skill910Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation.1112## Coverage1314Design asynchronous event contracts for producers and consumers. Covers event envelope, schema, event type, topic/channel naming, producer ownership, consumer expectations, required and optional fields, idempotency keys, ordering, causation and correlation IDs, schema evolution, replay, dead-letter behavior, compatibility, observability, and machine-readable documentation such as AsyncAPI or CloudEvents-style metadata.1516## Philosophy of the skill17An event is a public promise once another consumer depends on it. If the payload, ordering, retry, or compatibility rules are implicit, every consumer invents its own interpretation and the event stream becomes shared folklore.1819Do not confuse event discovery with event contracts. Discovery asks what happened in the domain. Contract design asks what exactly will be published, consumed, replayed, and evolved.2021## Method22231. Name the producer, owner, intended consumers, and event purpose.242. Separate business event type from transport topic or queue name.253. Define envelope fields: id, type, source, time, subject, schema version, correlation, causation, tenant, and idempotency key.264. Define payload schema with required, optional, nullable, and deprecated fields.275. State ordering, delivery, retry, replay, and dead-letter expectations.286. Define compatibility rules: additive fields, breaking changes, versioning, deprecation, and consumer migration.297. Add observability fields needed to reconstruct publishing and consumption failures.308. Provide at least one positive and one negative contract fixture.3132## Evals3334This skill ships a comprehension-eval artifact at [`examples/evals/event-contract-design.json`](https://github.com/jacob-balslev/skill-graph/blob/main/examples/evals/event-contract-design.json). The checklist below is the authoring gate for async event contracts; the eval file is the grader surface.3536## Verification3738- [ ] Producer, owner, and consumers are named39- [ ] Event type, topic/channel, envelope, and payload are distinct40- [ ] Required, optional, nullable, and deprecated fields are explicit41- [ ] Idempotency, ordering, retry, replay, and dead-letter behavior are stated42- [ ] Compatibility rules distinguish additive from breaking changes43- [ ] Correlation and causation IDs cross async boundaries44- [ ] Positive and negative fixtures exist for contract testing4546## Do NOT Use When4748| Use instead | When |49|---|---|50| `event-storming` | You are still discovering domain events, commands, policies, aggregates, or timelines. |51| `system-interface-contracts` | The boundary is not specifically asynchronous events or messages. |52| `webhook-integration` | You are implementing inbound provider webhooks, signatures, retries, and raw payload handling. |53| `api-design` | You are designing HTTP endpoints, status codes, pagination, filtering, or error envelopes. |54| `observability-modeling` | The event contract is settled and the task is telemetry design. |5556## Skill Graph context5758<!-- skill-graph-context:start (generated — do not edit by hand) -->5960**Classification**61- Subject: `software-architecture`62- Public: `true`63- Domain: `architecture/events`64- Scope: Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation. Do NOT use for domain-event discovery (use `event-storming`), broad interface contracts (use `system-interface-contracts`), inbound provider webhook mechanics (use `webhook-integration`), or HTTP endpoint design (use `api-design`).6566**When to use**67- design the event contract for publishing OrderPaid to downstream consumers68- define topic names, payload schema, idempotency, and versioning for this event stream69- review this outbound webhook event schema before customers integrate with it70- write the compatibility rules for consumers of these async messages7172**Not for**73- discover the domain events, commands, and policies in this business process74- define every boundary contract between services, jobs, and APIs75- verify inbound provider webhook signatures and retry behavior76- design REST endpoints, status codes, and pagination7778**Related skills**79- Verify with: `system-interface-contracts`, `observability-modeling`, `real-time-updates`80- Related: `api-design`, `state-machine-modeling`, `entity-relationship-modeling`, `event-storming`, `system-interface-contracts`, `observability-modeling`, `webhook-integration`8182**Keywords**83- `event-contract`, `async-api`, `cloudevents`, `event envelope`, `topic naming`, `async event schema`, `event compatibility`, `replay contract`, `dead-letter behavior`, `consumer fixtures`8485<!-- skill-graph-context:end -->
Run npx skillmds@latest add jacob-balslev/event-contract-design in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when designing or reviewing asynchronous event contracts: producer/consumer ownership, event envelope, schema, topic/channel naming, ordering, idempotency, versioning, compatibility, replay, dead-letter behavior, and AsyncAPI/CloudEvents-style documentation. Do NOT use for domain-event discovery (use `event-storming`), broad interface contracts (use `system-interface-contracts`), inbound provider webhook mechanics (use `webhook-integration`), or HTTP endpoint design (use `api-design`). Do NOT use for discover the domain events, commands, and policies in this business process. Do NOT use for define every boundary contract between services, jobs, and APIs. Do NOT use for verify inbound provider webhook signatures and retry behavior. Do NOT use for design REST endpoints, status codes, and pagination. It is listed under Product & Planning on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: makes network calls. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
jacob-balslev (@jacob-balslev) published this skill. Their other Agent Skills are listed on their SkillMD profile.