agentleFS
MohOneXMohOneX/claude-opus-skills/event-driven-architecture/SKILL.md

event-driven-architecture

Skill0 starsChanged 6 months agoMITView on GitHub

Designs event-driven and message-based systems reasoning about delivery semantics, ordering, idempotency, and schema evolution. Use when introducing queues/streams, decoupling services via events, debugging duplicate or out-of-order processing, or choosing between events, commands, and request/response.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 2

    Distinctive

    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
  1. Distinctive:

    Query: read, needs a response — usually wrong to do over async eventing.

    line 14
  2. Distinctive:

    Idempotency: every consumer must dedupe (idempotency key, processed-offset, natural idempotency).

    line 22

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Event-Driven Architecture

Asynchrony buys decoupling and pays in uncertainty. Every event system is at-least-once and unordered until you prove otherwise; design as if every message can duplicate, arrive late, and arrive out of order.

Events vs commands vs queries — they are not interchangeable

  • Event ("OrderPlaced"): a fact that happened. Multiple consumers, no expectation of response, sender doesn't know who listens.
  • Command ("PlaceOrder"): a request to do something. One handler, can be rejected.
  • Query: read, needs a response — usually wrong to do over async eventing.

Modeling a command as an event (or vice versa) creates either tight coupling or lost intent.

The four guarantees you must pin down

  1. Delivery: at-most-once (may lose) vs at-least-once (may duplicate). Exactly-once processing = at-least-once delivery + idempotent consumers. There is no free exactly-once.
  2. Ordering: global order rarely exists. Per-partition/per-key order is achievable; cross-key order is not. Choose partition keys so causally related events share a partition.
  3. Idempotency: every consumer must dedupe (idempotency key, processed-offset, natural idempotency). This is not optional under at-least-once.
  4. Durability/retention: how long can a slow consumer be down before data is lost? Replayability changes recovery options entirely.

Adversarial validation

  • A consumer processes a message, crashes before ack: the message redelivers. Does reprocessing double-charge / double-send?
  • Events arrive out of order: "ItemRemoved" before "ItemAdded". Does state converge correctly, or get stuck?
  • A poison message fails forever: does it block the partition (head-of-line) and stall everything behind it? (Need dead-letter queue + alerting.)
  • A consumer falls behind: does the queue grow unbounded (and where's the back-pressure), or drop data silently?
  • Producer and consumer deploy independently with different schema versions: does the old consumer crash on a new field?

Non-obvious risks

  • Distributed monolith: events that are really synchronous calls in disguise (request → wait for response event) get all the async pain with none of the decoupling.
  • Event sourcing trap: storing events as source of truth makes schema evolution permanent — you can never delete or change the meaning of a historical event type.
  • Lost causality: "eventually consistent" reads built from events can show effects before causes to users.
  • Schema changes are forever in a stream with long retention; additive-only evolution + tolerant readers are mandatory.

Output structure

Deliver: the event/command/query classification, the four guarantees stated explicitly (delivery, ordering with partition key, idempotency mechanism, retention/replay), the dead-letter + back-pressure design, the schema-evolution rules, and a redelivery/out-of-order scenario traced to a convergent state.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.