circuit-breakerslisted
Install: claude install-skill robsonkades/agent-skills
# Circuit Breakers
## Purpose
A circuit breaker is a state machine in the caller that stops calling a dependency which is
already failing, so calls fail immediately instead of waiting for a timeout. It avoids tying
up additional caller threads and connections in calls predicted to fail —
the amplification point `cascading-failures` names as pool exhaustion.
**A breaker fails fast on rejected calls; it does not supply a successful result for them.**
That protects the caller's resources even when the only honest result is a typed error. A
fallback or degraded response can preserve useful availability, but is not a prerequisite for
resource protection. Decide both the fast-failure contract and any fallback first.
## States
```text
CLOSED → OPEN failure rate or slow-call rate ≥ threshold, over ≥ minimum calls
OPEN → HALF_OPEN after the wait duration; calls before it are rejected untried
HALF_OPEN → CLOSED the configured probe sample meets success/slow-call thresholds
HALF_OPEN → OPEN the completed probe sample breaches a threshold (per implementation policy)
```
## Workflow
The Java illustration requires Java 21+ without preview; configuration guidance is checked
against Resilience4j 2.3.0 and its CircuitBreaker guide. Inspect compiler release/toolchain,
runtime image, resolved breaker/client dependencies and Spring/programmatic integration before
using property names or decorators. Do not upgrade the project to adopt this example. Without
per-inst