Flaky Test Analyzer

Flaky Test Analyzer is a skill for Claude Code from anhtester/ClaudeCode_Playwright_Demo. It costs 33 tokens per session (650 once invoked), scanned A, a copy of Flaky Test Analyzer, MIT.

A guide for finding why automated tests sometimes pass and sometimes fail, then making them reliable.

In plain words
What is it for?
Use it to inspect logs and screenshots, classify the cause, apply a fix, and rerun tests to check that they stay stable.
Why use it?
It helps separate real product failures from test problems caused by timing, unstable page selectors, test data, or the test environment.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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

Made for: Claude Code.

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/claudecode_playwright_demo/flaky_test_analyzer.svg)](https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/flaky_test_analyzer)
Your own site
<a href="https://agentmods.dev/skills/anhtester/claudecode_playwright_demo/flaky_test_analyzer"><img src="https://agentmods.dev/badge/skills/anhtester/claudecode_playwright_demo/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 100% copy Near-identical to another mod 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.00033 $0.00650
Opus 5 $0.00016 $0.00325
Sonnet 5 $0.00007 $0.00130
Haiku 4.5 $0.00003 $0.00065

Measured 5d ago against content hash 016d1fad79f7, 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 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 5d 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

This is a copy

100% identical to Flaky Test Analyzer — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/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. 5d 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/ClaudeCode_Playwright_Demo (2 stars, last pushed 3mo 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. It is 100% identical to Flaky Test Analyzer, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

playwright-best-practices

Use when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSockets, geolocation, permissions…

currents-dev/playwright-best-practices-skill · 214 tokens

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/antigravity-testing-kit · 55 tokens

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/antigravity-testing-kit · 40 tokens

UI Debug Agent

Skill inspect web/mobile applications bằng browser tools, phân tích DOM elements, xác định locators ổn định, debug UI automation failures, và hỗ trợ sinh Page Object classes.

anhtester/antigravity-testing-kit · 39 tokens

Test Data Generator

Skill sinh test data có cấu trúc, unique, traceable cho automation tests, bao gồm positive, negative, boundary và edge cases.

anhtester/antigravity-testing-kit · 32 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