← ClaudeAtlas

circuit-breaker-patternlisted

Implement circuit breaker logic for agentic tool calls — tracking tool health, transitioning between closed/open/half-open states, reducing task scope when tools fail, routing to alternatives via capability maps, and enforcing failure budgets to prevent error accumulation. Separates orchestration (deciding what to attempt) from execution (calling tools), following the expeditor pattern. Use when building agents that depend on multiple tools with varying reliability, designing fault-tolerant agentic workflows, recovering gracefully from tool outages mid-task, or hardening existing agents against cascading tool failures.
pjt222/agent-almanac · ★ 20 · Web & Frontend · score 80
Install: claude install-skill pjt222/agent-almanac
# Circuit Breaker Pattern Graceful degradation when tools fail. An agent that calls five tools and one is broken should not fail entirely — it should recognize the broken tool, stop calling it, reduce scope to what remains achievable, and report honestly about what was skipped. This skill codifies that logic using the circuit breaker pattern from distributed systems, adapted to agentic tool orchestration. The core insight, from kirapixelads' "Kitchen Fire Problem": the expeditor (orchestration layer) must not cook. Separation of concerns between deciding *what* to attempt and *how* to attempt it prevents the orchestrator from getting trapped in a failing tool's retry loop. ## When to Use - Building agents that depend on multiple tools with varying reliability - Designing fault-tolerant agentic workflows where partial results are better than total failure - An agent is stuck in a retry loop on a broken tool instead of continuing with working tools - Recovering gracefully from tool outages mid-task - Hardening existing agents against cascading tool failures - Stale or cached tool output is being treated as fresh data ## Inputs - **Required**: List of tools the agent depends on (names and purposes) - **Required**: The task the agent is trying to accomplish - **Optional**: Known tool reliability issues or past failure patterns - **Optional**: Failure threshold (default: 3 consecutive failures before opening circuit) - **Optional**: Failure budget per cy