Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Forge Flaky Tests?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-forge-flaky-tests)
---
name: forge-flaky-tests
description: "Find and fix flaky tests: reproduce, classify the cause (time, order, async, shared state, network) and prevent"
---
<!-- Generated from catalog/skills/flaky-tests/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->
# Flaky tests
Use when a test passes and fails without code changes.
## Reproduce
1. Run the single test in a loop (for example 50 times) and with the full suite, in random order where the runner supports it.
2. Record failure rate, error message and environment (CI vs local, parallelism).
## Classify the cause
- Time: real clocks, timezones, timeouts that are too tight. Fix with fake timers or an injected clock.
- Order and shared state: globals, database rows, files or env vars left by other tests. Isolate fixtures and reset state.
- Async: missing awaits, fixed sleeps, assertions before the UI or event settles. Wait for conditions, not durations.
- Randomness: unseeded random data. Seed it and log the seed.
- External services and network: mock at the boundary, or use contract tests.
- Resources: ports, temp directories and parallel workers colliding. Allocate unique ones.
## Fix
Fix the cause, not the symptom. Retries and longer timeouts hide real bugs. Quarantine only with an owner and a deadline.
## Verify
The loop that reproduced the failure now passes every time (for example 200 runs), plus the full suite in random order.