This skill should be used when the user asks to "design an event-driven system", "build an event catalog", "implement CQRS", "design saga patterns", or mentions Kafka, RabbitMQ, Pulsar, event bus, dead-letter queue, or event sourcing. [EXPLICIT] It generates event-driven architecture artifacts including event catalogs, schema registry designs, consistency patterns (sagas, outbox, idempotency), CQRS models, and operational runbooks. [EXPLICIT] Use this skill whenever the user needs asynchronous messaging architecture, even if they don't explicitly ask for "event architecture". [EXPLICIT]
From jm-adknpx claudepluginhub javimontano/jm-adk-alfaThis skill is limited to using the following tools:
agents/guardian.mdagents/lead.mdagents/specialist.mdagents/support.mdevals/evals.jsonknowledge/body-of-knowledge.mdknowledge/knowledge-graph.mdprompts/meta.mdprompts/primary.mdprompts/variations/deep.mdprompts/variations/quick.mdreferences/event-patterns.mdtemplates/output.docx.mdtemplates/output.htmlSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Event-driven architecture decouples producers from consumers through asynchronous messaging — enabling scalability, resilience, and temporal flexibility. The skill covers event catalog design, broker selection, schema governance, consistency patterns (sagas, CQRS, event sourcing), and the operational practices that keep event systems reliable. [EXPLICIT]
Los eventos son hechos inmutables — no mensajes descartables. Un evento publicado es historia del sistema. El catálogo de eventos es el system of record, el schema registry previene breaking changes, y la consistencia eventual es una feature, no un bug.
The user provides a system or platform name as $ARGUMENTS. Parse $1 as the system/platform name used throughout all output artifacts. [EXPLICIT]
Parameters:
{MODO}: piloto-auto (default) | desatendido | supervisado | paso-a-paso
{FORMATO}: markdown (default) | html | dual{VARIANTE}: ejecutiva (~40% — S1 catalog + S3 schema registry + S4 consistency) | técnica (full 6 sections, default)Before generating event architecture, detect the codebase context:
!find . -name "*.yaml" -o -name "*.json" -o -name "*.avro" -o -name "*.proto" -o -name "*event*" -o -name "*kafka*" -o -name "*rabbit*" | head -30
Use detected event definitions, broker configurations, and schema files to tailor catalog structure, pattern recommendations, and operational guidance. [EXPLICIT]
If reference materials exist, load them:
Read ${CLAUDE_SKILL_DIR}/references/event-patterns.md
Establish naming conventions, event types, and a discoverable catalog of all events. [EXPLICIT]
Event naming: <Domain>.<Entity>.<Action> (e.g., Order.Payment.Completed)
Event type classification:
CloudEvents Standard (CNCF) — vendor-neutral event envelope for interoperability:
id, source, specversion (1.0), typetime, datacontenttype, dataschema, subjectEvent Granularity Decision Matrix:
| Type | Payload | Coupling | Latency | When to use |
|---|---|---|---|---|
| Notification (thin) | Signal only: { orderId } | Low (consumer fetches via API) | Higher (API callback) | Default starting point; consumer has API access |
| State Transfer (fat) | Full state: { orderId, items[], total } | Higher (schema dependency) | Lower (self-contained) | Consumer needs embedded data; API callback adds unacceptable latency |
| Delta | Changed fields only: { orderId, status: "shipped" } | Medium | Lowest | Consumer maintains local state; bandwidth-constrained |
Rule of thumb: start thin, fatten only when consumers demonstrably need embedded data. [EXPLICIT]
Key decisions:
Select and configure the message broker for reliability, throughput, and operational simplicity. [EXPLICIT]
Broker Selection Matrix:
| Criterion | Apache Kafka | RabbitMQ | Apache Pulsar | Cloud-native (SNS+SQS, Event Grid, Pub/Sub) |
|---|---|---|---|---|
| Throughput | Millions msg/sec | Tens of thousands | Millions msg/sec | Varies by service |
| Replay | Native (log-based) | Not built-in | Native (tiered storage) | Limited |
| Latency | Low-medium (batching) | Sub-millisecond | Low | Medium |
| Ordering | Per-partition | Per-queue | Per-partition | Varies |
| Multi-tenancy | Topic-level | Vhost-level | Native | Native |
| Ops complexity | High (ZK/KRaft) | Low-medium | Medium-high | Managed |
| Best for | High-volume, event sourcing | Task queues, RPC, simple routing | Multi-tenant, geo-replicated | Serverless, low ops budget |
Critical Kafka Configurations for Reliability:
acks=all — wait for all in-sync replicas to acknowledge (mandatory for durability)min.insync.replicas=2 — require at least 2 replicas in sync before accepting writesenable.idempotence=true — prevent duplicate messages from producer retriesmax.in.flight.requests.per.connection=5 — safe with idempotence enabledConsumer Group Strategies:
partition.assignment.strategy=cooperative-sticky) to minimize partition shuffling during scalingauto.offset.reset=earliest for isolated replayPartitioning: By entity ID (ordering guarantee), by tenant (isolation), round-robin (max throughput) Retention: Time-based (7-30 days typical) or log compaction for latest-state topics
Govern schema evolution to prevent producer-consumer contract breaks. [EXPLICIT]
Platforms: Confluent Schema Registry, AWS Glue Schema Registry, Apicurio Formats: Avro (compact, best Kafka integration), Protobuf (strong typing, gRPC bridge), JSON Schema (readable, flexible)
Compatibility Modes:
| Mode | Rule | Safe changes | Use when |
|---|---|---|---|
| Backward (recommended default) | New schema reads old data | Add optional fields, remove fields with defaults | Consumers upgrade before producers |
| Forward | Old schema reads new data | Remove optional fields, add fields with defaults | Producers upgrade before consumers |
| Full | Both directions | Only add/remove optional fields with defaults | Maximum safety, most restrictive |
| None | No checks | Anything | Never in production |
CI/CD integration: Block deployments that break schema compatibility. Run schema validation on every PR that modifies event definitions.
Manage distributed consistency without distributed transactions. [EXPLICIT]
Saga Pattern Comparison:
| Aspect | Orchestration | Choreography |
|---|---|---|
| Coordination | Central orchestrator | Decentralized, event-driven |
| Visibility | Clear flow, centralized state | Emergent, hard to trace |
| Coupling | Orchestrator depends on all services | Services loosely coupled |
| Error handling | Centralized compensation logic | Distributed, each service handles own |
| Best for | Complex multi-step (4+ services), financial | Simple 2-3 step workflows |
Outbox Pattern for Reliable Publishing:
outbox table in one DB transaction (atomicity guaranteed)Outbox table schema: id, aggregate_type, aggregate_id, event_type, payload, created_at, published_at
Relay Options:
| Method | Latency | Complexity | When to use |
|---|---|---|---|
| Polling | Higher (poll interval) | Low (simple query) | Small-medium volume, ops simplicity |
| CDC (Debezium) | Near-real-time | Higher (Kafka Connect, connector config) | High volume, low-latency requirement |
Debezium reads the database WAL/binlog and streams outbox rows to Kafka. Use the outbox.event.router SMT to transform CDC records into clean business events. [EXPLICIT]
Inbox pattern: Consumer writes received event to inbox table, deduplicates by event ID, processes idempotently.
Idempotency: Every consumer must safely process the same event twice. Use idempotency keys stored in a deduplication table with TTL.
Separate read and write models; optionally store state as a sequence of events. [EXPLICIT]
CQRS:
Event Sourcing:
Decision criteria:
Ensure event systems are reliable, observable, and recoverable in production. [EXPLICIT]
Dead-Letter Topic (DLT) Management:
Poison Pill Detection:
Consumer Lag Monitoring:
Event Replay:
Observability: Distributed tracing with correlationId through entire event chain. Metrics: producer rate, consumer rate, lag, DLT depth, processing duration histograms.
| Decision | Enables | Constrains | When to Use |
|---|---|---|---|
| Kafka | High throughput, replay, persistence | Ops complexity, partition management | High-volume, event sourcing, log-based |
| RabbitMQ | Flexible routing, low latency, simpler ops | No replay, limited persistence | Task queues, RPC, moderate volume |
| Orchestrated Saga | Clear flow, centralized error handling | Coordinator coupling | Complex multi-step, financial transactions |
| Choreographed Saga | Loose coupling, independent deployment | Hard to trace, debug | Simple 2-3 service workflows |
| Event Sourcing | Full audit, temporal queries, replay | Complexity, storage growth, schema evolution | Financial, compliance, audit-critical domains |
| CQRS without ES | Read/write optimization, simpler | Projection sync, eventual consistency | Reporting-heavy, different read/write patterns |
| Outbox Pattern | Reliable publishing, transactional guarantee | Additional table, relay infrastructure | Any event system needing reliability |
Migrating from Synchronous to Event-Driven: Strangler fig pattern. Identify highest-value async boundaries first (long-running processes, fan-out notifications). Run sync and async in parallel during transition.
Schema Evolution in Production: Consumers at different versions. Backward-compatible changes only. Deploy consumers before producers when adding required fields. Schema registry enforces compatibility.
Event Ordering Across Partitions: Global ordering is expensive. Most systems need per-entity ordering (same partition key). If cross-entity ordering matters, single partition (throughput trade-off) or timestamp-based reconciliation.
High-Volume Event Storms: Burst traffic overwhelms consumers. Use backpressure, consumer auto-scaling, circuit breakers. DLT prevents one bad event from blocking the stream.
Multi-Region: Cross-region replication adds latency. Define global vs. regional events. Use CRDTs or last-writer-wins for cross-region consistency.
Before finalizing delivery, verify:
Domain.Entity.Action)| Format | Default | Description |
|---|---|---|
markdown | ✅ | Rich Markdown + Mermaid diagrams. Token-efficient. |
html | On demand | Branded HTML (Design System). Visual impact. |
dual | On demand | Both formats. |
Default output is Markdown with embedded Mermaid diagrams. HTML generation requires explicit {FORMATO}=html parameter. [EXPLICIT]
Primary: A-01_Event_Architecture.html — Executive summary, event catalog, broker architecture, schema registry design, consistency patterns, CQRS/event sourcing design, operational runbook.
Secondary: AsyncAPI specifications, event schema definitions, saga flow diagrams, DLT handling procedures, consumer lag dashboard configuration.
Author: Javier Montano | Last updated: March 18, 2026