Logo di Architecture Event Driven

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).

Panoramica

Autorej4flmao
Repositoryagent-skills
Nome della skillarchitecture-event-driven
Stelle
41
Fork
6
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 1 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da j4flmao su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Architecture Event Driven in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-driven
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Architecture Event Driven in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Architecture Event Driven non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Architecture Event Driven non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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).

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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 (backe...

Perché usare Architecture Event Driven su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Architecture Event Driven è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Architecture Event Driven in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/event-driven. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Architecture Event Driven?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Architecture Event Driven?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Architecture Event Driven: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Architecture Event Driven è gratuita?

Sì. È pubblicata su GitHub da j4flmao con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇