agentleFS
moah0911moah0911/aftermath/skills/flaky-test/SKILL.md

flaky-test

Skill14 starsChanged 6 days agoMITView on GitHub

Use when the same test alternates between pass and fail without code edits, or when a failure cannot be reproduced. Rerun to confirm, find the source of nondeterminism, and never revert working code on an unconfirmed flake.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Stop. Do not revert or edit yet.

    line 16
  2. Distinctive:

    Check the usual sources of nondeterminism, in this order:

    line 19
  3. Distinctive:

    Never claim a flake without at least one rerun.

    line 36
  4. Distinctive:

    Never weaken or skip an assertion to make a flake disappear.

    line 37
  5. Distinctive:

    Never mix a flake fix with unrelated changes.

    line 38
  6. Distinctive:

    Never use a flaky result as justification for a broad refactor.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Flaky Test

A test that changes its mind is evidence about the test or its environment, not about your last edit.

Confirm before you act

  1. Stop. Do not revert or edit yet.
  2. Re-run the exact same test command. Capture each outcome.
  3. Pass/fail flips with no edit in between → flaky suspected. State the sequence explicitly, for example pass → fail → pass.
  4. Check the usual sources of nondeterminism, in this order:
    • time and timezone (Date.now, TZ, frozen clocks)
    • ordering and shared state (test isolation, parallel workers)
    • randomness and seeds (Math.random, faker, randomized fixtures)
    • network, ports, and external services
    • filesystem state left by an earlier run
  5. Label the suspected source as theory until a repeat/seed/isolate experiment proves it.
  6. Fix the nondeterminism, not the assertion. Do not delete the test to get green.

Plugin behavior

  • The outcome tracker flags pass → fail → pass (or the reverse) with no editing between runs.
  • A flaky signal suppresses checkpoint auto-revert and does not freeze forward edits; rerunning is the next action.
  • The signal is one-shot. If the next run passes cleanly, stand down.

Never

  • Never claim a flake without at least one rerun.
  • Never weaken or skip an assertion to make a flake disappear.
  • Never mix a flake fix with unrelated changes.
  • Never use a flaky result as justification for a broad refactor.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.