flaky-test-diagnoser

flaky-test-diagnoser is a skill for Claude Code, Codex from codebygarv/Ai-skills. It costs 43 tokens per session (590 once invoked), scanned A, original, MIT.

A testing guide that finds why a test is unreliable, such as timing races, shared data, run order, or outside services.

In plain words
What is it for?
Use it to investigate intermittent test failures and make tests dependable across different machines, speeds, and run orders.
Why use it?
It helps fix the cause of tests that pass locally but fail sometimes in CI, instead of hiding failures with retries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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.

agentmods
npx agentmods add skills/codebygarv/ai-skills/flaky-test-diagnoser
Any agent
npx skills add codebygarv/Ai-skills --skill flaky-test-diagnoser
Clone the repo
git clone --depth 1 https://github.com/codebygarv/Ai-skills

Made for: Claude Code, Codex.

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-diagnoser

README.md
[![agentmods](https://agentmods.dev/badge/skills/codebygarv/ai-skills/flaky-test-diagnoser.svg)](https://agentmods.dev/skills/codebygarv/ai-skills/flaky-test-diagnoser)
Your own site
<a href="https://agentmods.dev/skills/codebygarv/ai-skills/flaky-test-diagnoser"><img src="https://agentmods.dev/badge/skills/codebygarv/ai-skills/flaky-test-diagnoser.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 590 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00043 $0.00590
Opus 5 $0.00022 $0.00295
Sonnet 5 $0.00009 $0.00118
Haiku 4.5 $0.00004 $0.00059

Measured 2d ago against content hash daca6958b7e3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

flaky-test-diagnoser 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 2d 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.

skills/testing/flaky-test-diagnoser/SKILL.md · 37 lines

How it starts

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

Purpose

Find the actual cause of an intermittently-failing test and fix it properly, rather than reaching for a retry wrapper that hides the flake while leaving the underlying nondeterminism in place.

When to Use

  • A test passes locally but fails in CI, or fails maybe one run in ten.
  • Tests fail when run in a different order, in parallel, or on a slower machine.
  • A team has started ignoring or auto-retrying certain tests.

What to Analyze

  1. Timing and async assumptions — fixed sleep/timeout waits instead of waiting for the actual condition; assertions that race an unawaited promise; anything that passes on a fast machine and fails on a loaded CI runner.
  2. Shared mutable state — module-level variables, singletons, or a database not reset between tests, so a test's outcome depends on what ran before it.
  3. Test-order dependence — a test that only passes when run after another that happens to set up its state. Surfaces when a runner randomizes order or shards across workers.
  4. External dependencies — real network calls, live third-party APIs, or system clock/timezone dependence. Anything the test doesn't control can fail independently of the code.
  5. Nondeterministic data — random values, Date.now(), unstable ordering from a Set/Map/database query without an explicit ORDER BY, or locale-dependent formatting.
  6. Resource contention — parallel tests competing for the same port, file, temp directory, or database row.

Output Format

  • Most likely cause — named specifically, with the evidence from the test/code that points to it.
  • Why it manifests intermittently — the specific condition (slow machine, particular ordering, parallel execution) that makes it fail rather than pass.
  • Fix — as concrete code, addressing the root nondeterminism.
  • How to confirm — how to reproduce the flake deliberately (run in a loop, force a specific order, add artificial delay) so the fix is verifiable rather than assumed.

Read the full file on GitHub · 37 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 37 lines · 43 tokens per session scan A daca6958b7e3

Subscribe to this mod's changes

flaky-test-diagnoser is a skill published in the GitHub repository codebygarv/Ai-skills (25 stars, last pushed 17d ago), licensed MIT. It adds 43 tokens to every session and 590 once invoked, about $0.0002 per session on Opus 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-03.

Related

Other skills, from other repositories

bun-cli

Bun CLI reference for package management, script running, testing, bundling, and compilation. Covers bun install/add/remove/update, bun run, bun test, bun build, bunx, bun patch, bun audit fix, bun dedupe, bun prune, bun why, bun pm, bun repl, bunfig.toml, bun.lock, workspace catalogs, isolated installs and the global…

dmythro/agent-skills · 179 tokens

git-ci

CI/CD status queries for GitHub Actions (gh) and GitLab CI (glab). Check pipeline status, failing jobs, workflow runs, job logs, and merge readiness. Use when checking CI status, debugging build failures, viewing job logs, watching pipeline progress, or configuring gh/glab CI read-only allowlists. Not for PR workflows…

dmythro/agent-skills · 88 tokens

ds-debug

Bug hunter — reproduce the failure as an observed red, localize it (bisect, logs, tracing), test at most three hypotheses, land the minimal fix behind a red-proven regression test, and prove it with the project's own check. Use when something is broken and the cause is not yet known.

sungurerdim/dev-skills · 65 tokens

agent-debug-fixer

中文调试修复技能。用于报错、测试失败、页面异常、功能不符合预期、需要定位根因并做最小修复时。触发语包括"进入调试模式""帮我修问题""报错了""测试失败""页面坏了""找根因"。.

hashgraph-online/awesome-codex-plugins · 71 tokens

om-troubleshooter

Diagnose and fix standalone Open Mercato bugs across scope, commands, locking, fields, generated registries, UI hydration, cache/search, bootstraps, queues, and providers. Use for "fix bug", "why does this fail", "regression", "debug", "napraw błąd", or a failing test.

open-mercato/open-mercato · 73 tokens

moai-workflow-loop

Ralph Engine - Automated feedback loop with LSP diagnostics and AST-grep integration for continuous code quality improvement. Use when implementing error-driven development, automated fixing, or continuous quality validation workflows.

modu-ai/moai-adk · 44 tokens