Skip to content
Skillsify
Back to registry
Testingv1.1.0963 installs

flaky-test-hunter

Finds and diagnoses flaky tests in a test suite. Use when tests pass locally but fail in CI, when a suite fails intermittently, or when the user asks to stabilise or de-flake their tests.

SchemaLintTrigger

Install

npx skillsify add flaky-test-hunter

Flaky tests are usually fixed by hiding them — a sleep here, a retry there — which trades a red pipeline for a slow one that no longer tells the truth. This skill forbids that. It makes the agent measure the failure rate first, classify the flake against a taxonomy, force it to reproduce deterministically, and only then fix the underlying cause, finishing with a re-measured failure rate as proof.

Quality report

Should trigger

  • This test fails maybe one run in five, can you look?
  • CI is red again but it passes on my machine
  • Help me de-flake the e2e suite
  • Our pipeline keeps needing reruns to go green

Should not trigger

  • Write a new unit test for this function
  • Deploy the app to production

Files

SKILL.md
---
name: flaky-test-hunter
description: Finds and diagnoses flaky tests in a test suite. Use when tests pass locally but fail in CI, when a suite fails intermittently, or when the user asks to stabilise or de-flake their tests.
---

# Flaky test hunter

## When to use this
Tests pass locally but fail in CI, a suite fails intermittently, or the user
asks to stabilise their tests.

## Procedure
1. Establish the failure rate before changing anything. Run the suspect test in
   a loop and record how many runs in how many fail.
2. Classify the flake against [references/flake-taxonomy.md](references/flake-taxonomy.md).
3. Prove the cause by making the flake deterministic — force the ordering, freeze
   the clock, or pin the seed so the test fails every time.
4. Fix the cause, not the symptom.
5. Re-run the loop and show the new failure rate.

## Rules
- **Never** fix a flake by adding a sleep, a retry, or increasing a timeout.
  Those hide the defect and slow the suite permanently.
- A fix is not proven until the loop that used to fail passes repeatedly.
- If the flake is in the code under test rather than the test, say so plainly.
references/flake-taxonomy.md
# Flake taxonomy

| Class | Signature | Typical fix |
| --- | --- | --- |
| Order dependence | Fails only when run after another test | Reset shared state in a hook |
| Real time | Fails near midnight, month end, or on slow CI | Inject and freeze the clock |
| Async leak | Assertion runs before the effect settles | Await the actual condition, not a timeout |
| Shared fixture | Parallel workers mutate one record | Namespace fixtures per worker |
| Network | Depends on a live third party | Record and replay, or stub at the boundary |
| Randomness | Unseeded random input | Pin the seed and log it on failure |

Related skills

PerformanceVerified

core-web-vitals-audit

Audits a web application for Core Web Vitals regressions. Use when the user asks to check LCP, INP or CLS, investigate a Lighthouse score drop, or review front-end performance before a release.

1,284 installs · v1.2.0

SecurityVerified

dependency-risk-review

Reviews third-party dependencies for supply-chain and licence risk. Use when the user asks to audit dependencies, evaluate whether to add a package, review a lockfile diff, or check licence compatibility.

741 installs · v1.0.3

RefactoringVerified

rtl-layout-audit

Audits a web interface for right-to-left layout correctness in Arabic, Hebrew, Persian or Urdu. Use when adding an RTL locale, when the user reports mirrored or broken Arabic layout, or before shipping a bilingual interface.

688 installs · v1.1.1