Condition Based Waiting
Use when tests fail intermittently. Replace arbitrary timeouts with condition polling. Eliminates flaky tests caused by timing assumptions.
Install
/plugin marketplace add Freddy-CHEN-ux/00_claude_skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add Freddy-CHEN-ux/00_claude_skills --skill condition-based-waitinggit clone --depth 1 https://github.com/Freddy-CHEN-ux/00_claude_skills.git /tmp/00_claude_skills
mkdir -p ~/.claude/skills
cp -r /tmp/00_claude_skills/skills/condition-based-waiting ~/.claude/skills/condition-based-waitingPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Condition-Based Waiting
## Core Principle
**Wait for the actual condition you care about, not a guess about how long it takes.**
## Overview
Flaky tests often result from arbitrary timeouts (`sleep(1000)`, `setTimeout(500)`) that assume operations complete within fixed time windows. Condition-based waiting polls for the specific condition you need, making tests reliable regardless of system speed.
## When to Use This Skill
- Tests fail intermittently (pass locally, fail in CI)
- Tests use `sleep()`, `setTimeout()`, or arbitrary delays
- Tests check for events, state changes, or async operations
- Debugging reveals race conditions
- Test reliability < 100%
## The Problem with Timeouts
**Bad Pattern:**
```javascript
// ❌ Arbitrary timeout - brittle and slow
await click('#submit-button');
await sleep(2000); // Hope 2 seconds is enough
expect(successMessage).toBeVisible();
```
**Why it fails:**
- Too short: Test fails on slow systems
- Too long: Wastes time on fast systems
- No verification: Assumes operation completes
- Intermittent: Works 95% of time, fails randomly
## The Solution: Condition Polling
**Good Pattern:**
```javascript
// ✅ Wait for specific condition
await click('#submit-button');
await waitFor(() => successMessage.isVisible(), { timeout: 5000 });
expect(successMessage).toBeVisible();
```
**Why it works:**
- Fast systems: Completes immediately
- Slow systems: Waits as long as needed (up to timeout)
- Verification: Actually checks the conditionDetails
- Skill name
condition-based-waiting- Repository
- Freddy-CHEN-ux/00_claude_skills
- Path
skills/condition-based-waiting/SKILL.md- Repo updated
- 10 January 2026
FAQ
What does the Condition Based Waiting skill do?
Use when tests fail intermittently. Replace arbitrary timeouts with condition polling. Eliminates flaky tests caused by timing assumptions.
How do I install the Condition Based Waiting skill?
Claude Code plugin: /plugin marketplace add Freddy-CHEN-ux/00_claude_skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Condition Based Waiting popular?
It lives in Freddy-CHEN-ux/00_claude_skills, which has 8 GitHub stars and 3 forks.
Related skills
Add Integration
8Freddy-CHEN-ux/00_claude_skills
Build a new API integration for Nexus. Load when user mentions "add integration", "new integration", "integrate with", "connect to [service]", or "build [service] integration". Interactive workflow that discovers API endpoints, plans the integration, and creates a project for implementation.
AI Agents
8Freddy-CHEN-ux/00_claude_skills
Production-grade AI agent patterns with MCP integration, agentic RAG, handoff orchestration, multi-layer guardrails, and observability (modern best practices)
AI LLM
8Freddy-CHEN-ux/00_claude_skills
Production LLM engineering skill. Covers strategy selection (prompting vs RAG vs fine-tuning), dataset design, PEFT/LoRA, evaluation workflows, deployment handoff to inference serving, and lifecycle operations with cost/safety controls.
Gameplay Browser
8Freddy-CHEN-ux/00_claude_skills
Test game via browser with Chrome DevTools. Navigate UI, play through game flow, observe behavior and report issues.
Art of Unit Testing
5vnovakovits/claude-skills
Apply Roy Osherove's "The Art of Unit Testing" (Manning — 2nd ed. 2013 in C#/.NET, 3rd ed. 2024 in JavaScript) — the practitioner's guide to writing trustworthy, maintainable, readable unit tests. Centers on Osherove's broad unit-of-work definition (entry point → observable exit point), his three-part test-naming convention (UnitOfWork_StateUnderTest_ExpectedBehavior), the stub-vs-mock distinction by whether you assert against the double, the one-mock-per-test rule, designing for testability via seams (dependency injection, Extract-and-Override), and getting legacy code under test. Use when wr
Grill Me
5bolasblack/claude-skills
Stress-test a plan, design, decision, or idea through a focused interview. Use when the user asks to be grilled, challenge their thinking, or resolve design choices before proceeding.
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.