circuit-breaker

Enforce circuit breaker state transitions around fragile external API calls.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/jrmatherly/metorial-workspace --skill circuit-breaker-jrmatherly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: circuit-breaker
Source: https://github.com/jrmatherly/metorial-workspace/tree/main/.github/skills/circuit-breaker
Command: npx skills add https://github.com/jrmatherly/metorial-workspace --skill circuit-breaker-jrmatherly

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents cascading failures by enforcing a circuit breaker around fragile external calls, enabling fast failure and controlled fallback when a dependency is unhealthy.

Core Features & Use Cases

  • Circuit state management with CLOSED, OPEN, and HALF_OPEN transitions.
  • Configurable thresholds, timeouts, and optional fallbacks for graceful degradation.
  • Simple integration in TypeScript/JavaScript and Python projects to protect API clients and microservices.

Quick Start

Configure a CircuitBreaker with your desired thresholds and wrap external API calls using the execute method. For example, create a breaker and call breaker.execute(() => fetch('https://api.service/endpoint')) to automatically fail fast when the service is down.

Frequently Asked Questions about circuit-breaker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent cascading failures when making external API calls in microservices?

You prevent cascading failures by wrapping fragile external API calls with a circuit breaker pattern. This enables fast failure and controlled fallback when a dependency is unhealthy, stopping errors from propagating downstream.

What is a half-open transition in a circuit breaker pattern?

In a circuit breaker, a half-open transition is a state that tests if an unhealthy dependency has recovered. It allows limited trial requests before fully closing the circuit and resuming normal traffic.

How do I configure a circuit breaker with fallbacks for API clients in Python?

You configure a circuit breaker in Python by setting failure thresholds and timeout windows, then wrapping API calls via the execute method. Optional fallbacks can be attached to ensure graceful degradation.

Does this circuit breaker implementation work with both JavaScript and Python projects?

Yes, the circuit breaker implementation supports both TypeScript/JavaScript and Python projects. It offers simple integration to protect API clients and microservices across both environments.

When should I use a circuit breaker instead of simple retries for fault tolerance?

Use a circuit breaker for fault tolerance when a service dependency is down and you need fast failure. Unlike simple retries, it trips open after configurable failure thresholds to prevent cascading failures.