mcpField
E
event-driven

event-driven

github.com/thebeardedbearsasDevelopment107113 installsUpdated today
Repository

About event-driven

A reference for developers using event-driven architecture, covering patterns such as Event Sourcing, CQRS, Saga, and event buses. It includes examples of rebuilding state, coordinating distributed transactions, and using Kafka and Symfony.

Key features

  1. 01Event Sourcing and state reconstruction
  2. 02CQRS read/write model separation
  3. 03Saga orchestration and choreography
  4. 04Kafka event bus example
  5. 05Symfony domain event example

Use cases

  1. 01Rebuild application state from an event log
  2. 02Separate read models from write models
  3. 03Coordinate distributed transactions across microservices
  4. 04Trigger domain operations through events

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thebeardedbearsas/claude-craft --skill event-driven

After installing, type/event-drivenin Claude Code to confirm it loaded.

Details

From the project README

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

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

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

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

Domain Events (Symfony)

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

Comments

Markdown supported