microservices
Use when the user asks about microservices, splitting a monolith, service boundaries, database per service, sagas, service discovery or strangler fig…
by j4flmao★ 47 GitHub stars
Install microservices in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Microservices Architecture
Purpose
Guide microservices decomposition, communication patterns, data ownership, and migration strategies.
Agent Protocol
Trigger
User request includes: microservice, micro-services, service decomposition, distributed system, saga, cqrs, event sourcing, service mesh.
Input Context
- Business domain description / bounded context map
- Current monolith architecture (if migrating)
- Team topology (Conway's Law)
- Non-functional requirements (latency, throughput, consistency, availability)
- Technology preferences (message broker, container platform, language)
Output Artifact
A markdown document containing:
- Service decomposition model (bounded contexts with responsibilities)
- Communication pattern selection (sync/async/event) per service pair
- Data ownership strategy (database per service, shared nothing)
- Infrastructure recommendations (service mesh, API gateway, message broker)
- Migration strategy (strangler fig, parallel run)
Response Format
Produce the artifact directly. No preamble, no postamble, no explanations. No filler, no hedging, no transitions. Strip articles a/an/the where unambiguous. Compress output — why use many token when few do trick. If monolith is appropriate, output Monolith recommended. Reason: [reason]. and stop.
Completion Criteria
- Decomposition bounded contexts explicitly mapped to business capabilities
- Each service pair has communication pattern documented with rationale
- Data consistency strategy for each transaction spanning services
- Infrastructure recommendations with concrete tools/versions
- Migration path with ordered phases
Max Response Length
4096 tokens
Decision Tree
Should You Use Microservices?
What is your situation?
├── Small team (<10 devs), early stage product, uncertain domain
│ └── Monolith recommended. Reason: microservices add accidental complexity before you understand the domain.
├── Medium team, well-understood domain, scaling issues in monolith
│ └── Decompose selectively: extract hot paths first (bounded contexts)
├── Large organization, multiple teams, clear domain boundaries
│ └── Microservices aligned to team topology (Conway's Law)
└── Migrating from monolith with growing complexity
└── Strangler Fig: extract one bounded context at a time
How to Decompose?
What boundary defines this service?
├── Business capability (orders, payments, shipping)
│ └── Standard approach: map to business functions
├── DDD subdomain (core, supporting, generic)
│ └── Follow bounded contexts from domain modeling
├── Team topology (one team = one or more services)
│ └── Conway's Law: services mirror communication structure
└── Data ownership (candidate for extraction)
└── If a data domain changes independently, it's a decomposition candidate
Communication Pattern Selection
What does the caller need?
├── Immediate response, strong consistency, low latency needed
│ └── Synchronous (HTTP/gRPC) — but beware cascading failures
├── Fire-and-forget, eventual consistency OK, decouple in time
│ └── Async (message queue / event) — resilient, scalable
├── Distributed transaction spanning 3+ services
│ └── Saga orchestration — central coordinator
├── Guaranteed event publication DB → broker
│ └── Transactional outbox — write event in same DB transaction
└── Need to rebuild state from events or audit trail
└── Event sourcing — store events as source of truth
Workflow
Step 1: Decompose by Bounded Context
| Pattern | Approach | When |
|---|---|---|
| Business Capability | Map to business functions (orders, payments, shipping) | Clear organizational boundaries |
| Subdomain | Follow DDD bounded contexts | Complex domain, multiple subdomains |
| Strangler Fig | Incrementally replace monolith features | Brownfield migration |
| Self-contained Service | Service owns its data, API, and logic | Least coupling, maximum autonomy |
Decomposition rules:
- Service must be independently deployable
- Service must own its data exclusively (no shared databases)
- Service must be team-sizable (2-pizza team)
- Service communication must be via network calls (no in-process)
Step 2: Select Communication Patterns
| Pattern | Type | Consistency | Latency | Use Case |
|---|---|---|---|---|
| Synchronous (HTTP/gRPC) | Request-response | Strong (if transactional) | Higher | Queries, commands needing immediate response |
| Asynchronous (Message Queue) | Event-driven | Eventual | Lower | Cross-service notifications, long-running processes |
| Saga | Choreography / Orchestration | Eventual | Medium | Distributed transaction spanning services |
| Transactional Outbox | Reliable event publishing | Strong | Low + async | Guaranteed event delivery with DB transaction |
Saga variants:
- Choreography: Each service publishes events after local
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- references/communication-patterns.md
- references/data-patterns.md
- references/decomposition-patterns.md
- references/merged-architecture-microservices-patterns.md
- references/merged-microservice-design-patterns.md
- references/microservices-communication.md
- references/microservices-observability.md
- references/microservices-testing.md
FAQ
What does the microservices skill do?
Use when the user asks about microservices, splitting a monolith, service boundaries, database per service, sagas, service discovery or strangler fig migration. Produces a decomposition and communication plan (or a monolith verdict). Not for DDD modeling (use architecture-domain-driven-design) or Kubernetes setup (use kubernetes).
How do I install the microservices skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the microservices skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…