api-design
This skill should be used when the user needs to "design the API", do "endpoint design", pin down a "request/response shape",…
This skill should be used when the user asks about "fault tolerance", "resilience", a "circuit breaker", "graceful degradation", "retry storm" or "thundering herd on recovery", "exponential backoff with jitter", "timeout", "bulkhead", a "single point of failure" (SPOF),
Claude Code
$ npx -y skills add proyecto26/system-design-skills --skill resilience-failure --agent claude-code
Codex
$ npx skills add proyecto26/system-design-skills --skill resilience-failure -a codex -y
Cursor
$ npx skills add proyecto26/system-design-skills --skill resilience-failure -a cursor -y
Gemini CLI
$ npx skills add proyecto26/system-design-skills --skill resilience-failure -a gemini-cli -y
GitHub Copilot
$ npx skills add proyecto26/system-design-skills --skill resilience-failure -a github-copilot -y
OpenCode
$ npx skills add proyecto26/system-design-skills --skill resilience-failure -a opencode -y
Windsurf
$ npx skills add proyecto26/system-design-skills --skill resilience-failure -a windsurf -y
name: resilience-failure description: This skill should be used when the user asks about "fault tolerance", "resilience", a "circuit breaker", "graceful degradation", "retry storm" or "thundering herd on recovery", "exponential backoff with jitter", "timeout", "bulkhead", a "single point of failure" (SPOF), "failover", or "rate limiting" (token bucket / leaky bucket / sliding window). Use it whenever a design must keep working through node crashes, slow dependencies, traffic spikes, or partial outages — i.e. any time the answer to "what happens when this breaks?" is missing, even if the user doesn't say "resilience".
Design the system so that when a part breaks — and it will — the failure is contained and the user still gets a useful (if degraded) answer instead of an error page or a cascading outage. Getting this wrong is the difference between a slow dependency and a total meltdown: the most common amplifier of an outage is the system's own reaction to it (retry storms, health-check stampedes).
Any design with a remote dependency, a shared resource, or an SLA. Reach here to find single points of failure, decide what each call does when its dependency is slow or down, protect a service from being overwhelmed (rate limiting), and plan how a recovered service comes back without being crushed by the backlog.
Don't wrap a single in-process function or a best-effort batch job in circuit breakers and bulkheads — that's machinery for cross-process/cross-network calls (YAGNI). Don't add retries to a non-idempotent write without an idempotency key first (→ `api-design`) — you'll duplicate side effects. The cheapest design that meets the availability target wins; chasing an extra nine you don't need costs real complexity (→ `back-of-the-envelope` for what a nine actually buys).
Layered defenses; most real designs combine several.
the root of most cascades.
randomized delays. Use for idempotent calls against blips; never naked retries.
probe to recover. Use when a downstream is down or slow and retries would pile on.
dependency. Use so one slow dependency can't exhaust capacity shared by others.
default, or hidden feature. Use when a usable-but-worse answer beats an error.
Use to protect a service from overload, abuse, or a stampeding caller.
failure. Use to remove SPOFs. (Health checks/LB failover live in `load-balancing`.)
Rate-limiting algorithms (token bucket, leaky bucket, fixed/sliding window) and the circuit-breaker state machine are detailed in `references/deep-dive.md`.
| Option | What it solves | What it worsens | Change it when | |---|---|---|---| | Timeout | Bounds blocked threads; stops one slow call hanging the caller | Too tight → false failures; too loose → cascades | Tune to the dependency's p99, not a guess | | Retry + backoff + jitter | Rides out transient blips | Multiplies load; duplicates non-idempotent writes | Add jitter + cap attempts + budget; require idempotency | | Circuit breaker | Fails fast, gives a sick dependency room to recover | Adds state/tuning; can trip on a blip and over-shed | Flapping → tune thresholds / half-open probe rate | | Bulkhead | Contains one failure to its own pool | Lower peak utilization; more pools to size | One noisy dependency starves others | | Graceful degradation | Keeps the user served when a dependency dies | Serves stale/partial; more code paths to test | Correctness must be exact → fail closed instead | | Rate limiting | Protects the service; bounds cost/abuse | Rejects legitimate bursts; needs shared state at scale | Limits too strict (valid drops) or too loose (overload) | | Redundancy / failover | Removes SPOFs; survives node/region loss | Cost, replication lag, failover consistency risk | Failover drops un-replicated writes → `consistency-coordination` |
This block exists to stop the system from amplifying its own outage.
retries of callers upstream, and load multiplies geometrically. *Mitigate:* exponential backoff with **jitter**, a per-request **retry budget** (cap total attempts), and a circuit breaker so a dead dependency isn't retried at all.
and expired cache entry hits it at once, knocking it over again. *Mitigate:* half-open circuit breakers that admit a trickle, jittered client reconnect, request coalescing, and slow-start ramp. (Cache-expiry stampede is `caching`.)
load-balancer probes hammer a recovering instance. *Mitigate:* gentle probe intervals, fail-fast readiness, and draining. (Pro
Made in code with Remotion — the same scenes power the site's hero (site/src/motion/). Design scalable systems the way strong engineers actually do — by reasoning, not by memorizing diagrams.
This skill should be used when the user needs to "design the API", do "endpoint design", pin down a "request/response shape",…
This skill should be used when a system design needs a diagram — "draw the architecture", "diagram this system", "show the…
This skill should be used when the user needs to "estimate QPS", "back-of-the-envelope" (BOTEC) numbers, "how much storage /…
This skill should be used when the user wants a "blob store" or "object storage", names "S3" or an S3-compatible store, needs to…
This skill should be used when the user asks about a "caching strategy", "cache invalidation", "what to cache", "read-through vs…
This skill should be used when the user asks about the "CAP theorem", "PACELC", a "consistency model", "eventual vs strong…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.