Back to Skills

fix

Fix failing or flaky Playwright tests. Use when user says "fix test", "flaky test", "test failing", "debug test", "test broken", "test passes sometimes", or "intermittent failure".

23,820stars3,344forksUpdated 8/5/2026

Security Assessment

Safe(95/100)
Security Score95/100

About fix

This skill diagnoses and fixes failing or flaky Playwright tests using a systematic taxonomy. It addresses the frustrating problem of tests that fail intermittently or pass locally but fail in CI, giving a repeatable process to find the root cause instead of guessing.

The workflow reproduces the failure (including burn-in runs with `--repeat-each` and parallel-worker runs to expose flakiness), captures a full trace with `--trace=on`, and then categorizes the failure into one of four buckets using an included decision-tree taxonomy: timing/async, test isolation, environment, or infrastructure. For each category it prescribes targeted fixes, such as replacing `waitForTimeout` with web-first assertions and adding missing awaits, removing shared mutable state and resetting per-test data, matching viewport and timezone between local and CI, and tuning retries, workers, and timeouts for CI runners. It verifies the fix by running the test ten times and requiring all to pass, and finishes with prevention recommendations (CI retries, trace on first retry, documenting the pattern). The bundled taxonomy file includes concrete before/after TypeScript examples.

It targets developers and QA engineers who maintain Playwright suites and need a disciplined debugging method for flaky tests. It runs local `npx playwright test` commands to reproduce, trace, and verify, which are safe developer-driven test executions, and edits test code to apply fixes.

FAQ

What problem does this skill solve?

Diagnosing and fixing Playwright tests that fail outright or pass intermittently, using a systematic root-cause taxonomy rather than trial and error.

What are the failure categories?

Timing/async, test isolation, environment (CI vs local), and infrastructure, each with characteristic symptoms and targeted fixes.

How does it reproduce flakiness?

By running the test normally, then with burn-in (`--repeat-each`), parallel workers, and full tracing (`--trace=on`) to surface intermittent failures.

How is a fix confirmed?

By running the fixed test ten times with `--repeat-each=10`; all ten must pass, otherwise the process returns to re-categorize the failure.

What commands does it run?

Standard local Playwright commands such as `npx playwright test` with reporting, repeat, worker, and trace flags; these are safe, developer-initiated test runs.

All Files

2 files
SKILL.md3.0 KB
View
flaky-taxonomy.md3.1 KB
View

Install fix

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill