Skip to content
Back to skills

Flaky Test

ASecurity

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.

  • 15 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 14, 2026
ai-agents

Security analysis

A100/100

Scanned November 14, 2026

npx -y skills add moah0911/aftermath --skill flaky-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Flaky Test?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Flaky Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/moah0911-flaky-test/badge)](https://www.skillsdirectory.com/skills/moah0911-flaky-test)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: flaky-test
description: >
  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.
license: MIT
---

# 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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.