.agents/skills/event-driven/SKILL.md
Event-driven architecture patterns and best practices. Covers Saga, Outbox, CQRS, Event Sourcing, and messaging patterns for distributed systems. USE WHEN: user mentions "event-driven", "Saga", "Outbox pattern", "CQRS", "Event Sourcing", "distributed transactions", "eventual consistency", "message broker", "event bus", asks about "microservices communication", "async patterns", "compensating transactions" DO NOT USE FOR: Simple pub/sub - use messaging framework skills (Kafka, RabbitMQ), REST APIs - use API design skills, Real-time updates - use WebSocket skills, Basic async/await - use language-specific skills
npx skillsauth add d-subrahmanyam/deno-fresh-microservices event-drivenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Full Reference: See advanced.md for Saga implementations (Node.js, Java), Outbox pattern implementations, Event Sourcing, CQRS, and idempotency patterns.
Deep Knowledge: Use
mcp__documentation__fetch_docswith technology:event-drivenfor comprehensive documentation.
| Pattern | Purpose | Complexity | |---------|---------|------------| | Pub/Sub | Decouple producers from consumers | Low | | Event Sourcing | Store state as event sequence | High | | CQRS | Separate read/write models | Medium-High | | Saga | Distributed transactions | High | | Outbox | Reliable event publishing | Medium |
Manages distributed transactions across services without 2PC.
┌─────────┐ event ┌─────────┐ event ┌─────────┐
│Order Svc│────────────▶│Payment │────────────▶│Inventory│
└─────────┘ │ Svc │ │ Svc │
▲ └─────────┘ └─────────┘
│ compensate │ compensate │
└───────────────────────┴───────────────────────┘
┌─────────────┐
│ Saga │
│Orchestrator │
└─────────────┘
/ | \
▼ ▼ ▼
┌───────┐ ┌───────┐ ┌───────┐
│Order │ │Payment│ │Invent.│
└───────┘ └───────┘ └───────┘
Ensures reliable event publishing with database transactions.
┌────────────────────────────────────────────┐
│ Database Transaction │
│ ┌──────────────┐ ┌──────────────────┐ │
│ │ Business │ │ Outbox Table │ │
│ │ Table │ │ (messages) │ │
│ └──────────────┘ └──────────────────┘ │
└────────────────────────────────────────────┘
│
Polling Relay / CDC
│
┌─────────────────┐
│ Message Broker │
└─────────────────┘
CREATE TABLE outbox (
id UUID PRIMARY KEY,
aggregate_type VARCHAR(255) NOT NULL,
aggregate_id VARCHAR(255) NOT NULL,
event_type VARCHAR(255) NOT NULL,
payload JSONB NOT NULL,
status VARCHAR(50) DEFAULT 'PENDING',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Commands Queries
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Command Model │ │ Query Model │
│ (Write) │ │ (Read) │
└───────────────┘ └───────────────┘
│ ▲
▼ │
┌───────────────┐ Events ┌───────────────┐
│ Write Store │───────────────▶│ Read Store │
└───────────────┘ └───────────────┘
| Anti-Pattern | Why It's Bad | Solution | |--------------|--------------|----------| | Event Soup | Too many fine-grained events | Design coarse-grained domain events | | Missing Idempotency | Duplicate processing | Add idempotency keys | | No Compensation Logic | Failed saga can't rollback | Implement compensating transactions | | No Dead Letter Queue | Failed events lost | Configure DLQ for error handling | | Weak Event Ordering | Race conditions | Use partitioning or ordered queues |
| Issue | Diagnostic | Solution | |-------|------------|----------| | Lost events | Check message broker | Implement Outbox pattern | | Duplicate processing | Logs show multiple executions | Add idempotency checks | | Saga stuck | Compensation not triggered | Add timeout handling | | Growing DLQ | Many failed messages | Analyze failures, fix consumers | | Slow event processing | High message lag | Scale consumers, optimize handlers |
Available topics: patterns, saga, outbox, cqrs
development
Guidelines for building high-performance APIs with Fastify and TypeScript, covering validation, Prisma integration, and testing best practices
development
FastAPI modern Python web framework. Covers routing, Pydantic models, dependency injection, and async support. Use when building Python APIs. USE WHEN: user mentions "fastapi", "pydantic", "async python api", "python rest api", asks about "dependency injection python", "python openapi", "python swagger", "async endpoints", "python api validation", "fastapi middleware" DO NOT USE FOR: Django apps - use `django` instead, Flask apps - use `flask` instead, synchronous Python APIs without type hints, GraphQL-only APIs
tools
FastAPI integration testing specialist. Covers synchronous TestClient, async httpx AsyncClient, dependency injection overrides, auth testing (JWT, OAuth2, API keys), WebSocket testing, file uploads, background tasks, middleware testing, and HTTP mocking with respx, responses, and pytest-httpserver. USE WHEN: user mentions "FastAPI test", "TestClient", "httpx async test", "dependency override test", "respx mock", asks about testing FastAPI endpoints, authentication in tests, or HTTP client mocking. DO NOT USE FOR: Django - use `pytest-django`; pytest internals - use `pytest`; Container infrastructure - use `testcontainers-python`
development
Expert in FastAPI Python development with best practices for APIs and async operations