Skip to main content

Circuit Breaker Pattern

Skill Verified Active

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.

Purpose

Implement robust circuit breaker logic for agentic tool calls to ensure fault tolerance and graceful degradation in AI workflows.

Features

  • Track tool health (closed, open, half-open states)
  • Reduce task scope when tools fail
  • Route to alternative tools via capability maps
  • Enforce failure budgets to prevent error accumulation
  • Separate orchestration from tool execution

Use Cases

  • Building agents that depend on multiple tools with varying reliability
  • Designing fault-tolerant agentic workflows with partial results
  • Recovering gracefully from tool outages mid-task
  • Hardening agents against cascading tool failures

Non-Goals

  • Directly executing tool calls
  • Retrying failed tool calls immediately
  • Ignoring tool failures or stale data
  • Handling tool execution specifics beyond state tracking and routing

Workflow

  1. Build the Capability Map
  2. Initialize Circuit Breaker State
  3. Implement the Call-and-Track Loop
  4. Route to Alternatives on Open Circuit
  5. Reduce Scope to Achievable Work
  6. Handle Staleness and Label Data Quality
  7. Enforce the Failure Budget
  8. Separation of Concerns — Expeditor vs. Executor
  9. Detect Cascading Failures
  10. Pre-Call Tool Selection Layer

Practices

  • Resilience
  • Circuit-breaker
  • Error-handling
  • Graceful-degradation
  • Tool-reliability
  • Fault-tolerance

Installation

/plugin install agent-almanac@pjt222-agent-almanac

Quality Score

Verified
100 /100
Analyzed about 15 hours ago

Trust Signals

Last commit1 day ago
Stars14
LicenseMIT
Status
View Source

Similar Extensions

Error Handling Patterns

95

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

Skill
wshobson

Fail Early Pattern

99

Apply the fail-early (fail-fast) pattern to detect and report errors at the earliest possible point. Covers input validation with guard clauses, meaningful error messages, assertion functions, and anti-patterns that silently swallow failures. Primary examples in R with general/polyglot guidance. Use when writing functions that accept external input, adding input validation before CRAN submission, refactoring code that silently produces wrong results, reviewing PRs for error-handling quality, or hardening internal APIs against invalid arguments.

Skill
pjt222

Cleanup Defensive

99

Remove pointless try/catch blocks and defensive guards that hide errors or add no value. Preserves catches at true system boundaries (HTTP handlers, CLI entry, message consumers). Use when the user asks to remove try/catch, fix error hiding, clean up defensive code, or stop swallowing errors. Example queries — "remove pointless try/catch", "we're swallowing errors", "stop hiding bugs in catch blocks", "clean up the defensive code".

Skill
raintree-technology

Agent Introspection Debugging

99

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.

Skill
affaan-m

Workflow Orchestration Patterns

99

Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.

Skill
wshobson

Chaos Engineer

99

Designs chaos experiments, creates failure injection frameworks, and facilitates game day exercises for distributed systems — producing runbooks, experiment manifests, rollback procedures, and post-mortem templates. Use when designing chaos experiments, implementing failure injection frameworks, or conducting game day exercises. Invoke for chaos experiments, resilience testing, blast radius control, game days, antifragile systems, fault injection, Chaos Monkey, Litmus Chaos.

Skill
jeffallan

© 2025 SkillRepo · Find the right skill, skip the noise.