Distributed Systems Patterns logo

Distributed Systems Patterns

Community
peterbamuhigire
distributed-systems-patterns

Use when designing or reviewing multi-service, message-driven, or eventually consistent systems. Covers service boundaries, consistency tradeoffs, event workflows, outbox and inbox patterns, sagas, ordering, and idempotency.

Overview

Publisherpeterbamuhigire
Repositorychwezi-dev-engine
Skill namedistributed-systems-patterns
Stars
29
Forks
6
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by peterbamuhigire on GitHub. Read the source before you install it.

Installation

Install the Distributed Systems Patterns AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/architecture/distributed-systems-patterns
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/architecture/distributed-systems-patterns .claude/skills/distributed-systems-patterns
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Distributed Systems Patterns in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Distributed Systems Patterns on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Distributed Systems Patterns is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Distributed Systems Patterns

Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

Use When

  • Use when designing or reviewing multi-service, message-driven, or eventually consistent systems. Covers service boundaries, consistency tradeoffs, event workflows, outbox and inbox patterns, sagas, ordering, and idempotency.

Do Not Use When

  • The change is a single-process transaction with no remote dependency, asynchronous delivery, or independently failing component.
  • The task is mainly service decomposition or API shape; use system-architecture-design or api-design-first and return here for cross-boundary failure semantics.

Required Inputs

InputRequiredWhy it matters
Workflow steps and system boundariesyesIdentifies where atomicity ends and partial failure begins
Delivery, ordering, and consistency requirementsyesDetermines idempotency, sequencing, and reconciliation choices
Failure and recovery expectationsyesSets timeout, retry, compensation, and operator intervention rules
Throughput and latency constraintsconditionalTests whether the coordination pattern is viable

Workflow

Draw state transitions and ownership boundaries, enumerate failure windows, choose consistency and coordination patterns, define idempotency and recovery, then verify duplicate, reordered, delayed, and partially applied events.

Quality Standards

Every remote interaction has a timeout and failure policy. Every retried side effect has an idempotency rule. Consistency claims state their scope, and recovery does not assume exactly-once delivery.

Outputs

OutputConsumerAcceptance condition
Distributed workflow modelArchitecture and implementation teamsShows state ownership, message boundaries, consistency guarantees, and failure windows
Failure-handling contractService ownersDefines timeout, retry, deduplication, compensation, replay, and reconciliation behavior
Verification scenariosTest and operations teamsCover duplicates, reordering, concurrency, dependency outage, and partial completion

Evidence Produced

CategoryArtifactFormatExample
OperabilityService consistency and idempotency noteMarkdown doc covering chosen consistency model, idempotency keys, and saga sequencesdocs/dist/consistency-note-checkout.md
OperabilityFailure-mode catalogueMarkdown doc listing partition, retry, and replay failure modes with mitigationsdocs/dist/failure-modes-checkout.md

References

  • Use the references/ directory for deep detail after reading the core workflow below.
  • Load references/event-driven-architecture.md for event choreography, event contracts, brokers, and asynchronous workflow design.
  • Load references/realtime-systems.md for WebSocket, SSE, pub/sub, and realtime delivery concerns.

Use this skill when a design crosses process, service, queue, or region boundaries. The goal is to keep distributed complexity deliberate and bounded rather than accidental.

Load Order

  1. Load world-class-engineering.
  2. Load system-architecture-design first for the overall shape.
  3. Load this skill only when the system genuinely needs multiple services, asynchronous workflows, or weakly consistent boundaries.

Decision Workflow

1. Justify Distribution

State why distribution is necessary:

  • team ownership and release independence
  • scaling asymmetry
  • fault isolation
  • compliance or tenancy isolation
  • long-running or bursty workflows

If none of these are strong, prefer a modular monolith.

2. Define Boundaries and Contracts

For each service or asynchronous component, define:

  • owned data
  • API or event contracts
  • consistency expectation
  • failure effect on upstream and downstream flows
  • observability and ownership requirements

3. Choose Interaction Patterns

Use:

  • synchronous calls when the caller needs immediate confirmation
  • messaging when work is slow, bursty, or naturally eventual
  • outbox and inbox patterns when reliability across boundaries matters
  • sagas or compensations when one business workflow spans multiple durable states

4. Design Consistency and Recovery

Make explicit:

  • source of truth
  • ordering requirements
  • deduplication strategy
  • reconciliation path
  • timeout and retry policy
  • compensation or manual repair path

5. Prove the Design

Before calling it production-ready, provide:

  • consistency model
  • failure-mode examples
  • idempotency and replay notes
  • contract evolution rules
  • operational signals for stuck or divergent workflows

Non-Negotiable Standards

Service Boundaries

  • Each service owns its data and rules.
  • Do not share databases across services as a convenience.
  • Keep contracts narrow and versionable.
  • Avoid chatty request chains on critical paths.

Messaging

  • Assume at-least-once delivery unless proven otherwise.
  • Design consumers to be idempotent and replay-safe.
  • Define ordering needs explicitly; unordered by default is safer to assume.
  • Include correlation IDs and causation metadata.

Consistency

  • Strong consistency has operational cost; use it where business correctness needs it.
  • Eventual consistency requires visible user and operator handling.
  • If divergence is possible, define reconciliation before shipping.

Sagas and Compensation

  • Use compensation when the workflow spans multiple irreversible boundaries.
  • Compensation must be explicit, auditable, and tested.
  • Never describe a workflow as atomic if it crosses systems that cannot commit atomically.

Deliverables

For distributed-system work, produce:

  • service and ownership map
  • contract list
  • consistency decision table
  • event and retry flow notes
  • reconciliation or compensation plan
  • stuck-workflow and replay detection signals

Review Checklist

  • Distribution is justified by real constraints.
  • Data ownership is explicit and not undermined by shared persistence shortcuts.
  • Idempotency and replay behavior are defined.
  • Ordering assumptions are explicit.
  • Consistency and compensation strategy match business risk.
  • Operational detection exists for stuck, duplicated, or divergent workflows.

References

Capability contract

Model boundaries, messages, and failure semantics by default. Do not provision brokers, replay events, or mutate production state unless explicitly authorised.

Degraded mode

If topology or failure evidence is unavailable, return a read-only pattern comparison and assumptions register; withhold recommendations dependent on unknown delivery guarantees.

Domain Anti-Patterns

  • Assuming exactly-once delivery. Fix: define idempotency and deduplication.
  • Sharing one database across autonomous services. Fix: assign data ownership.
  • Publishing before the state change commits. Fix: use a transactional outbox.
  • Retrying non-idempotent commands blindly. Fix: add keys and retry limits.
  • Omitting poison-message handling. Fix: define dead-letter and replay controls.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Distributed Systems Patterns AI skill do?

Use when designing or reviewing multi-service, message-driven, or eventually consistent systems. Covers service boundaries, consistency tradeoffs, event workflows, outbox and inbox patterns, sagas, ordering, and idempotency.

Why use Distributed Systems Patterns on TypingMind?

Because you install it once and use it with any model. Distributed Systems Patterns is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Distributed Systems Patterns in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/architecture/distributed-systems-patterns. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Distributed Systems Patterns?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Distributed Systems Patterns?

As many as you like. As long as a model supports skills, you can use Distributed Systems Patterns with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Distributed Systems Patterns AI skill free?

Yes. It is published on GitHub by peterbamuhigire under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇