---
name: microservices-architecture-planner
description: "Designs a microservices architecture around your business domains: which services to cut, how they talk, what owns which data, and the infrastructure to run them, with the first migration step named. Use when an app needs its business domains split into microservices with clear data ownership, communication patterns, and the infrastructure to run them. Do not use for designing a single service's internal code structure or writing Kubernetes manifests. Related topics: coding, architecture, microservices."
---

# Microservices Architecture Planner

Designs a microservices architecture around your business domains: which services to cut, how they talk, what owns which data, and the infrastructure to run them, with the first migration step named.

## When to use

Use this skill when an app needs its business domains split into microservices with clear data ownership, communication patterns, and the infrastructure to run them. Do not use it for designing a single service's internal code structure or writing Kubernetes manifests.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Decide for each domain whether it earns a service by data model, change rate, or scaling profile, and merge the ones that do not.
3. Assign each service the data it owns and the interfaces it exposes, so no two services write the same table.
4. Choose sync or async communication per interaction and mark where idempotency and retries are required.
5. Place the gateway, mesh, and observability stack where they take work off the services and name what each handles.
6. Size the infrastructure for the expected scale, identify the first bottleneck, and name the first migration or build step.

## Inputs

- **Application type** (free text, e.g. "E-commerce platform or SaaS dashboard")
- **Current architecture** (choose one: Monolith, Mini-services, Already microservices, Greenfield)
- **Expected scale** (choose one: Small (<1000 users), Medium (1000-100k users), Large (100k+ users), Massive (millions))
- **Domains to separate into services** (longer free text)
- **Communication pattern** (choose any: REST API, gRPC, GraphQL, Message queue (Kafka/RabbitMQ), Event sourcing)
- **Container orchestration** (choose one: Kubernetes, Docker Swarm, ECS (AWS), Cloud Run, None)
- **Service mesh** (choose one: Yes, No)
- **API gateway** (choose one: Yes, No)
- **Include observability (logging and metrics and tracing)** (choose one: Yes, No)

## Output

A service table (name, responsibility, owned data, exposes, consumes), an interaction diagram in text or Mermaid, an infrastructure list sized to the scale, a first migration step, and a short risk list.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Microservices Architecture Planner

Plan a microservices architecture for my application.

- Application type: {{Application type}}
- Current architecture: {{Current architecture}}
- Expected scale: {{Expected scale}}
- Domains to separate into services: {{Domains to separate into services}}
- Communication pattern: {{Communication pattern}}
- Container orchestration: {{Container orchestration}}
- Service mesh: {{Service mesh}}
- API gateway: {{API gateway}}
- Include observability (logging and metrics and tracing): {{Include observability (logging and metrics and tracing)}}

Start from the domains, not the technology. For each domain decide whether it earns its own service: it has a distinct data model, changes at its own pace, or scales differently from its neighbors; merge domains that would only chat with each other across a network boundary. Give every service a single owner of its data and name the data it owns. Then choose the communication pattern per interaction, not globally: synchronous calls for request and response on the user's path, asynchronous events for anything that can finish later, and say where idempotency and retries are needed. Place the gateway and mesh only where they remove work from the services, and say what each handles (auth, rate limits, routing, mTLS, retries). Size the infrastructure to the expected scale and name the one component that becomes the bottleneck first. Close with the migration path: for a monolith, the first service to extract and why; for greenfield, the two services to build first. Deliver: a service table (name, responsibility, owned data, exposes, consumes), an interaction diagram described in text or Mermaid, the infrastructure list, and the risks you would watch.

## Pitfalls

- Cutting a service per database table or per team wish, which produces a distributed monolith that cannot deploy independently.
- Letting two services write the same data store, so consistency problems appear the first time they disagree.
- Choosing a mesh and gateway for a small-scale system where they add more operations load than they remove.
- Making every call synchronous, so one slow service drags down the whole user request.
