Agent skill

Microservices

by cohen-liel in cohen-liel/hivemind

Microservices architecture patterns. An agent skill from cohen-liel/hivemind.

Apache-2.0Auto-check passedBackend & APIs

Install Microservices

skills CLI
$ npx skills add cohen-liel/hivemind --skill microservices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cohen-liel/hivemind microservices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cohen-liel/hivemind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/microservices .claude/skills/microservices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
microservices
GitHub stars
110
Token cost
~2k tokens
SKILL.md length
126 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

Microservices architecture patterns. An agent skill from cohen-liel/hivemind.

  • Designing service decomposition
  • SKILL.md covers Service Structure, API Gateway (FastAPI), Inter-Service Communication and Service Template (Individual…, plus 3 more sections
  • Needs RESEND_API_KEY and POSTGRES_PASSWORD
  • Inter-service communication

What it does

Microservices is an agent skill from cohen-liel/hivemind. Microservices architecture patterns. Use when designing service decomposition, inter-service communication, API gateways, service discovery, event-driven architecture, or distributed systems.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Microservices and Event-driven systems. It works with Docker. The repository describes itself as: One prompt. A full AI engineering team. Go lie on the couch. 🧠. The licence is Apache-2.0.

When your agent uses it

  • Designing service decomposition
  • Inter-service communication
  • Service discovery
  • Event-driven architecture

Example prompts

  • “Use the microservices skill to microservice architecture patterns. An agent skill from cohen-liel/hivemind”
  • “/microservices”

Requirements

  • Python 3
  • Docker
  • A credential in RESEND_API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 918dd9b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • RESEND_API_KEY
    • POSTGRES_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Microservices loads about 2k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 126 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cohen-liel/hivemind at commit 918dd9b, republished under its Apache-2.0 licence (© cohen-liel). 126 words, ~1,953 tokens.

Download SKILL.mdSave it as .claude/skills/microservices/SKILL.md (or your agent's skills folder).
name
microservices
description
Microservices architecture patterns. Use when designing service decomposition, inter-service communication, API gateways, service discovery, event-driven architecture, or distributed systems.

Microservices Architecture Patterns

Service Structure

services/
  api-gateway/          # Entry point, routing, auth
  user-service/         # User management, auth
  product-service/      # Products, catalog, inventory
  order-service/        # Orders, checkout flow
  notification-service/ # Email, push, SMS (event-driven)
  payment-service/      # Stripe, billing
shared/
  proto/                # gRPC definitions (if used)
  events/               # Event schemas (Pydantic/TypeScript)
  libs/                 # Shared utilities
docker-compose.yml

API Gateway (FastAPI)

python
# api-gateway/main.py
import httpx
from fastapi import FastAPI, Request, Depends, HTTPException
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()
app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"])

SERVICE_URLS = {
    "users": "http://user-service:8001",
    "products": "http://product-service:8002",
    "orders": "http://order-service:8003",
}

@app.api_route("/{service}/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH"])
async def proxy(service: str, path: str, request: Request, user=Depends(verify_token)):
    if service not in SERVICE_URLS:
        raise HTTPException(404, "Service not found")

    url = f"{SERVICE_URLS[service]}/{path}"
    async with httpx.AsyncClient() as client:
        response = await client.request(
            method=request.method,
            url=url,
            headers={"X-User-Id": str(user.id), "X-User-Role": user.role},
            content=await request.body(),
            params=dict(request.query_params),
            timeout=30,
        )
    return Response(content=response.content, status_code=response.status_code,
                   media_type=response.headers.get("content-type"))

Inter-Service Communication

Synchronous (HTTP)
python
# Shared HTTP client with circuit breaker
import httpx
from tenacity import retry, stop_after_attempt, wait_exponential

class ServiceClient:
    def __init__(self, base_url: str):
        self.client = httpx.AsyncClient(base_url=base_url, timeout=10)

    @retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, min=1, max=10))
    async def get(self, path: str, **kwargs):
        response = await self.client.get(path, **kwargs)
        response.raise_for_status()
        return response.json()

# order-service calling user-service
user_client = ServiceClient("http://user-service:8001")

async def get_order_with_user(order_id: str):
    order = await db.orders.find_one(order_id)
    user = await user_client.get(f"/users/{order['user_id']}")  # Retries on failure
    return {**order, "user": user}
Asynchronous (Events via Redis/RabbitMQ)
python
# events/schemas.py
from pydantic import BaseModel
from datetime import datetime

class OrderPlacedEvent(BaseModel):
    event_type: str = "order.placed"
    order_id: str
    user_id: str
    amount: float
    items: list[dict]
    timestamp: datetime = Field(default_factory=datetime.utcnow)

class UserRegisteredEvent(BaseModel):
    event_type: str = "user.registered"
    user_id: str
    email: str
    name: str
    timestamp: datetime = Field(default_factory=datetime.utcnow)

# Publisher
import aioredis, json

redis = aioredis.from_url(settings.REDIS_URL)

async def publish_event(event: BaseModel):
    channel = event.event_type.replace(".", ":")
    await redis.publish(channel, event.model_dump_json())

# In order-service after creating order:
await publish_event(OrderPlacedEvent(
    order_id=order.id,
    user_id=user_id,
    amount=total,
    items=items,
))

# Subscriber (notification-service)
async def start_consumers():
    pubsub = redis.pubsub()
    await pubsub.subscribe("order:placed", "user:registered")

    async for message in pubsub.listen():
        if message["type"] == "message":
            channel = message["channel"]
            data = json.loads(message["data"])

            if channel == "order:placed":
                event = OrderPlacedEvent(**data)
                await send_order_confirmation_email(event)

            elif channel == "user:registered":
                event = UserRegisteredEvent(**data)
                await send_welcome_email(event)

Service Template (Individual Service)

python
# user-service/main.py
from fastapi import FastAPI, Header, HTTPException
from contextlib import asynccontextmanager

@asynccontextmanager
async def lifespan(app: FastAPI):
    app.state.db = await create_db_pool()
    yield
    await app.state.db.close()

app = FastAPI(lifespan=lifespan)

# Services trust X-User-Id header from gateway (already authenticated)
def get_current_user_id(x_user_id: str = Header(...)):
    return x_user_id

@app.get("/users/me")
async def get_me(user_id: str = Depends(get_current_user_id)):
    return await db.get_user(user_id)

@app.get("/users/{user_id}")
async def get_user(user_id: str):
    """Internal endpoint — called by other services."""
    user = await db.get_user(user_id)
    if not user:
        raise HTTPException(404, "User not found")
    return user

Docker Compose (Development)

yaml
# docker-compose.yml
version: '3.9'

services:
  api-gateway:
    build: ./api-gateway
    ports: ["8000:8000"]
    environment:
      - USER_SERVICE_URL=http://user-service:8001
    depends_on: [user-service, product-service]

  user-service:
    build: ./user-service
    environment:
      - DATABASE_URL=postgresql://postgres:password@postgres:5432/users
      - REDIS_URL=redis://redis:6379
    depends_on: [postgres, redis]

  product-service:
    build: ./product-service
    environment:
      - DATABASE_URL=postgresql://postgres:password@postgres:5432/products
    depends_on: [postgres]

  notification-service:
    build: ./notification-service
    environment:
      - REDIS_URL=redis://redis:6379
      - RESEND_API_KEY=${RESEND_API_KEY}
    depends_on: [redis]

  postgres:
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: password
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql

  redis:
    image: redis:7-alpine
    volumes: [redis_data:/data]

volumes:
  postgres_data:
  redis_data:

Health Checks

python
@app.get("/health")
async def health():
    """Standard health check endpoint for load balancers."""
    checks = {}
    try:
        await db.execute("SELECT 1")
        checks["database"] = "ok"
    except Exception:
        checks["database"] = "error"

    try:
        await redis.ping()
        checks["redis"] = "ok"
    except Exception:
        checks["redis"] = "error"

    status = "ok" if all(v == "ok" for v in checks.values()) else "degraded"
    return {"status": status, "service": "user-service", "checks": checks}

Rules

  • Each service owns its database — NEVER share databases between services
  • API Gateway handles auth — services trust X-User-Id header (don't re-verify JWT)
  • Use events (pub/sub) for cross-service side effects (emails, notifications, analytics)
  • Use HTTP for synchronous reads where you need a response immediately
  • Each service has its own docker image + migrations — deployable independently
  • Retry with exponential backoff for inter-service HTTP calls
  • Circuit breaker: after 5 failures, stop calling the service for 30s
  • Idempotent event handlers: consuming same event twice should be safe
  • One database schema per service (prefix tables: users_*, products_*)
  • Service discovery: use Docker DNS (service name = hostname) in compose

© cohen-liel, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/microservices of cohen-liel/hivemind.

Open the folder on GitHubat commit 918dd9b

Compare with similar skills

Microservices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Microservices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Microservices this skillcohen-liel/hivemind110—~2kAutomated safety check: PassApache-2.0
Deepstream SopNVIDIA/skills3.5k—~4.7kAutomated safety check: NotesApache-2.0
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
Dr Jskilljdubois/dr-jskill342—~4.6kAutomated safety check: NotesApache-2.0
Vss Deploy Detection Tracking 2DNVIDIA/skills3.5k1 repos~4.5kAutomated safety check: PassApache-2.0
NestJS Modular Monolith Architecttech-leads-club/agent-skills7k—~3.9kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Deepstream Sop

    NVIDIA/skills

    Official

    A skill your agent uses when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether…

    3.5k GitHub stars~4.7k tokensUpdated yesterday
    Backend & APIsAuto-check: notes
  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Dr Jskill

    jdubois/dr-jskill

    Creates Java + Spring Boot projects: Web applications, full-stack apps with Vue.js or Angular or React or vanilla JS, PostgreSQL, REST APIs, and Docker.

    342 GitHub stars~4.6k tokensUpdated 9 days ago
    Backend & APIsAuto-check: notes
  • Official

    A skill your agent uses when the user wants to deploy, run, debug, tear down, or call the REST API of the RTVI-CV 2D detection / tracking microservice.

    3.5k GitHub starsUsed in 1 repo~4.5k tokens
    Backend & APIsAuto-check passed
  • NestJS Modular Monolith Architect

    tech-leads-club/agent-skills

    Designs scalable NestJS modular monoliths with domain-driven design, Clean Architecture layers and optional CQRS, defining bounded contexts and strict module boundaries.

    7k GitHub stars~3.9k tokensUpdated 18 days ago
    Backend & APIsAuto-check passed
  • Official

    Deploys, configures, and troubleshoots IBM Cloud Code Engine workloads using the ibmcloud ce CLI.

    117 GitHub stars~3.4k tokensUpdated today
    Backend & APIsAuto-check passed

More from cohen-liel/hivemind

All 33 skills in this repo
  • API Design

    cohen-liel/hivemind

    REST API design principles and best practices. An agent skill from cohen-liel/hivemind.

    110 GitHub starsUsed in 1 repo~857 tokens
    Auto-check passed
  • Graphql API

    cohen-liel/hivemind

    GraphQL API design and implementation patterns. An agent skill from cohen-liel/hivemind.

    110 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Async Python

    cohen-liel/hivemind

    Python asyncio patterns for high-performance async code. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~992 tokensUpdated 5 mo ago
    Auto-check passed
  • Celery Tasks

    cohen-liel/hivemind

    Celery background task patterns for Python apps. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Docker Deployment

    cohen-liel/hivemind

    Docker, docker-compose, and deployment configuration best practices.

    110 GitHub stars~674 tokensUpdated 5 mo ago
    Auto-check passed
  • E2E Testing

    cohen-liel/hivemind

    End-to-end testing patterns with Playwright. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed

Works with

Categories

Questions about Microservices

What does Microservices do?

Microservices architecture patterns. An agent skill from cohen-liel/hivemind. Microservices is an agent skill from cohen-liel/hivemind. Microservices architecture patterns.

When should I use Microservices?

Microservices fits situations like: designing service decomposition; inter-service communication; service discovery; event-driven architecture.

How do I install Microservices in Claude Code?

Run `npx skills add cohen-liel/hivemind --skill microservices -a claude-code`. Or copy the skill folder (.claude/skills/microservices in cohen-liel/hivemind) into .claude/skills/microservices in your project. Claude Code loads it when a task matches its description.

How do I install Microservices in Codex?

Run `npx skills add cohen-liel/hivemind --skill microservices -a codex`. Or copy the skill folder (.claude/skills/microservices in cohen-liel/hivemind) into .agents/skills/microservices in your project. Codex loads it when a task matches its description.

Can I use Microservices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cohen-liel/hivemind --skill microservices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/microservices, .gemini/skills/microservices, .github/skills/microservices and .opencode/skills/microservices in your project.

What does Microservices need to run?

Going by SKILL.md and its folder, Microservices needs credentials named RESEND_API_KEY and POSTGRES_PASSWORD. Our summary lists: Python 3; Docker; A credential in RESEND_API_KEY.

Does Microservices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Microservices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Microservices use?

Microservices is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Microservices use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Microservices?

Skills that share tags, products or a category with Microservices: Deepstream Sop (NVIDIA/skills, 3.5k stars), AWS Serverless Eda (zxkane/aws-skills, 367 stars), Dr Jskill (jdubois/dr-jskill, 342 stars) and Vss Deploy Detection Tracking 2D (NVIDIA/skills, 3.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Microservices?

cohen-liel (a GitHub user) maintains it in cohen-liel/hivemind, which has 110 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on April 18, 2026.

Source: cohen-liel/hivemind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.