Agent skill

Distributed Patterns

by revfactory in revfactory/harness-100

Implementation guide and selection matrix for core distributed system patterns (Saga, CQRS, Circuit Breaker, Event Sourcing, etc.).

Apache-2.0Auto-check passedBackend & APIs

Install Distributed Patterns

skills CLI
$ npx skills add revfactory/harness-100 --skill distributed-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install revfactory/harness-100 distributed-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .claude/skills && cp -r skills-src/en/23-microservice-designer/.claude/skills/distributed-patterns .claude/skills/distributed-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
distributed-patterns
GitHub stars
1.3k
Token cost
~1.5k tokens
SKILL.md length
301 words
Files
1
Skills in repo
464
Repo updated
First seen
Licence
Apache-2.0

At a glance

Implementation guide and selection matrix for core distributed system patterns (Saga, CQRS, Circuit Breaker, Event Sourcing, etc.).

  • Works in 5 steps: Saga Pattern → CQRS (Command Query Responsibility… → Circuit Breaker → …
  • Distributed transactions
  • SKILL.md covers 1. Saga Pattern, 2. CQRS (Command Query…, 3. Circuit Breaker and 4. Event Sourcing, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Distributed Patterns is an agent skill from revfactory/harness-100. Implementation guide and selection matrix for core distributed system patterns (Saga, CQRS, Circuit Breaker, Event Sourcing, etc.). Use this skill for 'distributed transactions', 'Saga pattern', 'CQRS', 'circuit breaker', 'event sourcing', 'distributed patterns', 'compensating transactions', 'eventual consistency', and other distributed system pattern applications. Enhances the distributed system design capabilities of communication-designer and service-architect. Note: infrastructure setup and monitoring…

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Event-driven systems and Microservices. The licence is Apache-2.0.

When your agent uses it

  • Distributed transactions
  • Circuit breaker
  • Distributed patterns
  • Compensating transactions

Example prompts

  • “distributed transactions”
  • “Saga pattern”
  • “circuit breaker”
  • “/distributed-patterns”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Saga Pattern
  2. CQRS (Command Query Responsibility Segregation)
  3. Circuit Breaker
  4. Event Sourcing
  5. API Gateway Patterns

What it can do on your machine

Read from SKILL.md and the folder at commit 8e8d35c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Distributed Patterns loads about 1.5k tokens when it runs. Until then it costs about 146 tokens; SKILL.md has 301 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~146
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from revfactory/harness-100 at commit 8e8d35c, republished under its Apache-2.0 licence (© revfactory). 301 words, ~1,499 tokens.

Download SKILL.mdSave it as .claude/skills/distributed-patterns/SKILL.md (or your agent's skills folder).
name
distributed-patterns
description
Implementation guide and selection matrix for core distributed system patterns (Saga, CQRS, Circuit Breaker, Event Sourcing, etc.). Use this skill for 'distributed transactions', 'Saga pattern', 'CQRS', 'circuit breaker', 'event sourcing', 'distributed patterns', 'compensating transactions', 'eventual consistency', and other distributed system pattern applications. Enhances the distributed system design capabilities of communication-designer and service-architect. Note: infrastructure setup and monitoring configuration are outside the scope of this skill.

Distributed Patterns — Core Distributed System Pattern Guide

Detailed pattern implementations for inter-microservice communication, data consistency, and fault tolerance.

1. Saga Pattern

Choreography vs Orchestration Selection
CriteriaChoreographyOrchestration
Number of services2-45 or more
Flow complexityLinearBranching/conditional
CouplingEvent-driven loose couplingCentralized in orchestrator
VisibilityDifficult to trace flowCentral state management
Failure handlingEach service self-compensatesOrchestrator coordinates compensation
Orchestration Saga Implementation
Order Saga:
T1: Create Order   --> C1: Cancel Order
T2: Reserve Stock  --> C2: Restore Stock
T3: Process Payment --> C3: Refund Payment
T4: Request Shipping --> C4: Cancel Shipping

Failure scenario (T3 fails):
T1 -> T2 -> T3(fail) -> C2(restore stock) -> C1(cancel order)
Saga State Machine
STARTED -> INVENTORY_RESERVED -> PAYMENT_PROCESSED -> SHIPPING_REQUESTED -> COMPLETED
    |           |                    |                    |
 FAILED -> COMPENSATING_INVENTORY -> COMPENSATING_PAYMENT -> COMPENSATING_SHIPPING
                                                              |
                                                         COMPENSATED

2. CQRS (Command Query Responsibility Segregation)

+----------+     Command     +---------------+
|  Client   | -------------->| Write Model   |--> Event Store
|           |                | (Normalized DB)|
|           |     Query      +---------------+
|           | <------------- | Read Model    |<-- Projection
|           |                | (Denormalized) |
+----------+                +---------------+

Application Criteria:

When to ApplyWhen NOT to Apply
Asymmetric read/write load (100:1)Simple CRUD apps
Read model and write model are very differentRead/write models are nearly identical
Complex domain logic + diverse viewsCannot tolerate eventual consistency
Used with event sourcingSmall team size (< 3 people)

3. Circuit Breaker

State Transitions
CLOSED --(failure rate > threshold)--> OPEN
   ^                                    |
   |                               (after timeout)
   |                                    v
   +---(success)--- HALF_OPEN ---(failure)---> OPEN
Configuration Guide
ParameterRecommended ValueDescription
failureRateThreshold50%Failure rate to trigger OPEN
slowCallRateThreshold80%Slow call rate threshold
slowCallDurationThreshold3sSlow call criteria
waitDurationInOpenState30sWait before HALF_OPEN transition
slidingWindowSize100Measurement window size
minimumNumberOfCalls10Minimum call count
Fallback Strategies
StrategyApplicationExample
Cached responseRead APIsReturn last successful response
Default valueNon-critical featuresPopular products instead of recommendations
Alternate servicePaymentSecondary PG when primary PG fails
QueuingCan be asyncStore order in queue for later processing
Error responseCritical featuresClear error message

4. Event Sourcing

Traditional approach: Store only current state
  Account { balance: 750 }

Event Sourcing: Store all change history
  1. AccountOpened  { id: A1 }
  2. MoneyDeposited { amount: 1000 }
  3. MoneyWithdrawn { amount: 250 }
  -> Reconstruct current state: balance = 0 + 1000 - 250 = 750

Snapshot Strategies:

StrategyConditionAdvantage
Event count-basedSnapshot every N eventsPredictable performance
Time-basedSnapshot every N minutesConsistent recovery time
On-demandOn cache miss during readStorage space savings

5. API Gateway Patterns

PatternDescriptionApplication
API CompositionCompose responses from multiple servicesBFF (Backend for Frontend)
Rate LimitingLimit request rateToken Bucket / Sliding Window
Request RoutingPath-based routing/api/v1/orders -> order-service
Protocol TranslationProtocol conversionREST -> gRPC, WebSocket -> HTTP

Pattern Combination Recipes

E-commerce Order Processing
Saga(Orchestration) + Event Sourcing + CQRS
+-- Order Saga: Coordinate inventory -> payment -> shipping
+-- Each service: Event sourcing for audit trail
+-- Order queries: Fast lookups via CQRS Read Model
Real-time Chat
Event-Driven + Circuit Breaker + API Gateway
+-- Messages: Event streaming (Kafka)
+-- Auxiliary features: Circuit Breaker (translation, filtering)
+-- Client: WebSocket Gateway

CAP Theorem Practical Application

              Consistency
                    /\
                   /  \
              CP  /    \ CA
                 /      \
                /________\
    Availability -------- Partition Tolerance
                  AP

Practical choices:
- CP: Payment, inventory (accuracy first)
- AP: Product browsing, recommendations (availability first)
- CA: Single-node DB (not distributed)

© revfactory, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in en/23-microservice-designer/.claude/skills/distributed-patterns of revfactory/harness-100.

Open the folder on GitHubat commit 8e8d35c

Compare with similar skills

Distributed Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Distributed Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Distributed Patterns this skillrevfactory/harness-1001.3k—~1.5kAutomated safety check: PassApache-2.0
AWS Serverless Edazxkane/aws-skills3674 repos~3.2kAutomated safety check: PassMIT
NestJS Modular Monolith Architecttech-leads-club/agent-skills7k—~3.9kAutomated safety check: PassCC-BY-4.0
Microservice Patternsrevfactory/claude-code-harness120—~502Automated safety check: PassNone
Microservices ArchitectJeffallan/claude-skills12k—~1.8kAutomated safety check: PassMIT
Architecture Selectionrsmdt/the-startup536—~1.2kAutomated safety check: PassMIT

Similar skills

  • AWS Serverless Eda

    zxkane/aws-skills

    AWS serverless and event-driven architecture expert based on Well-Architected Framework.

    367 GitHub starsUsed in 4 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • NestJS Modular Monolith Architect

    tech-leads-club/agent-skills

    Designs scalable NestJS modular monoliths with domain-driven design, Clean Architecture layers and optional CQRS, defining bounded contexts and strict module boundaries.

    7k GitHub stars~3.9k tokensUpdated 17 days ago
    Backend & APIsAuto-check passed
  • Microservice Patterns

    revfactory/claude-code-harness

    Event-driven microservice architecture patterns guide. An agent skill from revfactory/claude-code-harness.

    120 GitHub stars~502 tokensUpdated 7 mo ago
    Backend & APIsAuto-check passed
  • Microservices Architect

    Jeffallan/claude-skills

    Designs distributed systems: bounded-context service boundaries, sync and async communication, data ownership, resilience, tracing and rollout strategy.

    12k GitHub stars~1.8k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Architecture Selection

    rsmdt/the-startup

    System architecture patterns including monolith, microservices, event-driven, and serverless, with C4 modeling, scalability strategies, and technology selection criteria.

    536 GitHub stars~1.2k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • Saga Orchestration

    wshobson/agents

    Implement saga patterns for distributed transactions and cross-aggregate workflows.

    40k GitHub stars~1.5k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed

More from revfactory/harness-100

All 464 skills in this repo
  • Anti Bot Analyzer

    revfactory/harness-100

    A skill for analyzing website anti-bot defense mechanisms and developing legitimate evasion strategies.

    1.3k GitHub stars~1.1k tokensUpdated 6 mo ago
    Auto-check passed
  • API Error Design Patterns

    revfactory/harness-100

    Reference for designing how an API reports failures: structured error codes, response shapes, client-friendly messages, an error catalog and retry or fallback advice.

    1.3k GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed
  • API Security Checklist

    revfactory/harness-100

    Walks a backend-dev agent through OWASP API Top 10 checks, authentication and authorization patterns, and defense code during API design.

    1.3k GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Arg Parser Generator

    revfactory/harness-100

    Methodology for systematically designing and generating CLI tool argument parser structures.

    1.3k GitHub stars~1.2k tokensUpdated 6 mo ago
    Auto-check passed
  • Audience Segmentation

    revfactory/harness-100

    Audience segmentation skill used by the analyst and curator agents.

    1.3k GitHub stars~1.3k tokensUpdated 6 mo ago
    Auto-check passed
  • Audio Storytelling

    revfactory/harness-100

    Audio storytelling skill used by the podcast scriptwriter and show note editor.

    1.3k GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about Distributed Patterns

What does Distributed Patterns do?

Implementation guide and selection matrix for core distributed system patterns (Saga, CQRS, Circuit Breaker, Event Sourcing, etc.). Distributed Patterns is an agent skill from revfactory/harness-100.).

When should I use Distributed Patterns?

Distributed Patterns fits situations like: distributed transactions; circuit breaker; distributed patterns; compensating transactions.

How do I install Distributed Patterns in Claude Code?

Run `npx skills add revfactory/harness-100 --skill distributed-patterns -a claude-code`. Or copy the skill folder (en/23-microservice-designer/.claude/skills/distributed-patterns in revfactory/harness-100) into .claude/skills/distributed-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Distributed Patterns in Codex?

Run `npx skills add revfactory/harness-100 --skill distributed-patterns -a codex`. Or copy the skill folder (en/23-microservice-designer/.claude/skills/distributed-patterns in revfactory/harness-100) into .agents/skills/distributed-patterns in your project. Codex loads it when a task matches its description.

Can I use Distributed Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add revfactory/harness-100 --skill distributed-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/distributed-patterns, .gemini/skills/distributed-patterns, .github/skills/distributed-patterns and .opencode/skills/distributed-patterns in your project.

What does Distributed Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Distributed Patterns is instructions for the agent only.

Does Distributed Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Distributed Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Distributed Patterns use?

Distributed Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Distributed Patterns use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Distributed Patterns?

Skills that share tags, products or a category with Distributed Patterns: AWS Serverless Eda (zxkane/aws-skills, 367 stars), NestJS Modular Monolith Architect (tech-leads-club/agent-skills, 7k stars), Microservice Patterns (revfactory/claude-code-harness, 120 stars) and Microservices Architect (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Distributed Patterns?

revfactory (a GitHub user) maintains it in revfactory/harness-100, which has 1,290 GitHub stars. The repository holds 464 skills in this directory. The repository was last updated on March 22, 2026.

Source: revfactory/harness-100 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.