Circuit Breaker Pattern
Reusable circuit breaker pattern that stops cascading failures with states, fallbacks, and monitoring.
- CCM score
- 40 of 100
- skills.sh installs
- 482
- GitHub stars
- 396
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the closed, open, and half-open states, with failure counting, reset timeouts, and recovery thresholds
- Includes a minimal TypeScript example plus reference guides for TypeScript, Node.js (opossum-style), Python, and Java (Resilience4j-style)
- Adds a monitored variant that logs state transitions and alerts on frequent trips
- Designed for external API calls, microservice communication, database connections, and third-party integrations
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill circuit-breaker-pattern -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Circuit Breaker Pattern
Table of Contents
Overview
Implement circuit breaker patterns to prevent cascading failures and provide graceful degradation when dependencies fail.
When to Use
- External API calls
- Microservices communication
- Database connections
- Third-party service integrations
- Preventing cascading failures
- Implementing fallback mechanisms
- Rate limiting protection
- Timeout handling
Quick Start
Minimal working example:
enum CircuitState {
CLOSED = "CLOSED",
OPEN = "OPEN",
HALF_OPEN = "HALF_OPEN",
}
interface CircuitBreakerConfig {
failureThreshold: number;
successThreshold: number;
timeout: number;
resetTimeout: number;
}
interface CircuitBreakerStats {
failures: number;
successes: number;
consecutiveFailures: number;
consecutiveSuccesses: number;
lastFailureTime?: number;
}
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Category
- Backend & APIs
- First seen
- Jun 3, 2026
Questions
What does the circuit-breaker-pattern skill do?
The circuit-breaker-pattern skill implements circuit breakers for fault tolerance, automatic failure detection and fallback mechanisms. It stops cascading failures when external services, microservices or database connections go down, and it provides graceful degradation with fallbacks.
How do I install the circuit-breaker-pattern skill?
Run npx -y skills add aj-geddes/useful-ai-prompts --skill circuit-breaker-pattern -y in your project. After that, the circuit-breaker-pattern skill lets your agent add circuit breakers around calls to external APIs and third-party integrations.
Which languages do the circuit-breaker-pattern reference guides cover?
The circuit-breaker-pattern skill ships reference guides for TypeScript, Node.js using an Opossum-style breaker, Python, and Java using a Resilience4j-style breaker. It also includes a guide that adds monitoring to the circuit breaker.
Where does the circuit-breaker-pattern skill fit in the Backend & APIs category?
The circuit-breaker-pattern skill is listed in the Backend & APIs category on Claude Marketplaces, next to entra-app-registration, neon, firebase-basics, firebase-auth-basics and workers-best-practices. Its distinct focus is resilience: detecting failing dependencies and falling back before they take the whole system down.
More from aj-geddes/useful-ai-prompts
All 258- Aws Cloudfront Cdn481
- Mutation Testing481
- Csrf Protection480
- Developer Onboarding480
- Api Changelog Versioning479
- Concurrency Patterns479
- Deployment Automation479
- Django Application479
- Regression Modeling479
- Gcp Cloud Functions477
- Cloud Security Configuration476
- Aws Ec2 Setup475
- Api Versioning Strategy474
- Email Service Integration473
- Infrastructure Monitoring473
- Angular Module Design472
- Pull Request Automation472
- Database Monitoring471
- Session Management470
- Idempotency Handling469
- Network Analysis468
- Query Caching Strategies468
- Risk Assessment468
- Error Tracking467
Similar to Circuit Breaker Pattern
More Backend & APIsapi-error-handlingaj-geddes/useful-ai-prompts515 installsStandardized API error handling covering response formats, logging, retries, circuit breakers, and validation.
graceful-shutdownaj-geddes/useful-ai-prompts442 installsShutdown handling for SIGTERM that drains connections, finishes in-flight requests, and releases resources cleanly.
python-resiliencewshobson/agents12.8K installsRetry, backoff, and timeout patterns for Python that retry only transient failures and bound total duration.
fortifysharpdeveye/maestro364 installsResilience guidance that adds retry backoff, fallbacks, circuit breakers, and timeouts to failing agent workflows.
error-handlingcloudai-x/claude-workflow-v2139 installsError handling and observability guide covering custom error hierarchies, structured logging, retries, circuit breakers, and graceful degradation.