agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
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.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill microservices --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/microservicesContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
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. metadata: category: backend version: 1.0.0 tags: [microservices, distributed-systems, saga, boundaries]
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.
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.
**Transactional outbox — the state change and the event commit atomically:**
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:**
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.
A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…