flaky-test-investigation

flaky-test-investigation is a skill for Claude Code from yeaight7/agent-powerups. It costs 30 tokens per session (615 once invoked), scanned A, original, Apache-2.0.

A test-investigation guide for flaky tests, which are tests that pass and fail unpredictably without code changes.

In plain words
What is it for?
Use it to investigate tests that fail intermittently in continuous integration (CI), pass alone but fail in the full suite, or appear fixed after a rerun.
Why use it?
It replaces guesswork and repeated reruns with checks for timing, asynchronous work, shared state, and test-order problems. It also uses repeated runs to confirm whether a change removes the flake.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the debugging-diagnostics plugin — 8 skills, 4 commands, 2 agents shipped together

Good fit Use it to investigate tests that fail intermittently in continuous integration (CI), pass alone but fail in the full suite, or appear fixed after a rerun.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yeaight7/agent-powerups/flaky-test-investigation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add yeaight7/agent-powerups --skill flaky-test-investigation
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install debugging-diagnostics, the plugin that ships this one along with the rest of its 8 skills, 4 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for flaky-test-investigation

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/flaky-test-investigation/github.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/flaky-test-investigation)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/flaky-test-investigation"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/flaky-test-investigation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for flaky-test-investigation

Your own site · 80×15
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/flaky-test-investigation"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/flaky-test-investigation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 615 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.00615
Opus 5.5 $0.00012 $0.00246
Sonnet 5.5 $0.00006 $0.00123
Haiku 4.5 $0.00003 $0.00061

Measured 1mo ago against content hash 66adc4d3a5e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

flaky-test-investigation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/debugging-diagnostics/skills/flaky-test-investigation/SKILL.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Purpose

Flaky tests erode trust in CI. Do not just re-run them and hope for the best — isolate the flake vector, fix it, and prove the fix with a stress loop.

When to Use

  • A test fails intermittently in CI but passes locally (or vice versa)
  • A test passes alone but fails in the full suite
  • A re-run "fixed" a failure and nobody knows why

Inputs

  • The flaky test's name/path and the runner command for it
  • Recent failing runs, if available, to estimate the failure rate

Workflow

  1. Isolate the test. Run the specific failing test by itself. If it passes alone, the flake is likely an order dependency or state leakage from a previous test — run the suite up to and including it to confirm.

  2. Stress test. Run the test in a tight loop to establish the failure rate before changing anything:

    for i in {1..100}; do npm test -- -t "My Test" || echo "FAIL on run $i"; done
    

    (Adapt the inner command to the project's runner; some runners have repeat flags built in.)

  3. Check the common vectors:

    • Time — does the test rely on Date.now() or setTimeout? Mock the clock.
    • Async/Promises — asserting before a background task finishes? Ensure proper await or waitFor usage.
    • Shared state — reusing database records, global singletons, or mutated variables between runs? Ensure clean teardowns in afterEach.
    • Randomness — random IDs or sort orders? Force deterministic seeds or sort orders.
  4. Prove the fix. Do not just guess. The fix must be verified by running the stress test loop again and achieving a 100% pass rate.

Output

  • The identified flake vector (order/state, time, async, randomness)
  • The fix, plus stress-loop evidence (pre-fix failure rate vs post-fix 100% pass)

Verification

  • Test run in isolation to separate order-dependency from intrinsic flake
  • Stress loop run before the fix to establish a baseline failure rate
  • Flake vector named explicitly
  • Stress loop re-run after the fix with a 100% pass rate

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 58 lines · 30 tokens per session scan A 66adc4d3a5e1

Subscribe to this mod's changes

flaky-test-investigation is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 19d ago), licensed Apache-2.0. It adds 30 tokens to every session and 615 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.

Related

Other skills, from other repositories

test-driven-development

TDD: enforce RED-GREEN-REFACTOR, tests before code.

HezaoHezao/poirot · 20 tokens

kodama-verification

Define measurable success criteria and collect targeted test, build, lint, type-check, or smoke-test evidence before claiming work is complete.

amergrgic/kodama · 31 tokens

playwright-cli

Translate natural-language browser automation requests into exact playwright-cli commands for interactive web testing and debugging. Use when requests involve opening/navigating pages, interacting with elements, capturing snapshots/screenshots/PDFs, using tabs, inspecting console/network, mocking routes, managing…

IvanCampos/agents · 74 tokens

writing-tests

Kiro Crew repo only: how to write a backend pytest test with NO side effects that does not flake. Use when adding, editing, reviewing or debugging a test there: which conftest applies, what leaks (temp dirs, data home, /.kiro, cron, threads), the seven flake classes, cross-platform traps.

kirodotdev/KiroCrew · 72 tokens

ai-discover

Read-only discovery step of the auto-improvement loop. One bounded agent turn per cycle reads the focus files (Read/Grep/Glob only, no shell, no subagents) and replies with a JSON array of testable surfaces {file, line, symbol, rule, message, hypothesis}; the spine authors fixes and verifies them. Discovery only — no…

kirodotdev/KiroCrew · 83 tokens

relay-80-100-workflow

Use when writing agent-relay workflows that must fully validate features end-to-end before merging. Covers the 80-to-100 pattern - going beyond "code compiles" to "feature works, tested E2E locally." Includes repair-before-failure validation gates, review-depth fresh-eyes review/fix loops with test hardening, PGlite…

AgentWorkforce/relay · 115 tokens