Flaky Test Analyzer

Flaky Test Analyzer is a skill for Claude Code, Codex from anhtester/antigravity-testing-kit. It costs 33 tokens per session (650 once invoked), scanned A, original, MIT.

A guide for finding and fixing flaky automation tests, meaning tests that pass and fail inconsistently without a code change. It groups likely causes such as unstable selectors, timing, test data, or the environment.

In plain words
What is it for?
Use it to investigate intermittent test failures, race conditions, slow page loads, fragile element selectors, shared test data, and unavailable external services. It recommends more stable selectors and appropriate waits or test isolation.
Why use it?
Unreliable tests make it hard to tell whether a real change broke the software and can undermine a continuous-integration pipeline. The guide uses reproduction, inspection, classification, fixing, and repeated verification.

Skill for Claude CodeCodex

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/anhtester/antigravity-testing-kit/flaky_test_analyzer
Any agent
npx skills add anhtester/antigravity-testing-kit --skill flaky_test_analyzer
Clone the repo
git clone --depth 1 https://github.com/anhtester/antigravity-testing-kit

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 Analyzer

README.md
[![agentmods](https://agentmods.dev/badge/skills/anhtester/antigravity-testing-kit/flaky_test_analyzer.svg)](https://agentmods.dev/skills/anhtester/antigravity-testing-kit/flaky_test_analyzer)
Your own site
<a href="https://agentmods.dev/skills/anhtester/antigravity-testing-kit/flaky_test_analyzer"><img src="https://agentmods.dev/badge/skills/anhtester/antigravity-testing-kit/flaky_test_analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 650 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 $0.00033 $0.00650
Opus 5 $0.00016 $0.00325
Sonnet 5 $0.00007 $0.00130
Haiku 4.5 $0.00003 $0.00065

Measured 4d ago against content hash 016d1fad79f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Flaky Test Analyzer 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 4d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agent/skills/flaky_test_analyzer/SKILL.md · 109 lines

How it starts

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

Flaky Test Analyzer

Purpose: Identify and resolve unstable automation tests.


When to Use

Use this skill when:

  • A test passes and fails intermittently
  • Test results are inconsistent across runs
  • CI/CD pipeline has unreliable test results

Responsibilities

Detect flaky tests caused by:

  • Unstable locators (dynamic classes, positional xpath)
  • Timing issues (race conditions, slow page loads)
  • Incorrect waits (hard sleep instead of smart waits)
  • Environment dependency (data not cleaned up, external service down)
  • Test data conflicts (shared data between parallel tests)

Analysis Workflow

  1. Detect — Identify the failing test and reproduce the failure
  2. Inspect — Read error logs, stack traces, and screenshots
  3. Classify — Categorize the root cause (locator / timing / data / environment)
  4. Fix — Apply the appropriate fix strategy
  5. Verify — Re-run test multiple times to confirm stability

Common Flaky Causes & Fixes

Unstable Locator

Problem:

//div[3]/button
.css-1n2xyz-btn

Fix: Replace with stable locator following priority in .agent/rules/locator_strategy.md:

  • id, data-testid, name, css selector (stable), xpath (relative)

Timing Issues

Problem:

Thread.sleep(3000);       // Hard sleep — BAD
page.waitForTimeout(2000); // Fixed delay — BAD

Fix: Use smart waits as defined in .agent/rules/selenium_rules.md and .agent/rules/playwright_rules.md:

// Selenium
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("result")));

// Playwright
await expect(page.getByRole('button', { name: 'Submit' })).toBeVisible();

Test Data Conflicts

Problem: Tests share mutable data → parallel runs conflict.

Fix: Use unique, traceable random data:

<testName>_<timestamp>@test.com

Stability Checklist

After fixing a flaky test, verify:

Read the full file on GitHub · 109 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. 4d ago First seen · 109 lines · 33 tokens per session scan A 016d1fad79f7

Subscribe to this mod's changes

Flaky Test Analyzer is a skill published in the GitHub repository anhtester/antigravity-testing-kit (131 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 650 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-08-30.

Related

Other skills, from other repositories

keploy-docs

Guide for contributing to the Keploy documentation site at github.com/keploy/docs. Invoke when a change in keploy/keploy introduces, removes, or alters user-visible behavior (new CLI flag, changed default, new command, new configuration field, new on-disk format) and the docs need to catch up — or when the user asks…

keploy/keploy · 116 tokens

keploy-pr-workflow

Guide for creating PRs and issues on keploy repositories — PR format, customer-data hygiene, commit conventions, sign-off. Invoke when the user asks to open, update, or review a pull request or issue, when preparing a commit that will land in main, or whenever a change is about to leave the local machine.

keploy/keploy · 71 tokens

keploy-e2e-test

End-to-end verification of a change to keploy/keploy using keploy's own record/replay against a real sample application. Use whenever the user asks to test a change, verify a fix, prove that a modification works in practice, add e2e coverage for a PR, reproduce a bug against a sample app, or wire a behavior into CI.…

keploy/keploy · 118 tokens

skills-rbt-manual-testing

Skill sinh manual test cases với 2 modes — QUICK (sinh nhanh từ requirements) và FULL RBT (quy trình AI-RBT 6 bước có đánh giá rủi ro). Master skill cho mọi tác vụ manual test case.

anhtester/claude-testing-kit · 57 tokens

skills-requirements-analyzer

Kỹ năng phân tích trang web/module/tài liệu và sinh ra tài liệu Yêu cầu (Requirements Document/User Stories) chuẩn mực — có gán mã REQ ID truy vết được, phát hiện Ambiguity/Risk, kèm ma trận phân quyền và trạng thái.

anhtester/claude-testing-kit · 66 tokens

skills-framework-architect

Skill thiết kế và scaffold automation framework hoàn chỉnh cho Playwright, Selenium, và Appium — bao gồm project structure, base classes, config management, reporting, và CI/CD integration.

anhtester/claude-testing-kit · 42 tokens