Install any skill in seconds. Free to start, no credit card required.
Get Started Free →notque/condition-based-waiting
Polling, retry, and backoff patterns.
Passed 14 of 18 test cases with the skill, and 10 of 18 without it.
and 8 more in the full report
6 fixed11 passed either way4 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
We have a Python worker thread that checks whether a background processing queue flag is set. A developer suggested adding a full CircuitBreaker with OPEN, HALF_OPEN, and CLOSED states. Show the appropriate implementation approach for checking this local queue state.
| Checked | Without skill | With skill |
|---|---|---|
| Implements simple condition polling with a timeout rather than a circuit breaker state machine. | Missed | Passed |
| Uses a polling interval between 10ms and 100ms for local state checks. | Missed | Passed |
The instructions your model reads when the skill loads.
Implement condition-based polling and retry patterns with bounded timeouts, jitter, and error classification. Select the right pattern for the scenario, implement it with safety bounds, and verify both success and failure paths.
| Pattern | Use When | Key Safety Bound |
|---|---|---|
| Simple Poll | Wait for condition to become true | Timeout + min poll interval |
| Exponential Backoff | Retry with increasing delays | Max retries + jitter + delay cap |
| Rate Limit Recovery | API returns 429 | Retry-After header + default fallback |
| Health Check | Wait for service(s) to be ready | All-pass requirement + per-check status |
| Circuit Breaker | Prevent cascade failures | Failure threshold + recovery timeout |
| Signal | Load These Files | Why |
|---|---|---|
| reviewing wait/retry code for polling, retry, and backoff mistakes | preferred-patterns.md | Loads detailed guidance from preferred-patterns.md. |
| writing wait code: polling, exponential backoff, rate-limit recovery, health checks, circuit breaker | implementation-patterns.md | Loads detailed guidance from implementation-patterns.md. |
| tests, implementation patterns | testing-patterns.md | Loads detailed guidance from testing-patterns.md. |
Before implementing any pattern, read the repository CLAUDE.md and search the codebase for existing wait/retry patterns to maintain consistency with what already exists.
Walk this decision tree to pick the right pattern. Only implement the pattern directly needed -- do not add circuit breakers when simple retries suffice, and do not add health checks when a single poll works.
1. Waiting for a condition to become true?
YES -> Simple Polling (Step 2)
NO -> Continue
2. Retrying a failing operation?
YES -> Rate-limited (429)?
YES -> Rate Limit Recovery (Step 5)
NO -> Exponential Backoff (Step 4)
NO -> Continue
3. Waiting for a service to start?
test cases passed, vs 10 / 18 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.