# Microservices Design

Microservices design patterns including service mesh, event-driven architecture, saga...

- Repository: https://github.com/rohitg00/awesome-claude-code-toolkit (2800 stars)
- Category: Design
- License: Apache-2.0
- Last updated: 2026-05-12
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add rohitg00/awesome-claude-code-toolkit --skill microservices-design -g -a claude-code -y`
Codex: `npx skills add rohitg00/awesome-claude-code-toolkit --skill microservices-design -g -a codex -y`
Cursor: `npx skills add rohitg00/awesome-claude-code-toolkit --skill microservices-design -g -a cursor -y`
Gemini CLI: `npx skills add rohitg00/awesome-claude-code-toolkit --skill microservices-design -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add rohitg00/awesome-claude-code-toolkit`

## Description

Microservices design patterns including service mesh, event-driven architecture, saga pattern, and API gateway

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Microservices Design

## Service Boundaries

Define services around business capabilities, not technical layers. Each service owns its data store and exposes a clear API contract.

```
order-service/       -> owns orders table, publishes OrderCreated events
inventory-service/   -> owns inventory table, subscribes to OrderCreated
payment-service/     -> owns payments table, handles payment processing
notification-service -> stateless, subscribes to events, sends emails/SMS
```

## Event-Driven Communication

```typescript
interface DomainEvent {
  eventId: string;
  eventType: string;
  aggregateId: string;
  timestamp: string;
  version: number;
  payload: Record<string, unknown>;
}

const orderCreatedEvent: DomainEvent = {
  eventId: crypto.randomUUID(),
  eventType: "order.created",
  aggregateId: orderId,
  timestamp: new Date().toISOString(),
  version: 1,
  payload: { customerId, items, totalAmount },
};

await broker.publish("orders", orderCreatedEvent);
```

```typescript
async function handleOrderCreated(event: DomainEvent) {
  const { items } = event.payload as OrderPayload;

  for (const item of items) {
    await db.inventory.update({
      where: { productId: item.productId },
      data: { quantity: { decrement: item.quantity } },
    });
  }

  await markEventProcessed(event.eventId);
}
```

Use idempotency keys (`eventId`) to handle duplicate deliveries safely.

## Saga Pattern (Orchestration)

The rest: https://github.com/rohitg00/awesome-claude-code-toolkit/blob/HEAD/skills/microservices-design/SKILL.md
