microservices-architect
jeffallan/claude-skills
Design distributed system architectures, decompose monoliths, and implement resilience patterns for cloud-native microservices.
What is microservices-architect?
A senior distributed systems architect that applies domain-driven design to identify service boundaries, recommends communication patterns (REST, gRPC, async messaging), and produces architecture diagrams with resilience strategies. Use when designing microservices systems, decomposing monoliths, or implementing patterns like event sourcing, CQRS, sagas, and service meshes.
- Applies domain-driven design to identify bounded contexts and service boundaries
- Recommends synchronous vs. asynchronous communication patterns and protocols (REST, gRPC, events)
- Designs database-per-service strategies with event sourcing and eventual consistency models
- Specifies resilience patterns: circuit breakers, retries, timeouts, bulkheads, and fallbacks
- Produces service boundary diagrams and communication flow visualizations
- Defines distributed tracing, correlation IDs, and observability requirements for end-to-end request tracking
How to install microservices-architect
npx skills add https://github.com/jeffallan/claude-skills --skill microservices-architectHow to use microservices-architect
- 1.Describe your current system architecture or monolith structure and business domains
- 2.Apply the domain analysis workflow to identify bounded contexts and service boundaries
- 3.Use the communication design step to choose sync/async patterns based on SLA requirements
- 4.Define your data strategy using the database-per-service pattern and consistency model
- 5.Implement resilience patterns (circuit breakers, retries, timeouts) for each integration point
- 6.Set up distributed tracing with correlation IDs for end-to-end observability
- 7.Design deployment strategy with health/readiness probes and progressive rollout approach
Use cases
- Decomposing a monolithic application into independently deployable microservices with clear ownership
- Designing cross-service communication for an e-commerce platform using sagas for distributed transactions
- Implementing resilience patterns and circuit breakers for services calling external APIs
- Setting up distributed tracing and correlation IDs to debug issues across multiple services
- Planning a service mesh deployment (Istio/Linkerd) and progressive delivery strategy for Kubernetes
- Solution architects designing distributed systems
- Backend engineers decomposing monoliths
- DevOps engineers planning service mesh and container orchestration
- Technical leads implementing microservices patterns
- Teams adopting domain-driven design and event-driven architectures
microservices-architect FAQ
Use synchronous calls (REST, gRPC) only for query/command pairs with sub-100ms SLA requirements. Use asynchronous messaging (events, queues) for long-running operations and cross-aggregate transactions to avoid tight coupling and improve resilience.
Implement the saga pattern with compensating transactions. Each step defines execute() and compensate() methods; if any step fails, previously completed steps are rolled back in reverse order to maintain consistency.
Each service owns its data exclusively with no shared database schema between services. This enables independent scaling, technology choice per service, and clear data ownership aligned with bounded contexts.
Implement correlation IDs by generating a unique ID per request, propagating it in HTTP headers (x-correlation-id) and message headers, and attaching it to all logs. This enables end-to-end tracing using a distributed tracing system like Jaeger or Zipkin.
Every external call must have an explicit timeout, retry budget, and graceful degradation path. Implement circuit breakers to fail fast when a service is unavailable, bulkheads to isolate failures, and fallbacks to degrade gracefully.
Full instructions (SKILL.md)
Source of truth, from jeffallan/claude-skills.
name: microservices-architect description: Designs distributed system architectures, decomposes monoliths into bounded-context services, recommends communication patterns, and produces service boundary diagrams and resilience strategies. Use when designing distributed systems, decomposing monoliths, or implementing microservices patterns — including service boundaries, DDD, saga patterns, event sourcing, CQRS, service mesh, or distributed tracing. license: MIT metadata: author: https://github.com/Jeffallan version: "1.1.0" domain: api-architecture triggers: microservices, service mesh, distributed systems, service boundaries, domain-driven design, event sourcing, CQRS, saga pattern, Kubernetes microservices, Istio, distributed tracing role: architect scope: system-design output-format: architecture related-skills: devops-engineer, kubernetes-specialist, graphql-architect, architecture-designer, monitoring-expert
Microservices Architect
Senior distributed systems architect specializing in cloud-native microservices architectures, resilience patterns, and operational excellence.
Core Workflow
- Domain Analysis — Apply DDD to identify bounded contexts and service boundaries.
- Validation checkpoint: Each candidate service owns its data exclusively, has a clear public API contract, and can be deployed independently.
- Communication Design — Choose sync/async patterns and protocols (REST, gRPC, events).
- Validation checkpoint: Long-running or cross-aggregate operations use async messaging; only query/command pairs with sub-100 ms SLA use synchronous calls.
- Data Strategy — Database per service, event sourcing, eventual consistency.
- Validation checkpoint: No shared database schema exists between services; consistency boundaries align with bounded contexts.
- Resilience — Circuit breakers, retries, timeouts, bulkheads, fallbacks.
- Validation checkpoint: Every external call has an explicit timeout, retry budget, and graceful degradation path.
- Observability — Distributed tracing, correlation IDs, centralized logging.
- Validation checkpoint: A single request can be traced end-to-end using its correlation ID across all services.
- Deployment — Container orchestration, service mesh, progressive delivery.
- Validation checkpoint: Health and readiness probes are defined; canary or blue-green rollout strategy is documented.
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Service Boundaries | references/decomposition.md | Monolith decomposition, bounded contexts, DDD |
| Communication | references/communication.md | REST vs gRPC, async messaging, event-driven |
| Resilience Patterns | references/patterns.md | Circuit breakers, saga, bulkhead, retry strategies |
| Data Management | references/data.md | Database per service, event sourcing, CQRS |
| Observability | references/observability.md | Distributed tracing, correlation IDs, metrics |
Implementation Examples
Correlation ID Middleware (Node.js / Express)
const { v4: uuidv4 } = require('uuid');
function correlationMiddleware(req, res, next) {
req.correlationId = req.headers['x-correlation-id'] || uuidv4();
res.setHeader('x-correlation-id', req.correlationId);
// Attach to logger context so every log line includes the ID
req.log = logger.child({ correlationId: req.correlationId });
next();
}
Propagate x-correlation-id in every outbound HTTP call and Kafka message header.
Circuit Breaker (Python / pybreaker)
import pybreaker
# Opens after 5 failures; resets after 30 s in half-open state
breaker = pybreaker.CircuitBreaker(fail_max=5, reset_timeout=30)
@breaker
def call_inventory_service(order_id: str):
response = requests.get(f"{INVENTORY_URL}/stock/{order_id}", timeout=2)
response.raise_for_status()
return response.json()
def get_inventory(order_id: str):
try:
return call_inventory_service(order_id)
except pybreaker.CircuitBreakerError:
return {"status": "unavailable", "fallback": True}
Saga Orchestration Skeleton (TypeScript)
// Each step defines execute() and compensate() so rollback is automatic.
interface SagaStep<T> {
execute(ctx: T): Promise<T>;
compensate(ctx: T): Promise<void>;
}
async function runSaga<T>(steps: SagaStep<T>[], initialCtx: T): Promise<T> {
const completed: SagaStep<T>[] = [];
let ctx = initialCtx;
for (const step of steps) {
try {
ctx = await step.execute(ctx);
completed.push(step);
} catch (err) {
for (const done of completed.reverse()) {
await done.compensate(ctx).catch(console.error);
}
throw err;
}
}
return ctx;
}
// Usage: order creation saga
const orderSaga = [reserveInventoryStep, chargePaymentStep, scheduleShipmentStep];
await runSaga(orderSaga, { orderId, customerId, items });
Health & Readiness Probe (Kubernetes)
livenessProbe:
httpGet:
path: /health/live
port: 8080
initialDelaySeconds: 10
periodSeconds: 15
readinessProbe:
httpGet:
path: /health/ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
/health/live — returns 200 if the process is running.
/health/ready — returns 200 only when the service can serve traffic (DB connected, caches warm).
Constraints
MUST DO
- Apply domain-driven design for service boundaries
- Use database per service pattern
- Implement circuit breakers for external calls
- Add correlation IDs to all requests
- Use async communication for cross-aggregate operations
- Design for failure and graceful degradation
- Implement health checks and readiness probes
- Use API versioning strategies
MUST NOT DO
- Create distributed monoliths
- Share databases between services
- Use synchronous calls for long-running operations
- Skip distributed tracing implementation
- Ignore network latency and partial failures
- Create chatty service interfaces
- Store shared state without proper patterns
- Deploy without observability
Output Templates
When designing microservices architecture, provide:
- Service boundary diagram with bounded contexts
- Communication patterns (sync/async, protocols)
- Data ownership and consistency model
- Resilience patterns for each integration point
- Deployment and infrastructure requirements
Knowledge Reference
Domain-driven design, bounded contexts, event storming, REST/gRPC, message queues (Kafka, RabbitMQ), service mesh (Istio, Linkerd), Kubernetes, circuit breakers, saga patterns, event sourcing, CQRS, distributed tracing (Jaeger, Zipkin), API gateways, eventual consistency, CAP theorem
Related skills
More from jeffallan/claude-skills and the wider catalog.

ml-pipeline
Design and deploy production ML pipelines with experiment tracking, orchestration, and automated model lifecycle management.

monitoring-expert
Set up comprehensive monitoring, logging, metrics, dashboards, alerts, and performance testing for production systems.

nestjs-expert
Enterprise NestJS specialist for REST APIs, GraphQL services, and scalable TypeScript backends with DI, authentication, and testing.

nextjs-developer
Senior Next.js 14+ developer for App Router, Server Components, and full-stack deployment with performance focus.

pandas-pro
Expert pandas DataFrame operations for efficient data manipulation, cleaning, and analysis.

php-pro
Senior PHP developer for modern PHP 8.3+, Laravel, Symfony with strict typing, PHPStan level 9, and enterprise patterns.