event-driven

Event Sourcing, CQRS, Saga patterns, event bus (Kafka, RabbitMQ, AWS EventBridge). Use when implementing event-driven architecture, distributed transactions, or event sourcing.

thebeardedbearsas/claude-craft113 installsMITSynced Aug 22

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: event-driven
description: Event Sourcing, CQRS, Saga patterns, event bus (Kafka, RabbitMQ, AWS EventBridge). Use when implementing event-driven architecture, distributed transactions, or event sourcing.
license: MIT
---

# Event-Driven — Event Sourcing, Saga, CQRS

Architecture événementielle pour découplage et scalabilité.

## Patterns

**Event Sourcing** — Stocker events, pas état (audit, replay)  
**CQRS** — Séparer Read/Write models (projections)  
**Saga** — Transaction distribuée (microservices)  
**Event Bus** — Pub/Sub découplé (Kafka, RabbitMQ)

## Event Sourcing

```python
events = [OrderCreated(...), OrderPaid(...), OrderShipped(...)]

def rebuild(events):
    state = {}
    for e in events: state = apply(state, e)
    return state
```

## Saga — Choreography vs Orchestration

**Choreography** — Events chain services (découplé, debug dur)  
**Orchestration** — Central coordinator (visible, couplé)

```
Choreo: OrderCreated → Payment → Shipping
Orchestrator: ProcessPayment() → ShipOrder()
```

## Kafka Event Bus

```javascript
// Producer
producer.send({ topic: 'orders', messages: [{ ... }] });

// Consumer
consumer.run({
  eachMessage: async ({ message }) => {
    handleEvent(JSON.parse(message.value));
  }
});
```

## Domain Events (Symfony)

```php
class OrderCreatedEvent {
    public function __construct(public Order $order) {}
}

class SendEmail {
    public function __invoke(OrderCreatedEvent $e) {
        $this->mailer->send($e->order->email, 'Confirmation');
    }
}
```

---

Voir `@.claude/rules/21-cqrs.md`, `@.claude/skills/async/SKILL.md`

More Architecture skills

← All Architecture skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY