← ClaudeAtlas

event-driven-messaginglisted

Use when a ticket connects components through events or messages — publishing domain events, consuming from a topic or stream, an event bus, pub/sub, change-data-capture — and the design must define ownership of each event, its schema and versioning, delivery guarantees, ordering, and how consumers stay idempotent. Invoke for "emit an event when X", "subscribe to Y", "add a consumer", "events are arriving out of order", or any Kafka/SNS/SQS/NATS/Redis Streams work.
tmj-90/gaffer · ★ 1 · AI & Automation · score 70
Install: claude install-skill tmj-90/gaffer
# Design event-driven messaging Brokers deliver at least once, redeliver after crashes and rebalances, reorder across partitions, and replay on demand. Events decouple services only when each event is an owned, versioned contract, is published atomically with the state change (transactional outbox), and every consumer is idempotent (inbox) and tolerant of order and replay. ## Steps 1. **Use the repo's infrastructure.** The broker, client library, topic naming, envelope and schema registry. Call `search_lore` for them and for declared ownership boundaries. One bus per repo; no new broker for one event. 2. **Design the event as a contract.** A past-tense fact (`order.placed`), owned by one producer. Envelope with a unique event `id`, `type`, `source`, `time`, schema version, `subject`/entity key and correlation id (CloudEvents names these; use them if the repo has no envelope). Payload: identifiers plus the facts consumers need, never internal table rows or secrets. Register the schema where the repo keeps them and pin it with a contract test (the `contract-test` skill). Additive changes only; a breaking change is a new event type or version (the `api-versioning` skill). 3. **Publish with a transactional outbox.** Insert the event into an outbox table in the same transaction as the domain write; a relay (polling with `FOR UPDATE SKIP LOCKED`, or log tailing/CDC such as Debezium) publishes and marks it sent. Publishing to the broker inside or