condition-based-waiting

Replace setTimeout delays with polling for specific state changes in tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/vanmarkic/credit-castor --skill condition-based-waiting-vanmarkic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: condition-based-waiting
Source: https://github.com/vanmarkic/credit-castor/tree/main/.claude/skills/condition-based-waiting
Command: npx skills add https://github.com/vanmarkic/credit-castor --skill condition-based-waiting-vanmarkic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the pervasive problem of flaky tests caused by arbitrary timeouts and race conditions. It ensures tests are reliable and consistent by waiting for actual state changes rather than guessing at timing.

Core Features & Use Cases

  • Dynamic Polling: Replaces setTimeout/sleep with intelligent polling for specific events or state changes.
  • Reliable Async Testing: Provides patterns to wait for events, state, or specific counts in asynchronous operations.
  • Use Case: When your CI/CD pipeline is plagued by intermittent test failures due to timing issues, use this skill to refactor your tests, replacing fixed delays with condition-based waits, making them robust and reliable.

Quick Start

I have a flaky test that uses setTimeout(..., 50). Use the condition-based-waiting skill to refactor it to wait for a specific condition instead.