Home/Catalog/Quality
Quality — does it work?
Brief 101

Flaky-Test Audit

The tests that fail intermittently — the ones eroding trust in the suite until a red build stops meaning anything.

FLAKY.md4 phases7 lenses~2.6k chars

Free & open · no signup · read-only — it ends by asking · nothing leaves your machine

What it does

You are working inside this repo. Mission: find the tests that pass and fail without the code changing — and the nondeterminism behind each — because a suite people re-run until it's green is a suite they no longer trust.

Read-only pass. Read the tests, their setup, and any run history; change nothing but the report file.

What it looks for

7 lenses it looks through

Phase 2 sweeps the codebase through every one of these, citing file and line for each finding.

1

Timing & waits

sleeps, fixed timeouts, and races between test and code under test

2

Order dependence

passes alone, fails in a suite because of shared state

3

Clock & date

reliance on real time, timezones, or "now" without freezing it

4

Network & external

real HTTP, third-party services, unmocked I/O in unit tests

5

Randomness

unseeded random data; hash or set ordering assumed stable

6

Resource leakage

unclosed connections, ports, or temp files bleeding across tests

7

Environment sensitivity

passes locally, fails in CI on parallelism, locale, or filesystem

The deliverable

What lands in your repo

One structured report at the repo root — or in reports/, if you keep one — the same shape every time, ready for a teammate — or the optional Studio — to act on.

FLAKY.md
1
Suspected flakes
each: test · nondeterminism source · how to reproduce · confidence
2
Fixes
the deterministic replacement for each source
3
Quarantine list
the flakes to isolate now versus fix now, and why
4
Prevention
the patterns (fixed clock, seeded random, sanctioned mocks) to adopt
One file. Evidence-backed. It ends by asking before touching anything.
How it works

What it makes the agent do

Every Goal Prompt follows the same four steps, so results are consistent and repeatable — no matter which one you run.

1
Phase 1

Hunt the nondeterminism

Look for the usual sources.

2
Phase 2

Audit through 7 lenses

Name the nondeterminism source for every finding.

3
Phase 3

Curate

Rank by how often each blocks a build and how central the test is.

4
Phase 4

Report

Create FLAKY.md at repo root.

Get started

Three ways to run this Goal Prompt

01 · COPY

Paste it in

Copy it and paste it into your agent inside the repo you want checked.

02 · INSTALL

As a slash command

Install the goal plugin once — two commands — then just type /goal:flaky-test.

1/plugin marketplace add GhostlyGawd/goal-prompts
2/plugin install goal@goal-prompts

Or install only this Goal Prompt as /goal-flaky-test:

curl -fsSL https://goal-prompts.vercel.app/install | BRIEF=101 sh
03 · AGENT

From an agent (MCP)

Let an agent fetch it mid-conversation, or pull the raw Goal Prompt by URL.

https://goal-prompts.vercel.app/raw/101.md
Transparency

The exact prompt

Nothing hidden — this is the whole Goal Prompt, verbatim. Read it in a minute, edit it, or copy it as-is.

Read the full brief (2,610 characters)
# Goal: Flaky-Test Audit

You are working inside this repo. Mission: find the tests that pass and fail without the code changing — and the nondeterminism behind each — because a suite people re-run until it's green is a suite they no longer trust.

Read-only pass. Read the tests, their setup, and any run history; change nothing but the report file.

## Phase 1 — Hunt the nondeterminism
- Look for the usual sources: time, order, network, randomness, shared resources.
- Check run history or retry config for tests already known to be re-run.
- Note tests that pass alone but might fail in a parallel or shuffled suite.

## Phase 2 — Audit through 7 lenses
Name the nondeterminism source for every finding.
1. **Timing & waits** — sleeps, fixed timeouts, and races between test and code under test
2. **Order dependence** — passes alone, fails in a suite because of shared state
3. **Clock & date** — reliance on real time, timezones, or "now" without freezing it
4. **Network & external** — real HTTP, third-party services, unmocked I/O in unit tests
5. **Randomness** — unseeded random data; hash or set ordering assumed stable
6. **Resource leakage** — unclosed connections, ports, or temp files bleeding across tests
7. **Environment sensitivity** — passes locally, fails in CI on parallelism, locale, or filesystem

## Phase 3 — Curate
- Rank by how often each blocks a build and how central the test is.
- For each, give the fix — freeze the clock, seed the data, mock the boundary, isolate the resource.
- Decide fix-now versus quarantine: keep a flaky critical test's intent, but stop it blocking others.

## Phase 4 — Report
Create `FLAKY.md` at repo root:
1. **Suspected flakes** — each: test · nondeterminism source · how to reproduce · confidence
2. **Fixes** — the deterministic replacement for each source
3. **Quarantine list** — the flakes to isolate now versus fix now, and why
4. **Prevention** — the patterns (fixed clock, seeded random, sanctioned mocks) to adopt

Start the report with today's date. If `FLAKY.md` already exists from a previous run, read it first and lead with what changed since.

## Rules
- Name the source of nondeterminism; "sometimes fails" is not a diagnosis
- Quarantine to unblock, but quarantine is a debt, not a fix
- No test suite in this repo? Say so in a one-paragraph null report and stop — a null result is a valid finding.
- If a `reports/` directory exists at the repo root, write the report there instead of the root.
- Before asking, present the top findings as a ranked list in plain words
- Report only — end by asking which flaky tests to fix first

House rules for this Goal Prompt

  • Name the source of nondeterminism; "sometimes fails" is not a diagnosis
  • Quarantine to unblock, but quarantine is a debt, not a fix
  • No test suite in this repo? Say so in a one-paragraph null report and stop — a null result is a valid finding.
  • If a reports/ directory exists at the repo root, write the report there instead of the root.
  • Before asking, present the top findings as a ranked list in plain words
  • Report only — end by asking which flaky tests to fix first
Keep exploring

More Quality briefs

Runs inside these playbooks — curated sequences you can launch with one paste: