circuit-breaker

Implement the circuit breaker pattern with configurable failure and success thresholds.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill circuit-breaker-dadbodgeoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: circuit-breaker
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/circuit-breaker
Command: npx skills add https://github.com/dadbodgeoff/drift --skill circuit-breaker-dadbodgeoff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents cascading failures in distributed systems by implementing the circuit breaker pattern, ensuring that failing services do not bring down the entire application.

Core Features & Use Cases

  • State Management: Manages three states: CLOSED (normal), OPEN (failing fast), and HALF_OPEN (testing recovery).
  • Configurable Thresholds: Allows setting failure and success thresholds, as well as timeouts for state transitions.
  • Fallback Mechanism: Supports optional fallback functions to provide graceful degradation when the circuit is open.
  • Use Case: Protects an e-commerce site from a temporary outage of its payment gateway by failing fast and offering a "try again later" message instead of a full site crash.

Quick Start

Use the circuit-breaker skill to wrap an external API call that is prone to intermittent failures.

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 in microservices when an external API goes down?

To prevent cascading failures in microservices, implement the circuit breaker pattern to stop calls to failing services. This ensures a temporary external API outage degrades gracefully instead of crashing the entire distributed system.

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

The circuit breaker pattern manages three states to protect distributed systems: CLOSED for normal operation, OPEN to fail fast during failures, and HALF_OPEN to test service recovery before resuming traffic, preventing system-wide crashes.

How do I configure failure thresholds for fault tolerance in distributed systems?

Configuring fault tolerance involves setting specific failure and success thresholds alongside timeout values for state transitions. These configurable thresholds determine when the circuit opens to stop requests and when it tests for service recovery.

Can I provide a fallback response for API clients when a service circuit is open?

Yes, you can provide a fallback response for API clients when the circuit is open. This graceful degradation mechanism supports optional fallback functions, returning messages like "try again later" instead of a full site crash.

What's the best way to handle intermittent external service call failures without crashing?

The best way to handle intermittent external service call failures is wrapping them with a circuit breaker. It fails fast when thresholds are met, preventing resource exhaustion and protecting the application from temporary outages.

Does implementing a circuit breaker require any external dependencies or frameworks?

No, implementing this circuit breaker requires no external dependencies. It operates as a standalone skill with scripts and references, applying deterministic execution and state management directly to your API clients.