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.
Secure checkout via Stripe
See it in action
You say
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.
Your agent does
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.
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
Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.
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 today
- 30-day refund guarantee
- One-time purchase, yours forever
- Secure checkout via Stripe
Frequently Asked Questions
Popular in AI Agents & LLM Ops
agentic-workflow
A risk-aware, evidence-based engineering lifecycle protocol for robust agentic task execution and safety.
designing-hybrid-context-layers
Architects the right retrieval strategy for every query — teaching your agent when to use RAG, a knowledge graph, or a temporal index instead of defaulting to vector search for everything.

prompt-engineer
Professional prompt engineering patterns for building robust, secure, and production-ready LLM applications.
codex-grade-coding
Turn your AI agent into a senior engineer with strict task classification and verification-driven coding protocols.