The agent-resilience-skill is a 7-phase SKILL.md behavioral protocol for building fault-tolerant agentic workflows. It teaches agents how to implement circuit breakers that stop cascading failures, configure exponential backoff retry logic with jitter to prevent retry storms, select the right fallback strategy when dependencies fail, track error budgets against SLOs, propagate deadlines across tool call chains, apply graceful degradation patterns, and validate resilience with chaos testing. Compatible with Claude, OpenAI Codex CLI, Cursor, AWS Kiro, AutoGen, CrewAI, and LangGraph.
| Phase | Topic | Key Output |
|---|---|---|
| 1 | Circuit Breaker Implementation | CLOSED/OPEN/HALF_OPEN state machine with failure threshold and recovery probe logic |
| 2 | Exponential Backoff Retry Logic | Retry decision tree, idempotency check, jitter formula, total budget cap |
| 3 | Fallback Strategy Selection | Hierarchy: Primary → Stale Cache → Degraded Response → Static Default → Fail Gracefully |
| 4 | Error Budget Tracking | SLO definition, rolling window error budget tracker, alert thresholds (warn/critical/exhausted) |
| 5 | Timeout and Deadline Management | Timeout hierarchy with deadline propagation across orchestrator and sub-tool calls |
| 6 | Graceful Degradation Patterns | Degradation level matrix (NORMAL/DEGRADED/CRITICAL/MAINTENANCE) with feature permission map |
| 7 | Chaos Testing for Tool Call Chains | Chaos test harness with failure injection scenarios and acceptance criteria checklist |
npx skills install// From agent-resilience-skill Phase 1
// Circuit breaker prevents retry storms on failing tool calls
type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
class CircuitBreaker {
private state: CircuitState = 'CLOSED';
private failureCount = 0;
async call<T>(fn: () => Promise<T>): Promise<T> {
if (this.state === 'OPEN') {
const elapsed = Date.now() - this.lastFailureTime;
if (elapsed < this.config.timeout) {
throw new Error(`Circuit OPEN — retry after ${this.config.timeout - elapsed}ms`);
}
this.state = 'HALF_OPEN'; // Probe to test recovery
}
try {
const result = await fn();
this.onSuccess();
return result;
} catch (error) {
this.onFailure(); // Opens circuit after threshold
throw error;
}
}
}
// One circuit per tool call boundary
const priceFeedBreaker = new CircuitBreaker('price-feed', {
failureThreshold: 3, // Open after 3 failures
successThreshold: 1, // Close after 1 successful probe
timeout: 15_000, // Probe after 15 seconds
});
npx skills install agent-resilience-skillGET https://clawmerchants.com/v1/preview/agent-resilience-skill — inspect protocol structure before payingGET https://clawmerchants.com/v1/data/agent-resilience-skill → HTTP 402 with USDC payment detailsX-PAYMENT: <base64 proof> → HTTP 200 with full 7-phase resilience protocol# Step 1: Probe — discover payment requirements
curl -i https://clawmerchants.com/v1/data/agent-resilience-skill
# HTTP/1.1 402 Payment Required
# X-Payment-Required: {"amount":"50000","currency":"USDC","chain":8453,...}
# Step 2: Pay + resend with proof
curl -H "X-PAYMENT: <base64-payment-proof>" https://clawmerchants.com/v1/data/agent-resilience-skill
# HTTP/1.1 200 OK — returns full agent-resilience-skill SKILL.md protocol
$0.05 USDC per access — no subscription, no API key, no account required. Purchase once, apply the protocol to every agent you build. The circuit breaker pattern alone prevents retry storms that can burn $5–50 in API costs in a single runaway agent session — a 100-1000× return on the protocol cost.
npx skills install agent-resilience-skillGET https://clawmerchants.com/v1/data/agent-resilience-skillClawMerchants — agent resilience skill | circuit breaker for AI agents | fault tolerance agent workflow SKILL.md | agent retry protocol | resilient agent design | x402 + USDC + Base L2