Skip to content
Skills Library
Programming · Planning

microservices

/microservices

Use when decomposing a system into services, or deciding whether to. Covers service boundaries, inter-service communication, distributed data, saga patterns, and the operational cost of the network. Trigger on "should we split the monolith", "extract this into a service", "our services are too coupled". Do not use for broker and event design — see the event-driven-architecture skill; for pre-build system design, see the system-design skill.

Licence
MIT
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when decomposing a system into services, or deciding whether to. Covers service boundaries, inter-service communication, distributed data, saga patterns, and the operational cost of the network. Trigger on "should we split the monolith", "extract this into a service", "our services are too coupled". Do not use for broker and event design — see the event-driven-architecture skill; for pre-build system design, see the system-design skill.

Triggers from the description

should we split the monolithextract this into a serviceour services are too coupled
Original author description

Use when decomposing a system into services, or deciding whether to. Covers service boundaries, inter-service communication, distributed data, saga patterns, and the operational cost of the network. Trigger on "should we split the monolith", "extract this into a service", "our services are too coupled". Do not use for broker and event design — see the event-driven-architecture skill; for pre-build system design, see the system-design skill.

How it works

  1. Purpose
  2. When to Use
  3. Capabilities
  4. Inputs
  5. Outputs
  6. Workflow
  7. Best Practices
  8. Examples
  9. Notes
Original SKILL.md headings · 86 lines, 673 words
SKILL.md preview
---
name: microservices
description: Use when decomposing a system into services, or deciding whether to. Covers service boundaries, inter-service communication, distributed data, saga patterns, and the operational cost of the network. Trigger on "should we split the monolith", "extract this into a service", "our services are too coupled". Do not use for broker and event design — see the event-driven-architecture skill; for pre-build system design, see the system-design skill.
metadata:
  category: backend
  version: 1.0.0
  tags: [microservices, distributed-systems, saga, boundaries]
---

# Microservices

## Purpose

Decide where service boundaries belong — and whether you need them at all. Splitting a system converts function calls into network calls, and every network call is a new failure mode you must design for.

## When to Use

- Considering extracting a service from a monolith.
- Defining boundaries for a system that will be built as services.
- Diagnosing a distributed system that has become a "distributed monolith".
- Designing a transaction that spans services.

## Capabilities

- Boundary identification along business capabilities and data ownership.
- Communication design: synchronous versus asynchronous, and when each is correct.
- Distributed data: the outbox pattern, sagas, eventual consistency.
- Resilience: timeouts, retries with backoff, circuit breakers, bulkheads.
- Observability: correlation IDs and distributed tracing.

## Inputs

- The current system and the concrete problem services are meant to solve.
- Team topology — services follow team boundaries whether you intend them to or not.
- Consistency requirements per operation.

## Outputs

- Service boundaries with owned data and a published contract.
- A communication pattern per interaction, chosen deliberately.
- Failure behavior for each cross-service call.

## Workflow

1. **Justify the split** — The valid reasons are independent deployability, independent scaling, and team autonomy. "Microservices are best practice" is not a reason.
2. **Draw boundaries around data** — A service owns its data exclusively. If two services need the same table, they are one service.
3. **Prefer asynchronous** — A synchronous call chain of five services has the availability of the least available one, multiplied. Events decouple.
4. **Design the failure** — For every synchronous call: timeout, retry policy, circuit breaker, and a defined degraded behavior.
5. **Solve distributed writes with the outbox** — Write the state change and the event in one local transaction; publish from the outbox. Two-phase commit across services is not available to you.
6. **Trace everything** — Correlation ID propagated through every hop. Without it, a distributed system is undebuggable.

## Best Practices

- Start with a modular monolith. Enforce module boundaries in code; extract a service only when a module has a genuinely different deployment or scaling need.
- Shared databases between services are the single most common way a microservice architecture becomes worse than the monolith it replaced.
- Retries without idempotency cause duplicate side effects. Retries without backoff cause outages. Both are required, together.
- A synchronous call inside a request path adds its latency and its failure probability to yours. Count the hops.
- Do not build a service per entity. `UserService`, `OrderService`, `ProductService` is a database schema wearing a network.
- Version events. An event schema is a contract with consumers you cannot deploy in lockstep with.

## Examples

**Transactional outbox — the state change and the event commit atomically:**

```sql
BEGIN;
  UPDATE orders SET status = 'paid' WHERE id = $1;

  INSERT INTO outbox (id, aggregate_id, type, payload, created_at)
  VALUES (gen_random_uuid(), $1, 'order.paid',
          jsonb_build_object('order_id', $1, 'amount_cents', $2, 'version', 1),
          now());
COMMIT;
```

A separate relay polls `outbox`, publishes to the broker, and marks rows as sent. If the publish fails, the row remains and is retried; if the transaction rolls back, no event is emitted. The state and the event can never disagree.

**Saga compensation for a booking spanning three services:**

```text
1. Reserve inventory   -> compensate: release inventory
2. Charge payment      -> compensate: refund payment
3. Confirm shipment    -> compensate: cancel shipment

Failure at step 3 runs compensations for 2 and 1, in reverse order.
Each compensation must be idempotent — it will be retried.
```

## Notes

- Eventual consistency is a product decision, not just a technical one. Someone must decide what a user sees during the window, and that decision belongs in the design document.
- Circuit breakers need a defined behavior when open: fail fast, serve stale, or degrade. An open breaker with no fallback is just a faster failure.
- If the team cannot operate one service well — no tracing, no alerting, no runbook — ten services will not go better.

Versions

RepositoryScoreLicence
This page · nimadorostkar/Claude-Skills-collection100MIT
krzysztofsurdy/code-virtuoso100MIT
SkillMedev/skills100MIT
G1Joshi/Agent-Skills100MIT
MARUCIE/openclaw-foundry100MIT
Tyler-R-Kendrick/agent-skills100MIT
kid-sid/codex-spellbook100MIT
j4flmao/agent-skills95MIT
andreibesleaga/gabbe90CC-BY-4.0

Database snapshot: 13.11.2026 · package version 33982c65b4cd (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90microservices-architect
    Use when designing distributed systems, decomposing monoliths, or implementing microservices patterns. Invoke for service boundaries, DDD, saga patterns, event sourcing, service mesh, distributed tracing.
  • 80role-backend:microservices
    Designs and implements microservices architectures including service decomposition, synchronous (REST/gRPC) and asynchronous (event-driven) communication, saga pattern, circuit breaker, service mesh (Istio), API gateway, service discovery, and distributed tracing. Use when…
  • 100microservices-patterns
    Decompose systems into microservices and apply canonical distributed-systems patterns. Use this skill whenever the user wants to split a monolith into services, design service boundaries, choose between microservices and a modular monolith, implement sagas or the outbox pattern,…
  • 95microservices-patterns
    Design microservices architectures with service boundaries, event-driven communication, and resilience patterns. Use when building distributed systems, decomposing monoliths, or implementing microservices.
  • 95architecture-microservices-patterns
    Use this skill when the user says 'microservices patterns', 'split the monolith', 'saga', 'circuit breaker', 'service decomposition', 'database per service', 'API gateway', 'strangler fig', 'distributed monolith', 'service-to-service resilience'. Decides whether and how to…
  • 100microservices-architect
    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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.