Agent skill

Distributed Systems

by yonatangross in yonatangross/orchestkit

Distributed systems patterns for locking, resilience, idempotency, and rate limiting.

MITAuto-check passedBackend & APIs

Install Distributed Systems

skills CLI
$ npx skills add yonatangross/orchestkit --skill distributed-systems -a claude-code

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

GitHub CLI
$ gh skill install yonatangross/orchestkit distributed-systems --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/yonatangross/orchestkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/skills/distributed-systems .claude/skills/distributed-systems && 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-systems
GitHub stars
288
Token cost
~2.6k tokens
SKILL.md length
757 words
Files
25 (incl. scripts, references)
Skills in repo
107
Repo updated
First seen
Licence
MIT

At a glance

Distributed systems patterns for locking, resilience, idempotency, and rate limiting.

  • Implementing distributed locks
  • SKILL.md covers Quick Reference, Quick Start, Distributed Locks and Resilience, plus 10 more sections
  • Runs Python scripts from its folder
  • Circuit breakers

What it does

Distributed Systems is an agent skill from yonatangross/orchestkit. Distributed systems patterns for locking, resilience, idempotency, and rate limiting. Use when implementing distributed locks, circuit breakers, retry policies, idempotency keys, token bucket rate limiters, or fault tolerance patterns.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 27 other files, including scripts and reference files (for example `metadata.json`, `references/ork-delta.md` and `rules/_sections.md`). Compatibility notes: Claude Code 2.1.277+.

It sits in Backend & APIs, covering Rate limiting and Event-driven systems. The repository describes itself as: The Complete AI Development Toolkit for Claude Code. 106 skills, 36 agents, 171 hooks. Install ork for stable (v9.x), or ork-alpha for the v10 line, which ships daily. The licence is MIT.

When your agent uses it

  • Implementing distributed locks
  • Circuit breakers
  • Idempotency keys
  • Token bucket rate limiters

Example prompts

  • “/distributed-systems”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Claude Code 2.1.277+.
  • Pre-approved tools (allowed-tools): Read, Glob, Grep, WebFetch, WebSearch

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep
    • WebFetch
    • WebSearch

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python, from the files we listed), which the agent can run.

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

  • Network

    Links to these hosts (documentation or services it may open):

    • redis.io
    • learn.microsoft.com
    • docs.claude.com
    • postgresql.org
    • aws.amazon.com
    • tenacity.readthedocs.io
    • platform.openai.com
    • docs.stripe.com
    • slowapi.readthedocs.io
    • vercel.com

    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.

  • Compatibility

    Claude Code 2.1.277+.

    From compatibility in the SKILL.md frontmatter.

Context cost

Distributed Systems loads about 2.6k tokens when it runs, and up to ~3.2k if it reads all its reference files. Until then it costs about 64 tokens; SKILL.md has 757 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.2k

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); the scripts in this folder are not scanned.

SKILL.md

The full file from yonatangross/orchestkit at commit 1f8d8f3, republished under its MIT licence (© yonatangross). 757 words, ~2,627 tokens.

Download SKILL.mdSave it as .claude/skills/distributed-systems/SKILL.md (or your agent's skills folder). This skill also uses 24 other files; get the full folder from GitHub.
name
distributed-systems
description
Distributed systems patterns for locking, resilience, idempotency, and rate limiting. Use when implementing distributed locks, circuit breakers, retry policies, idempotency keys, token bucket rate limiters, or fault tolerance patterns.
allowed-tools
Read, Glob, Grep, WebFetch, WebSearch
compatibility
Claude Code 2.1.277+.
license
MIT
context
fork
agent
backend-system-architect
user-invocable
false
disable-model-invocation
true
metadata.category
document-asset-creation
metadata.version
2.0.0
metadata.author
OrchestKit
metadata.complexity
medium
metadata.tags
distributed-systems, distributed-locks, resilience, circuit-breaker, idempotency, rate-limiting, retry, fault-tolerance, edge-computing, cloudflare-workers…

Distributed Systems Patterns

Comprehensive patterns for building reliable distributed systems. Each category has individual rule files in rules/ loaded on-demand.

Quick Reference

CategoryRulesImpactWhen to Use
Distributed Locks1CRITICALFencing tokens, owner validation; Redis/Redlock and Postgres advisory via upstream docs
Resilience3CRITICALCircuit breakers, retry with backoff, bulkhead isolation
Idempotency1HIGHIdempotency keys; dedup and database-backed storage via upstream docs
Rate Limiting2HIGHToken bucket, sliding window; SlowAPI integration via upstream docs
Edge Computing2HIGHEdge workers, V8 isolates, CDN caching, geo-routing
Event-Driven2HIGHEvent sourcing, CQRS, transactional outbox, sagas

Total: 11 rules across 6 categories. Removed topics point at first-party sources in Upstream coverage; ork-specific scars live in references/ork-delta.md.

Quick Start

python
# Redis distributed lock with Lua scripts
async with RedisLock(redis_client, "payment:order-123"):
    await process_payment(order_id)

# Circuit breaker for external APIs
@circuit_breaker(failure_threshold=5, recovery_timeout=30)
@retry(max_attempts=3, base_delay=1.0)
async def call_external_api():
    ...

# Idempotent API endpoint
@router.post("/payments")
async def create_payment(
    data: PaymentCreate,
    idempotency_key: str = Header(..., alias="Idempotency-Key"),
):
    return await idempotent_execute(db, idempotency_key, "/payments", process)

# Token bucket rate limiting
limiter = TokenBucketLimiter(redis_client, capacity=100, refill_rate=10)
if await limiter.is_allowed(f"user:{user_id}"):
    await handle_request()

Distributed Locks

Coordinate exclusive access to resources across multiple service instances.

RuleFileKey Pattern
Fencing Tokensrules/locks-fencing-tokens.mdOwner validation, TTL, heartbeat extension

Redis single-node locks, Redlock quorum, and PostgreSQL advisory locks are first-party documented; see Upstream coverage.

Resilience

Production-grade fault tolerance for distributed systems.

RuleFileKey Pattern
Circuit Breakerrules/resilience-circuit-breaker.mdCLOSED/OPEN/HALF_OPEN states, sliding window
Retry & Backoffrules/resilience-retry-backoff.mdExponential backoff, jitter, error classification
Bulkhead Isolationrules/resilience-bulkhead.mdSemaphore tiers, rejection policies, queue depth

Idempotency

Ensure operations can be safely retried without unintended side effects.

RuleFileKey Pattern
Idempotency Keysrules/idempotency-keys.mdDeterministic hashing, Stripe-style headers

Event-consumer dedup and database-backed idempotency storage follow the Stripe pattern; see Upstream coverage.

Rate Limiting

Protect APIs with distributed rate limiting using Redis.

RuleFileKey Pattern
Token Bucketrules/ratelimit-token-bucket.mdRedis Lua scripts, burst capacity, refill rate
Sliding Windowrules/ratelimit-sliding-window.mdSorted sets, precise counting, no boundary spikes

SlowAPI + Redis wiring and tiered limits are first-party documented; see Upstream coverage.

Edge Computing

Edge runtime patterns for Cloudflare Workers, Vercel Edge, and Deno Deploy.

RuleFileKey Pattern
Edge Workersrules/edge-workers.mdV8 isolate constraints, Web APIs, geo-routing, auth at edge
Edge Cachingrules/edge-caching.mdCache-aside at edge, CDN headers, KV storage, stale-while-revalidate

Event-Driven

Event sourcing, CQRS, saga orchestration, and reliable messaging patterns.

RuleFileKey Pattern
Event Sourcingrules/event-sourcing.mdEvent-sourced aggregates, CQRS read models, optimistic concurrency
Event Messagingrules/event-messaging.mdTransactional outbox, saga compensation, idempotent consumers

Upstream coverage (do not restate)

These topics were removed from this skill on 2026-07-31 (wrap-plus-delta thinning) because a first-party source maintains them. Consult the source; do not re-add tutorials here. Ork-specific scars for these topics live in references/ork-delta.md.

TopicFirst-party source
Redis single-node locks, Redlock algorithm and quorumhttps://redis.io/docs/latest/develop/use/patterns/distributed-locks/
PostgreSQL advisory locks (session and transaction level)https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS
Circuit breaker pattern, thresholds, setup and rollout guideshttps://learn.microsoft.com/azure/architecture/patterns/circuit-breaker
Bulkhead pattern deep dive (thread pool, semaphore, tiers)https://learn.microsoft.com/azure/architecture/patterns/bulkhead
Retry strategies, exponential backoff, jitter, retry budgetshttps://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ and https://tenacity.readthedocs.io
HTTP and LLM provider error classification (retryable vs not)https://docs.claude.com/en/api/errors and https://platform.openai.com/docs/guides/error-codes
Idempotency keys, request dedup, database-backed idempotencyhttps://docs.stripe.com/api/idempotent_requests
Token bucket algorithm and Redis rate-limiting patternshttps://redis.io/glossary/rate-limiting/
FastAPI distributed rate limiting (SlowAPI middleware, tiers)https://slowapi.readthedocs.io/
LLM fallback chains, provider failover, cost trackinghttps://vercel.com/docs/ai-gateway; model ids and pricing at https://docs.claude.com/en/docs/about-claude/pricing
Show full SKILL.md (276 more words)Show less

Key Decisions

DecisionRecommendation
Lock backendRedis for speed, PostgreSQL if already using it, Redlock for HA
Lock TTL2-3x expected operation time
Circuit breaker recoveryHalf-open probe with sliding window
Retry algorithmExponential backoff + full jitter
Bulkhead isolationSemaphore-based tiers (Critical/Standard/Optional)
Idempotency storageRedis (speed) + DB (durability), 24-72h TTL
Rate limit algorithmToken bucket for most APIs, sliding window for strict quotas
Rate limit storageRedis (distributed, atomic Lua scripts)

When NOT to Use

No separate event-sourcing/saga/CQRS skills exist; they are rules within distributed-systems. But most projects never need them.

PatternInterviewHackathonMVPGrowthEnterpriseSimpler Alternative
Event sourcingOVERKILLOVERKILLOVERKILLOVERKILLWHEN JUSTIFIEDAppend-only table with status column
Saga orchestrationOVERKILLOVERKILLOVERKILLSELECTIVEAPPROPRIATESequential service calls with manual rollback
Circuit breakerOVERKILLOVERKILLBORDERLINEAPPROPRIATEREQUIREDTry/except with timeout
Distributed locksOVERKILLOVERKILLBORDERLINEAPPROPRIATEREQUIREDDatabase row-level lock (SELECT FOR UPDATE)
CQRSOVERKILLOVERKILLOVERKILLOVERKILLWHEN JUSTIFIEDSingle model for read/write
Transactional outboxOVERKILLOVERKILLOVERKILLSELECTIVEAPPROPRIATEDirect publish after commit
Rate limitingOVERKILLOVERKILLSIMPLE ONLYAPPROPRIATEREQUIREDNginx rate limit or cloud WAF

Rule of thumb: If you have a single server process, you do not need distributed systems patterns. Use in-process alternatives. Add distribution only when you actually have multiple instances.

Anti-Patterns (FORBIDDEN)

python
# LOCKS: Never forget TTL (causes deadlocks)
await redis.set(f"lock:{name}", "1")  # WRONG - no expiry!

# LOCKS: Never release without owner check
await redis.delete(f"lock:{name}")  # WRONG - might release others' lock

# RESILIENCE: Never retry non-retryable errors
@retry(max_attempts=5, retryable_exceptions={Exception})  # Retries 401!

# RESILIENCE: Never put retry outside circuit breaker
@retry  # Would retry when circuit is open!
@circuit_breaker
async def call(): ...

# IDEMPOTENCY: Never use non-deterministic keys
key = str(uuid.uuid4())  # Different every time!

# IDEMPOTENCY: Never cache error responses
if response.status_code >= 400:
    await cache_response(key, response)  # Errors should retry!

# RATE LIMITING: Never use in-memory counters in distributed systems
request_counts = {}  # Lost on restart, not shared across instances

Detailed Documentation

ResourceDescription
scripts/Templates: lock implementations, circuit breaker, rate limiter
references/ork-delta.mdOrk-specific scars and house decisions kept after the wrap-plus-delta thinning
  • caching - Redis caching patterns, cache as fallback
  • background-jobs - Job deduplication, async processing with retry
  • observability-monitoring - Metrics and alerting for circuit breaker state changes
  • error-handling-rfc9457 - Structured error responses for resilience failures
  • auth-patterns - API key management, authentication integration

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

Files

SKILL.md and 24 other files (scripts, references) in src/skills/distributed-systems of yonatangross/orchestkit.

  • SKILL.md
  • metadata.json
  • references/ork-delta.md
  • rules/_sections.md
  • rules/_template.md
  • rules/edge-caching.md
  • rules/edge-workers.md
  • rules/event-messaging.md
  • rules/event-sourcing.md
  • rules/idempotency-keys.md
  • rules/locks-fencing-tokens.md
  • rules/ratelimit-sliding-window.md
  • rules/ratelimit-token-bucket.md
  • rules/resilience-bulkhead.md
  • rules/resilience-circuit-breaker.md
  • rules/resilience-retry-backoff.md
  • scripts/bulkhead.py
  • scripts/circuit-breaker.py
  • … and 7 more

Open the folder on GitHubat commit 1f8d8f3

Compare with similar skills

Distributed Systems 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 Systems compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Distributed Systems this skillyonatangross/orchestkit288—~2.6kAutomated safety check: PassMIT
Redis Patternsaffaan-m/ECC274k1 repos~3kAutomated safety check: PassMIT
Amazon Elasticacheaws/agent-toolkit-for-aws2.8k—~4.5kAutomated safety check: PassApache-2.0
Designing APIsancoleman/ai-design-components5261 repos~2.6kAutomated safety check: PassMIT
Redis Cachingcohen-liel/hivemind110—~873Automated safety check: PassApache-2.0
Rediskid-sid/claude-spellbook189—~4.4kAutomated safety check: PassMIT

Similar skills

  • Redis Patterns

    affaan-m/ECC

    Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications.

    274k GitHub starsUsed in 1 repo~3k tokens
    Backend & APIsAuto-check passed
  • Amazon Elasticache

    aws/agent-toolkit-for-aws

    Official

    Activate when developers have latent caching needs: slow API responses, database read bottlenecks, DynamoDB throttling or cost, RDS/Aurora scaling pressure, Bedrock latency or cost, or adding a…

    2.8k GitHub stars~4.5k tokensUpdated today
    Backend & APIsAuto-check passed
  • Designing APIs

    ancoleman/ai-design-components

    Design APIs that are secure, scalable, and maintainable using RESTful, GraphQL, and event-driven patterns.

    526 GitHub starsUsed in 1 repo~2.6k tokens
    Backend & APIsAuto-check passed
  • Redis Caching

    cohen-liel/hivemind

    Redis caching and queue patterns. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~873 tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • Redis

    kid-sid/claude-spellbook

    A skill your agent uses when choosing a Redis data structure for a use case, implementing caching or rate limiting, building pub/sub or Streams-based real-time messaging, or writing atomic…

    189 GitHub stars~4.4k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed
  • System Design Building Blocks

    HoangNguyen0403/agent-skills-standard

    Select infrastructure components by the constraint each removes: load balancers, caches and invalidation, queues and pub/sub, CDN, API gateway, rate limiting, consistent hashing.

    570 GitHub stars~970 tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from yonatangross/orchestkit

All 107 skills in this repo
  • API Design

    yonatangross/orchestkit

    API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows, RFC 9457 Problem Details error handling, and OpenAPI specs.

    288 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Architecture Decision Record

    yonatangross/orchestkit

    ADR templates in the Nygard format with context, decision, consequences, and alternatives.

    288 GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Audit Full

    yonatangross/orchestkit

    Single-pass codebase analysis leveraging a 1M-token context window for comprehensive security scanning, architecture review, and dependency auditing.

    288 GitHub stars~3.5k tokensUpdated yesterday
    Auto-check: notes
  • Code Review Playbook

    yonatangross/orchestkit

    Structured review processes, conventional comments, language-specific checklists, and feedback templates.

    288 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Create PR

    yonatangross/orchestkit

    Creates GitHub pull requests with pre-flight validation, conventional title formatting, and structured summary generation.

    288 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check: notes
  • Explore

    yonatangross/orchestkit

    Multi-angle codebase exploration spawning 3-5 parallel agents for code structure, data flow, architecture patterns, and health assessment.

    288 GitHub stars~3.9k tokensUpdated yesterday
    Auto-check: notes

Categories

Questions about Distributed Systems

What does Distributed Systems do?

Distributed systems patterns for locking, resilience, idempotency, and rate limiting. Distributed Systems is an agent skill from yonatangross/orchestkit. Distributed systems patterns for locking, resilience, idempotency, and rate limiting.

When should I use Distributed Systems?

Distributed Systems fits situations like: implementing distributed locks; circuit breakers; idempotency keys; token bucket rate limiters.

How do I install Distributed Systems in Claude Code?

Run `npx skills add yonatangross/orchestkit --skill distributed-systems -a claude-code`. Or copy the skill folder (src/skills/distributed-systems in yonatangross/orchestkit) into .claude/skills/distributed-systems in your project. Claude Code loads it when a task matches its description.

How do I install Distributed Systems in Codex?

Run `npx skills add yonatangross/orchestkit --skill distributed-systems -a codex`. Or copy the skill folder (src/skills/distributed-systems in yonatangross/orchestkit) into .agents/skills/distributed-systems in your project. Codex loads it when a task matches its description.

Can I use Distributed Systems 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 yonatangross/orchestkit --skill distributed-systems -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-systems, .gemini/skills/distributed-systems, .github/skills/distributed-systems and .opencode/skills/distributed-systems in your project.

What does Distributed Systems need to run?

Going by SKILL.md and its folder, Distributed Systems needs Python for the scripts in its folder. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Glob, Grep, WebFetch, WebSearch. Compatibility (from SKILL.md): Claude Code 2.1.277+..

Does Distributed Systems access the network?

SKILL.md names 10 domains. As links in the text: redis.io, learn.microsoft.com, docs.claude.com, postgresql.org, aws.amazon.com, tenacity.readthedocs.io, platform.openai.com, docs.stripe.com, slowapi.readthedocs.io and vercel.com. This is read from the text; nothing was executed.

Is Distributed Systems 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Distributed Systems use?

Distributed Systems is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Distributed Systems use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 602 tokens, read only when the agent opens those files.

What are the alternatives to Distributed Systems?

Skills that share tags, products or a category with Distributed Systems: Redis Patterns (affaan-m/ECC, 274k stars), Amazon Elasticache (aws/agent-toolkit-for-aws, 2.8k stars), Designing APIs (ancoleman/ai-design-components, 526 stars) and Redis Caching (cohen-liel/hivemind, 110 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Distributed Systems?

yonatangross (a GitHub user) maintains it in yonatangross/orchestkit, which has 288 GitHub stars. The repository holds 107 skills in this directory. The repository was last updated on October 6, 2026.

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