flaky-test-triage

flaky-test-triage is a skill for Claude Code, Codex from lfyxhappy/lfcode. It costs 63 tokens per session (403 once invoked), scanned A, original, MIT.

A process for investigating tests that pass and fail unpredictably. It compares conditions such as execution order, timing, machine, runtime, random seed, and shared state to find the underlying cause.

In plain words
What is it for?
Use it to diagnose and repair flaky tests, isolate the conditions that trigger them, and add a regression check when appropriate. It also helps confirm the fix in both focused and normal suite runs.
Why use it?
An intermittent test failure is often caused by leaked state, incomplete cleanup, concurrency, timing, or environment differences. Re-running without investigation can hide the defect rather than fix it.

Skill for Claude CodeCodex

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

Good fit Use it to diagnose and repair flaky tests, isolate the conditions that trigger them, and add a regression check when appropriate. It also helps confirm the fix in both focused and normal suite runs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lfyxhappy/lfcode/flaky-test-triage
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 lfyxhappy/lfcode --skill flaky-test-triage
Clone the repo
git clone --depth 1 https://github.com/lfyxhappy/lfcode

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lfyxhappy/lfcode/flaky-test-triage.svg)](https://agentmods.dev/skills/lfyxhappy/lfcode/flaky-test-triage)
Your own site
<a href="https://agentmods.dev/skills/lfyxhappy/lfcode/flaky-test-triage"><img src="https://agentmods.dev/badge/skills/lfyxhappy/lfcode/flaky-test-triage.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 403 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.00063 $0.00403
Opus 5 $0.00032 $0.00201
Sonnet 5 $0.00013 $0.00081
Haiku 4.5 $0.00006 $0.00040

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

Security

Grade A, and why

flaky-test-triage 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.

packages/lfcode/src/skill/lfcode/.bundle/flaky-test-triage/SKILL.md · 29 lines

What it actually says

Flaky Test Triage

Turn an intermittent failure into a bounded causal explanation and a durable repair.

Workflow

  1. Read repository instructions, the failing test, test history or logs, fixture lifecycle, relevant concurrency settings, and recent changes.
  2. Record the exact failure signature, frequency, seed, order, platform, runtime version, resource use, and retry behavior. Separate distinct symptoms before treating them as one flake.
  3. Repeat the narrowest test under controlled variations: isolation versus suite, changed order, fixed seed, constrained parallelism, clean versus warm state, and relevant platform or clock conditions.
  4. Inspect asynchronous completion, shared state, cleanup, network and filesystem boundaries, random generation, time zones, timers, process lifetime, and test runner configuration.
  5. Fix the causal synchronization, isolation, data ownership, or lifecycle defect. Add a regression test or deterministic harness only when it proves the repaired condition.
  6. Rerun the focused test enough to validate the hypothesis, then run the affected suite with its normal concurrency settings.

Boundaries

  • Keep triage read-only unless the user asks to modify tests, infrastructure, or product code.
  • Do not disable, skip, quarantine, retry indefinitely, lengthen arbitrary timeouts, or add sleeps as a substitute for a root-cause fix.
  • Do not call a test flaky without evidence that distinguishes nondeterminism from a deterministic product regression.
  • Redact credentials, customer data, and machine-specific sensitive information from logs and reports.

Completion Check

Report the intermittent symptom, reproduction matrix, root cause or bounded hypothesis, repair, repetition evidence, suite result, and residual uncertainty.

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 · 29 lines · 63 tokens per session scan A 2533c32228d0

Subscribe to this mod's changes

flaky-test-triage is a skill published in the GitHub repository lfyxhappy/lfcode (2 stars, last pushed 4d ago), licensed MIT. It adds 63 tokens to every session and 403 once invoked, about $0.0003 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-05.