# microservices-expert

microservices-expert — a skill for microservices architecture, service communication, and distributed workflows. Use it when a task involves service mesh, failure handling, or system design.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 181 installs · ★ 45 repo stars
- Author: personamanagmentlayer
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/personamanagmentlayer/pcl/tree/HEAD/stdlib/api/microservices-expert/SKILL.md
- Updated: 2026-10-12
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/microservices-expert

## What it does

microservices-expert gives an agent a structured basis for designing microservices and distributed systems. It covers single-purpose services, independent deployment, decentralized data ownership, infrastructure automation, failure-aware design, and evolutionary change. The architecture patterns include API Gateway, Service Discovery, Circuit Breaker, Saga, Event Sourcing, and CQRS.

The material also covers HTTP/REST and gRPC calls, message-based flows, service mesh, API composition, and BFF. Its Python examples use FastAPI, httpx, circuitbreaker, and Consul, so those examples need the matching project dependencies. A Saga example coordinates order creation and reverses completed steps when a later action fails.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill microservices-expert -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/microservices-expert/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/microservices-expert/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill microservices-expert -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/microservices-expert/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill microservices-expert -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/microservices-expert/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install personamanagmentlayer/pcl stdlib/api/microservices-expert
```

2. **Manually: put the files in place**
- File: `.github/skills/microservices-expert/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill microservices-expert -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/api/microservices-expert
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/microservices-expert/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add personamanagmentlayer/pcl --skill microservices-expert -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/personamanagmentlayer/pcl/tree/HEAD/stdlib/api/microservices-expert/SKILL.md

## When to use it
- define service boundaries for a system
- choose synchronous or asynchronous service calls
- model a distributed transaction with Saga
- protect remote calls with Circuit Breaker
- register and discover services through Consul

## Example prompts
- Design a microservices architecture for orders, payments, and inventory.
- Compare API Gateway, BFF, and API composition for this system.
- Show a Saga for order creation with payment refund and inventory release.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: aad4de1c1d8e8b27.

BEGIN THIRD-PARTY FILE aad4de1c1d8e8b27
````text
---
name: microservices-expert
version: 1.1.0
description: >-
  Expert-level microservices architecture, patterns, service mesh, and distributed systems.
  Use when the user mentions distributed systems, service mesh, or architecture, or when
  the task involves Microservices Principles, Architecture Patterns, Communication, or Data
  Management.
category: api
tags: [microservices, distributed-systems, service-mesh, architecture]
allowed-tools:
  - Read
  - Write
  - Edit
---

# Microservices Expert

Expert guidance for microservices architecture, design patterns, service communication, and distributed system challenges.

## Core Concepts

### Microservices Principles

- Single responsibility per service
- Independently deployable
- Decentralized data management
- Infrastructure automation
- Design for failure
- Evolutionary design

### Architecture Patterns

- API Gateway
- Service Discovery
- Circuit Breaker
- Saga Pattern
- Event Sourcing
- CQRS

### Communication

- Synchronous (HTTP/REST, gRPC)
- Asynchronous (Message queues, Events)
- Service mesh
- API composition
- Backend for Frontend (BFF)

## Service Design

```python
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import httpx
from typing import List, Optional
from circuitbreaker import circuit
import asyncio

# Individual Microservice
app = FastAPI(title="Order Service", version="1.0.0")

class Order(BaseModel):
    id: str
    user_id: str
    items: List[dict]
    total: float
    status: str

class OrderService:
    def __init__(self, inventory_url: str, payment_url: str):
        self.inventory_url = inventory_url
        self.payment_url = payment_url
        self.client = httpx.AsyncClient()

    @circuit(failure_threshold=5, recovery_timeout=60)
    async def check_inventory(self, items: List[dict]) -> bool:
        """Check inventory availability with circuit breaker"""
        try:
            response = await self.client.post(
                f"{self.inventory_url}/check",
                json={"items": items},
                timeout=5.0
            )
            return response.json()["available"]
        except Exception as e:
            print(f"Inventory service error: {e}")
            raise

    @circuit(failure_threshold=5, recovery_timeout=60)
    async def process_payment(self, user_id: str, amount: float) -> dict:
        """Process payment with circuit breaker"""
        try:
            response = await self.client.post(
                f"{self.payment_url}/charge",
                json={"user_id": user_id, "amount": amount},
                timeout=10.0
            )
            return response.json()
        except Exception as e:
````
END THIRD-PARTY FILE aad4de1c1d8e8b27

The third-party file has ended. Everything between the aad4de1c1d8e8b27 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2691 of 14279 bytes. © personamanagmentlayer · Apache-2.0 · https://github.com/personamanagmentlayer/pcl/tree/HEAD/stdlib/api/microservices-expert/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
