design-event
Skill1 starsChanged 2 months agoMITView on GitHub
Design the schema and semantics of a domain event before publishing it — event vs command, name, payload (thin vs fat), key, versioning, delivery guarantee, and how consumers classify failures. Use when adding a queue message / Kafka topic / webhook, or when asked to "design the event" / "what should this message contain".
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bigquery-analyticsSkill
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- redis-patternsSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- data-migrationSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- debug-with-tracesSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- rebase-cleanSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- kafkaSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Prefer events for decoupling.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Design an event
The event is a contract — usually with more consumers than you know about. Design
it like an API (design/evolve-contract governs changes).
Event vs command
- Event — a fact that happened, past tense:
OrderPlaced,UserDeactivated. The publisher doesn't know or care who consumes it. - Command — an instruction to do something:
SendWelcomeEmail. One intended handler.
Prefer events for decoupling; use commands when there's genuinely one owner.
Payload
- Thin (event-carried key + minimal data) — consumers fetch what they need. Smaller, less coupling to producer's model, but N lookups. Good when consumers need different subsets.
- Fat (event carries the full state) — no lookup needed, but couples every consumer to the producer's shape and leaks data. Good for audit/replay, or a known small consumer set.
- Extended-key middle ground — carry the key plus the 2–3 fields every consumer displays.
- Include: a unique event id (for dedup), occurred-at timestamp, the aggregate id, an explicit type and version, and a trace context for correlation. No secrets / PII beyond what consumers are entitled to.
Semantics
- Ordering — guaranteed only per partition key. Choose the key so events that must be ordered share it (all events for one order → key = order id).
- Delivery — at-least-once is the norm → consumers must be idempotent (dedup on event id, or design the handler to be naturally idempotent).
- Failure classification — every consumer must decide, per error: terminal
(drop / DLQ) or retryable (redeliver). An unclassified error redelivers forever
(
queues/sqs-consumer,queues/kafka).
Versioning
- Consumers tolerate unknown fields (forward-compatible) — state this.
- Additive changes (new optional field) are safe.
- Renaming / removing / retyping a field, or renaming the event → breaking. Dual-publish old + new through a window, or bump the version and migrate consumers.
Output
The event name, direction (event/command), payload schema with the envelope fields, the partition key rationale, delivery guarantee, and the consumer idempotency requirement. Register it wherever the org keeps event schemas.
Anti-patterns
- ❌ Present-tense / imperative names for events (
CreateOrderas an event). - ❌ No event id → consumers can't dedup an at-least-once delivery.
- ❌ Fat payloads that couple every consumer to the producer's DB schema.
- ❌ A partition key that doesn't group events needing order.
- ❌ Renaming a field in place.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

