- Home
- Skills
- Agents & Orchestration
- Repair Circuit Breaker State Races
Works with the AI tools you already use
Repair Circuit Breaker State Races
Repair circuit-breaker state races across closed, open, and half-open transitions without changing resilience policy.
$8.99
Repair Circuit Breaker State Races
Example session with this skill installed
Our Java payment client has a custom circuit breaker with CLOSED, OPEN, and HALF_OPEN states. Only one half-open probe is allowed, but two callers can pass the check, and a slow success from the first generation sometimes closes the breaker after the second probe has already failed and reopened it. Repair locally with a fake clock, controlled futures, and barriers. Preserve thresholds, reset timeout, retries, fallback behavior, and per-process scope; do not call the payment service.
- Read your context and instructions
- Compiled the repair circuit breaker
State race found. Two callers observe an expired open interval and both enter half-open, while a success from the previous epoch can still close the newer breaker. The repair makes transition and probe admission generation-aware, rejects stale completions, preserves all thresholds and fallback behavior, and validates timer, failure, success, timeout, and reset orderings with a fake clock.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
The problem
Circuit breakers often suffer from race conditions where stale callbacks, non-atomic transitions, or duplicate probes corrupt the internal state. This leads to breakers staying open after recovery, closing due to outdated successes, or admitting multiple probes despite a single-probe contract.
What it does
- Enforces a strict generation-based contract to reject stale callbacks and timer updates.
- Makes half-open probe admission atomic within the existing repository concurrency model.
- Fixes state leaks where cancellation or timeouts leave the breaker in an inconsistent generation.
- Replaces flaky wall-clock sleeps in tests with deterministic clocks and barriers.
- Implements generation-aware metrics to track transition reasons and rejected callbacks.
Frameworks & tools
Works with custom or wrapped state machines in environments using Read, Edit, and Bash tools. Applicable to languages with async/concurrent primitives like Node.js, Go, or Java.
Why this beats prompting it yourself
General prompts often miss the nuances of epoch-based state management, leading to "fixes" that just narrow the race window. This skill applies a formal ownership register to every transition, ensuring that only the current breaker generation can mutate state.
Use cases
- Preventing a stale success from closing a breaker that has already moved to a new failure epoch.
- Stopping multiple probes from firing simultaneously during a half-open state.
- Ensuring manual resets do not race with in-flight probe completions or old timers.
- Converting non-deterministic circuit breaker tests into reliable, clock-controlled assertions.
Known limitations
Does not modify thresholds, retry budgets, or fallback policies. Will not introduce distributed coordination if no existing contract exists in the repository.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 1 month ago
- Passed all security checks, Safe to install