condition-based-waiting

Implement condition-based polling with bounded timeouts in Python and Bash.

415|44|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/notque/claude-code-toolkit --skill condition-based-waiting-notque
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: condition-based-waiting
Source: https://github.com/notque/claude-code-toolkit/tree/main/skills/condition-based-waiting
Command: npx skills add https://github.com/notque/claude-code-toolkit --skill condition-based-waiting-notque

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers need robust waiting and retry logic to coordinate flaky services, API rate limits, and startup sequences without resorting to arbitrary sleeps.

Core Features & Use Cases

  • Implements Simple Polling for waiting on a condition with a bounded timeout
  • Adds Exponential Backoff with jitter for transient failures
  • Supports Rate Limit Recovery, Health Check Waiting, and Circuit Breaker patterns
  • Provides both Python and Bash examples and ready-to-use reference implementations

Quick Start

Call wait_for with a condition function, a description, and a timeout to wait for readiness.

Frequently Asked Questions about condition-based-waiting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement polling with a bounded timeout for service startup?

Service startup polling uses a condition function checked repeatedly against a bounded timeout. You call wait_for with the condition, a description, and a timeout to safely wait for readiness without arbitrary sleeps.

What is exponential backoff with jitter and when should I use it for API polling?

Exponential backoff with jitter progressively increases wait times between retries while adding randomization. It is used for API polling and transient failures to prevent thundering herds and distribute retry load safely.

How do I add a circuit breaker pattern to Python retry logic?

A circuit breaker pattern in Python retry logic stops execution after repeated failures, preventing cascading load. This Skill provides reference implementations to integrate circuit breakers alongside bounded timeouts and logging.

Can I use these retry patterns and health check waiting logic in Bash scripts?

Yes, health check waiting and retry patterns are supported in Bash scripts. The Skill provides ready-to-use reference implementations for both Python and Bash environments to handle rate limit recovery and polling.

What is the best way to wait for an API rate limit to recover before retrying?

Rate limit recovery uses condition-based polling with exponential backoff and jitter. Instead of arbitrary sleeps, it waits predictably for the rate limit condition to clear, ensuring safe retry operations across Python and Bash.