1---
2name: event-contract-design
3description: "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`)."
4license: MIT
5compatibility: "Portable async-event contract guidance for queues, streams, pub/sub, internal events, outbound webhooks, and documented event-driven APIs."
6allowed-tools: Read Grep
7metadata:
8 source: https://skillmd.com/skills/aibot88/event-contract-design
9 schema_version: "4"
10 version: "1.0.0"
11 type: capability
12 category: engineering
13 domain: architecture/events
14 scope: portable
15 owner: skill-graph-maintainer
16 freshness: "2026-05-11"
17 drift_check: "{\"last_verified\":\"2026-05-11\"}"
18 eval_artifacts: present
19 eval_state: unverified
20 routing_eval: absent
21 stability: experimental
22 keywords: "[\"event-contract\",\"async-api\",\"cloudevents\",\"event envelope\",\"topic naming\",\"async event schema\",\"event compatibility\",\"replay contract\",\"dead-letter behavior\",\"consumer fixtures\"]"
23 examples: "[\"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\"]"
24 anti_examples: "[\"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\"]"
25 relations: "{\"boundary\":[{\"skill\":\"event-storming\",\"reason\":\"event-storming discovers domain events and policies; event-contract-design turns selected events into publishable contracts\"},{\"skill\":\"system-interface-contracts\",\"reason\":\"system-interface-contracts owns broad boundary contracts; event-contract-design owns asynchronous message and event surfaces\"},{\"skill\":\"webhook-integration\",\"reason\":\"webhook-integration owns inbound third-party delivery mechanics; event-contract-design owns events this system publishes or documents for consumers\"},{\"skill\":\"api-design\",\"reason\":\"api-design owns HTTP resource and action surfaces; event-contract-design owns asynchronous event contracts\"}],\"related\":[\"event-storming\",\"system-interface-contracts\",\"observability-modeling\",\"state-machine-modeling\",\"data-modeling\"],\"verify_with\":[\"system-interface-contracts\",\"observability-modeling\"]}"
26 portability: "{\"readiness\":\"scripted\",\"targets\":[\"skill-md\"]}"
27 lifecycle: "{\"stale_after_days\":365,\"review_cadence\":\"quarterly\"}"
28 skill_graph_source_repo: "https://github.com/jacob-balslev/skill-graph"
29 skill_graph_protocol: Skill Metadata Protocol v3
30 skill_graph_project: Skill Graph
31 skill_graph_canonical_skill: skills/event-contract-design/SKILL.md
32---
33
34# Event Contract Design
35
36## Coverage
37
38Design 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.
39
40## Philosophy
41
42An 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.
43
44Do 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.
45
46## Method
47
481. Name the producer, owner, intended consumers, and event purpose.
492. Separate business event type from transport topic or queue name.
503. Define envelope fields: id, type, source, time, subject, schema version, correlation, causation, tenant, and idempotency key.
514. Define payload schema with required, optional, nullable, and deprecated fields.
525. State ordering, delivery, retry, replay, and dead-letter expectations.
536. Define compatibility rules: additive fields, breaking changes, versioning, deprecation, and consumer migration.
547. Add observability fields needed to reconstruct publishing and consumption failures.
558. Provide at least one positive and one negative contract fixture.
56
57## Evals
58
59This 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.
60
61## Verification
62
63- [ ] Producer, owner, and consumers are named
64- [ ] Event type, topic/channel, envelope, and payload are distinct
65- [ ] Required, optional, nullable, and deprecated fields are explicit
66- [ ] Idempotency, ordering, retry, replay, and dead-letter behavior are stated
67- [ ] Compatibility rules distinguish additive from breaking changes
68- [ ] Correlation and causation IDs cross async boundaries
69- [ ] Positive and negative fixtures exist for contract testing
70
71## Do NOT Use When
72
73| Use instead | When |
74|---|---|
75| `event-storming` | You are still discovering domain events, commands, policies, aggregates, or timelines. |
76| `system-interface-contracts` | The boundary is not specifically asynchronous events or messages. |
77| `webhook-integration` | You are implementing inbound provider webhooks, signatures, retries, and raw payload handling. |
78| `api-design` | You are designing HTTP endpoints, status codes, pagination, filtering, or error envelopes. |
79| `observability-modeling` | The event contract is settled and the task is telemetry design. |