circuit-breaker

Halts operations after a specified number of consecutive failures using configurable thresholds and cooldown periods.

1|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/jimmymalhan/codereview-pilot --skill circuit-breaker-jimmymalhan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: circuit-breaker
Source: https://github.com/jimmymalhan/codereview-pilot/tree/main/.claude/skills/circuit-breaker
Command: npx skills add https://github.com/jimmymalhan/codereview-pilot --skill circuit-breaker-jimmymalhan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents applications from repeatedly attempting operations that are known to be failing, thereby conserving resources and avoiding cascading failures.

Core Features & Use Cases

  • Failure Threshold: Automatically stops retrying an operation after a configurable number of consecutive failures.
  • State Management: Transitions between 'Closed' (normal operation), 'Open' (operation blocked), and 'Half-open' (probing after a cool-down period) states.
  • Use Case: If a critical API endpoint starts returning 500 errors, the circuit breaker will open after 3 failed attempts, preventing further requests to that endpoint and immediately returning an error or handing off to a fallback mechanism.

Quick Start

Apply the circuit-breaker skill to prevent more than 3 consecutive failures when calling the 'process_payment' API.

Frequently Asked Questions about circuit-breaker

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

FAQPage Schema
How do I stop retries on a broken API endpoint to prevent cascading errors?

To stop retries on a broken API endpoint, implement a circuit breaker pattern that transitions to an open state after a specified number of consecutive failures, immediately blocking further requests and conserving system resources. This prevents cascading errors across your application.

What is the circuit breaker pattern and how does its state management work?

The circuit breaker pattern is a fault tolerance mechanism that manages three states: Closed for normal operations, Open to block operations after consecutive failures, and Half-open to probe service availability after a cool-down period. This state management halts operations known to be failing.

How do I configure failure thresholds and cool-down periods for external API calls?

Configure failure thresholds and cool-down periods for external API calls by setting the maximum number of consecutive failures allowed before the circuit opens and defining the duration of the cool-down period before transitioning to a half-open probing state.

Does the circuit breaker pattern work for batch jobs prone to transient failures?

Yes, the circuit breaker pattern works for batch jobs prone to transient failures. It halts operations after a specified number of consecutive failures, preventing resource exhaustion and stopping cascading errors in batch processing just as effectively as with API calls.

When should I use a circuit breaker instead of standard retry logic?

Use a circuit breaker instead of standard retry logic when an external API or operation starts returning persistent errors like 500s. Standard retries risk resource exhaustion, while the circuit breaker opens after a configurable failure threshold to immediately return an error or trigger a fallback.