Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add BuilderCed/agent-skills --skill api-resilience-patternsgit clone --depth 1 https://github.com/BuilderCed/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/builderced/agent-skills/api-resilience-patterns)<a href="https://agentmods.dev/skills/builderced/agent-skills/api-resilience-patterns"><img src="https://agentmods.dev/badge/skills/builderced/agent-skills/api-resilience-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/builderced/agent-skills/api-resilience-patterns"><img src="https://agentmods.dev/badge/skills/builderced/agent-skills/api-resilience-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.00959 |
| Opus 5.5 | $0.00013 | $0.00384 |
| Sonnet 5.5 | $0.00007 | $0.00192 |
| Haiku 4.5 | $0.00003 | $0.00096 |
Grade A, and why
api-resilience-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Resilience Patterns
When to Use
- Calling external APIs that might fail or slow down
- Designing microservice communication
- Building agents that call multiple tools/APIs
- Handling rate limits from LLM providers
- Preventing cascade failures
Pattern 1: Circuit Breaker
Prevents repeated calls to a failing service.
States: Closed (normal) → Open (failing) → Half-Open (testing)
| State | Behavior | Transition |
|---|---|---|
| Closed | Forward requests normally | → Open after N consecutive failures |
| Open | Reject immediately (fail fast) | → Half-Open after cooldown period |
| Half-Open | Allow 1 test request | → Closed if success, → Open if fail |
Config: threshold=3 failures, cooldown=30s, half-open-max=1.
Pattern 2: Retry with Exponential Backoff
Attempt 1: immediate
Attempt 2: wait 1s + random(0-500ms)
Attempt 3: wait 2s + random(0-500ms)
Attempt 4: wait 4s + random(0-500ms)
Max: 5 attempts, 16s max wait
Rules:
- Only retry on transient errors (429, 500, 502, 503, timeout)
- Never retry on client errors (400, 401, 403, 404)
- Always add jitter to prevent thundering herd
- Set a total timeout budget (not just per-attempt)
Pattern 3: Rate Limiting (Client-Side)
Respect provider limits proactively:
| Strategy | When | How |
|---|---|---|
| Token bucket | Steady rate with bursts | Refill N tokens/sec, consume per request |
| Sliding window | Strict per-minute limits | Track timestamps of last N requests |
| Queue-based | Ordered processing | FIFO queue with configurable concurrency |
Pattern 4: Bulkhead Isolation
Isolate failures to prevent cascade:
- Separate connection pools per service
- Separate thread/worker pools per dependency
- If service A fails, services B and C are unaffected
Pattern 5: Timeout Management
| Tier | Timeout | Purpose |
|---|---|---|
| Connection | 5s | Detect unreachable host |
| Request | 30s | Detect slow response |
| Total operation | 60s | Budget for retries included |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 116 lines · 33 tokens per session scan A 86c462ebe4e5
api-resilience-patterns is a skill published in the GitHub repository BuilderCed/agent-skills (2 stars, last pushed 7mo ago), licensed MIT. It adds 33 tokens to every session and 959 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
api-resilience-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| api-resilience-patternsBuilderCed/agent-skills | Skill | 2 | 7mo ago | MIT | A | 33 | Claude Code, Codex |
| error-handlingericrisco/rsc-harness | Skill | 707 | 2d ago | MIT | A | 78 | Claude Code, Codex |
| architecture-paradigm-event-drivenathola/claude-night-market | Skill | 358 | yesterday | MIT | A | 29 | Claude Code |
| newafrotools/afrotools | Skill | 32 | yesterday | Apache-2.0 | A | 89 | Claude Code |
| communicationsafrotools/afrotools | Skill | 32 | yesterday | Apache-2.0 | A | 116 | Claude Code |
| backend-resilience-patternsj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 67 | Claude Code, Codex |
| architecture-microservices-patternsj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 150 | Claude Code, Codex |