/polymath-architecture:resilience-designfrom polymath-architecture
Design resilience for a dependency call path — timeout, retry with backoff+jitter, circuit breaker, bulkhead, fallback, load-shedding — with a failure-mode table.
Ships in polymath-architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Every remote call fails eventually. Resilience is deciding what happens then — on purpose, with numbers — instead of discovering it during an incident.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
polymath-architecture:resilience-design.Not this when: you are setting the latency/throughput target itself — that is polymath-performance:perf-budget / backend-tail-latency. This skill specifies behavior under failure, not the budget.
Per-caller quotas and 429 contracts are polymath-scalability:rate-limiting-design; queue backpressure and worker sizing are polymath-scalability:async-workload-design; regional failure is polymath-scalability:multi-region-design.
429, 503, and 408 are retryable — honor Retry-After.Resilience spec: checkout → payments-api (user-blocking, POST /charges)
Timeout: 1.2 s (payments p99 = 900 ms) within the 3 s request deadline; remaining deadline propagated
Retry: 2 attempts max, exponential backoff 100 ms × 2ⁿ with full jitter; only with Idempotency-Key;
retry on 408/429/503 (honor Retry-After) and connect errors; never on other 4xx;
retries only in the payments client (not the gateway); retry budget ≤ 10% of requests
Breaker: open at ≥ 50% errors over 20 requests in 10 s; half-open after 30 s with 5 probes
Bulkhead: payments pool 40 connections (of 200 total); separate from inventory's 20
Fallback: breaker open → "payment temporarily unavailable, your cart is saved" (clean 503)
Load shed: edge concurrency limit 500; above → 429 + Retry-After: 2
Failure mode Response User sees
timeout retry once with same key slower checkout (≤ 2.5 s)
5xx retry, then breaker counts it error after retries
connection refused no retry after 2nd; breaker fallback message
slow (p99 > 2 s) timeout fires at 1.2 s fallback message
Inline by default; when a workflow step or the user wants it kept, write it to docs/architecture/<slug>-resilience.md (slug from the system or context name, lowercased, non-a-z0-9 runs → -).
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-architecture8 skills in this plugin
/aggregate-designDesign DDD tactical aggregates for a bounded context — aggregate roots, entities vs value objects, invariants, transaction/consistency boundaries, reference-by-id./bounded-context-mapMap a domain into DDD bounded contexts + a context map (customer-supplier, conformist, anti-corruption layer, shared kernel) with per-context ubiquitous language./design-patterns-applyReview a design sketch against SOLID, GoF, and architectural patterns; flag anti-patterns at design time; not line-level code review (code-review)./distributed-consistencyChoose a consistency model for a cross-node operation — strong/eventual/causal, CAP/PACELC trade-off, idempotency + dedup, and when consensus (Raft/quorum) is warranted vs simpler./event-driven-designDesign an event-driven flow — event catalog, choreography vs orchestration, saga + compensation, the outbox pattern for dual-writes, idempotent consumers, and CQRS read models./integration-designDesign integration between two services — sync vs async, API gateway / BFF placement, anti-corruption layer, contract + versioning, ports-and-adapters, and backpressure handling.