Architecture Event Driven logo

Architecture Event Driven

Community
j4flmao
architecture-event-driven

Use this skill when the user says 'event-driven architecture', 'EDA', 'pub/sub between services', 'domain events', 'Kafka vs RabbitMQ vs SQS', 'dual write', 'transactional outbox', 'event schema', 'eventual consistency', 'choreography'. Designs asynchronous service integration: event vs command semantics, broker choice, delivery guarantees, outbox/inbox, ordering and partitioning, schema evolution, and tracing. Do NOT use for: implementation recipes inside one backend stack (backend/universal/event-driven, backend/universal/transactional-outbox), event sourcing as a persistence model (backend/universal/event-sourcing), or stream analytics (data/streaming).

Overview

Publisherj4flmao
Repositoryagent-skills
Skill namearchitecture-event-driven
Stars
41
Forks
6
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by j4flmao on GitHub. Read the source before you install it.

Installation

Install the Architecture Event Driven AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-driven
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/architecture/event-driven .claude/skills/architecture-event-driven
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Architecture Event Driven in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Architecture Event Driven on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Architecture Event Driven is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Event-Driven Architecture

Purpose

In EDA, services publish facts ("OrderPlaced") and other services react, so producers do not depend on consumers being available or even known. The price is eventual consistency, harder debugging, and the need for reliable publishing and idempotent consumption. This skill covers the architectural decisions that make EDA correct, not just decoupled.

Agent Protocol

Trigger

"event-driven", "EDA", "domain events", "pub/sub", "message broker choice", "dual-write problem", "outbox", "at-least-once", "event ordering", "event versioning", "choreography".

Input Context

  • Business flows and which steps must be synchronous for the user.
  • Throughput, ordering needs (per entity?), retention/replay needs.
  • Existing infra (Kafka, RabbitMQ, cloud queues) and team experience.
  • Consistency requirements and failure tolerance.

Output Artifact

Event catalog, broker/topology choice, delivery and idempotency design, schema/versioning policy, observability plan.

Response Format

Event: {Name}(past tense) v{n}  Producer: {service}  Consumers: {services}
Key (ordering): {aggregate id}  Topic/queue: {name}  Retention: {duration}
Publish: outbox -> {relay: CDC|poller}  Delivery: at-least-once
Consumer: idempotent via {inbox table|natural upsert}; DLQ: {name}
Schema: {Avro|Protobuf|JSON Schema} compatibility={BACKWARD}

Completion Criteria

  • Each message classified as event (fact) or command (request).
  • No dual writes: outbox or CDC for publishing.
  • Consumers idempotent; DLQ and retry policy defined.
  • Ordering key chosen per aggregate where order matters.
  • Trace context propagated in message headers.

Events vs Commands vs Queries

KindMeaningAddressed toCan be rejected?Transport
Event"OrderPlaced" happenedAnyone interestedNo (it is a fact)Topic / pub-sub
Command"ReserveStock" pleaseOne ownerYesQueue or RPC
Query"What is the stock?"One ownern/aSync RPC

Event payload style: thin events (id + type; consumers call back for details) couple consumers to the producer API at read time; fat/event-carried state transfer (include the relevant data) lets consumers build local read models. Prefer fat events for integration, scoped to what consumers need.

Broker Choice

BrokerModelStrengthsWatch out
Kafka (or Redpanda)Partitioned replicated logReplay, high throughput, per-partition order, many consumer groupsOps complexity; ordering only within a partition
RabbitMQQueues with exchanges/routingFlexible routing, per-message acks, prioritiesReplay limited (streams feature helps)
AWS SNS + SQSFan-out topic → queuesManaged, simpleStandard queues unordered; FIFO queues have lower throughput
Google Pub/Sub, Azure Service Bus/Event HubsManaged pub/sub / logManaged scalingProvider-specific semantics
NATS JetStreamStreams + consumersLightweight, low latencySmaller ecosystem

Reliable Publishing: Transactional Outbox

Writing to the database and the broker separately can lose or invent events when one write fails. Write the event to an outbox table in the same transaction as the state change, then relay it.

sql
CREATE TABLE outbox (
  id            BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  event_id      UUID NOT NULL UNIQUE,          -- consumers dedupe on this
  aggregate_id  TEXT NOT NULL,                 -- becomes the message key
  event_type    TEXT NOT NULL,
  payload       JSONB NOT NULL,
  created_at    TIMESTAMPTZ NOT NULL DEFAULT now(),
  published_at  TIMESTAMPTZ
);

BEGIN;
INSERT INTO orders (id, customer_id, total_cents) VALUES ($1, $2, $3);
INSERT INTO outbox (event_id, aggregate_id, event_type, payload)
VALUES ($4, $1, 'OrderPlaced.v1', $5);
COMMIT;

Relay options:

  • CDC (Debezium reading the WAL, with its outbox event router): low latency, no polling load.
  • Poller: SELECT ... WHERE published_at IS NULL ORDER BY id LIMIT 100 FOR UPDATE SKIP LOCKED, publish, then mark published. Simple; a crash between publish and mark causes a duplicate, which consumers must tolerate.

Either way delivery is at-least-once, never exactly-once end to end.

Idempotent Consumers (Inbox)

python
def handle(message, conn) -> None:
    event_id = message.headers["event_id"]
    with conn.transaction():
        inserted = conn.execute(
            "INSERT INTO inbox (event_id, received_at) VALUES (%s, now()) ON CONFLICT DO NOTHING",
            (event_id,),
        ).rowcount
        if inserted == 0:
            return                      # duplicate: already processed
        apply_business_change(conn, message.value)
    # commit offset / ack only after the transaction commits

Retry transient failures with bounded backoff; route poison messages to a dead-letter queue with the error attached; alert on DLQ depth.

Ordering and Partitioning

  • Order is only guaranteed within a partition/queue; use the aggregate id as the key so all events for one order land in order.
  • Consumers must not assume global order across aggregates.
  • Carry a per-aggregate version/sequence number so consumers can detect gaps or stale events.

Schema and Versioning

  • Use a schema registry (Avro/Protobuf/JSON Schema) with compatibility checks in CI.
  • Additive changes only (new optional fields); breaking change = new event type/version (OrderPlaced.v2), dual-publish during migration.
  • Standard envelope: CloudEvents attributes (id, source, type, specversion, time, subject) plus W3C traceparent header.

Observability

Propagate trace context through message headers (OpenTelemetry messaging conventions) so one trace links the HTTP request, the outbox relay, and every consumer. Track consumer lag, DLQ depth, and end-to-end latency (event time → processed time).

Hazards

HazardMitigation
Event pinball (chains across many services)Distributed tracing; prefer an orchestrated saga for multi-step business processes
Eventual consistency surprises in UIOptimistic UI, read-your-writes from the owning service, status polling or push
Consumer coupling to producer internalsPublish integration events, not table-row changes
Unbounded retries blocking a partitionRetry topics / DLQ with backoff
Lost events from dual writesOutbox or CDC only

Checklist

  • Event catalog with owners, keys, schemas, consumers.
  • Outbox/CDC publishing; no direct broker write inside business transactions.
  • Inbox or natural idempotency on every consumer.
  • DLQ + alerting; replay procedure documented.
  • Schema registry and compatibility gate.
  • Tracing headers and lag dashboards.

References

  • CQRS & Event Sourcing — read models and event-sourced aggregates.
  • Richardson, "Microservices Patterns" — transactional outbox, saga.
  • Debezium documentation: outbox event router; CloudEvents specification (CNCF).

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Architecture Event Driven AI skill do?

Use this skill when the user says 'event-driven architecture', 'EDA', 'pub/sub between services', 'domain events', 'Kafka vs RabbitMQ vs SQS', 'dual write', 'transactional outbox', 'event schema', 'eventual consistency', 'choreography'. Designs asynchronous service integration: event vs command semantics, broker choice, delivery guarantees, outbox/inbox, ordering and partitioning, schema evolution, and tracing. Do NOT use for: implementation recipes inside one backend stack (backend/universal/event-driven, backend/universal/transactional-outbox), event sourcing as a persistence model (backe...

Why use Architecture Event Driven on TypingMind?

Because you install it once and use it with any model. Architecture Event Driven is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Architecture Event Driven in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-driven. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Architecture Event Driven?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Architecture Event Driven?

As many as you like. As long as a model supports skills, you can use Architecture Event Driven with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Architecture Event Driven AI skill free?

Yes. It is published on GitHub by j4flmao under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇