Install any skill in seconds. Free to start, no credit card required.
Get Started Free →microck/condition-based-waiting
Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses
Passed 23 of 23 test cases with the skill, and 16 of 23 without it.
and 4 more in the full report
7 fixed16 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
To test partial output from a tool that ticks every 100ms, a developer writes: ```typescript await waitForEvent(manager, 'TOOL_STARTED'); await new Promise(r => setTimeout(r, 200)); ``` What two core requirements make this usage of a fixed timeout legitimate rather than anti-pattern flakiness?
| Checked | Without skill | With skill |
|---|---|---|
| Require waiting for the triggering prerequisite event first. | Passed | Passed |
| Require the explicit delay to be based on known interval timing with a justifying comment. | Missed | Passed |
The instructions your model reads when the skill loads.
Flaky tests often guess at timing with arbitrary delays. This creates race conditions where tests pass on fast machines but fail under load or in CI.
Core principle: Wait for the actual condition you care about, not a guess about how long it takes.
digraph when_to_use {
"Test uses setTimeout/sleep?" [shape=diamond];
"Testing timing behavior?" [shape=diamond];
"Document WHY timeout needed" [shape=box];
"Use condition-based waiting" [shape=box];
"Test uses setTimeout/sleep?" -> "Testing timing behavior?" [label="yes"];
"Testing timing behavior?" -> "Document WHY timeout needed" [label="yes"];
"Testing timing behavior?" -> "Use condition-based waiting" [label="no"];
}
Use when:
setTimeout, sleep, time.sleep())Don't use when:
// ❌ BEFORE: Guessing at timing
await new Promise(r => setTimeout(r, 50));
const result = getResult();
expect(result).toBeDefined();
test cases passed, vs 16 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.