PluginBench
Skill
Pass
Audit score 90

fix

alirezarezvani/claude-skills

Diagnose and fix failing or flaky Playwright tests using a systematic taxonomy.

What is fix?

Fixes Playwright tests that fail intermittently or consistently by reproducing the failure, capturing traces, and categorizing the root cause into one of four patterns: timing/async issues, test isolation problems, environment mismatches, or infrastructure constraints. Use when a test is flaky, broken, or passes only sometimes.

  • Reproduces test failures through escalating strategies (single run, burn-in, parallel workers)
  • Captures full execution traces to analyze test behavior
  • Categorizes failures into timing/async, test isolation, environment, or infrastructure issues
  • Applies targeted fixes specific to each failure category
  • Verifies fixes by running tests 10 times to confirm stability
  • Recommends prevention strategies for CI/CD pipelines

How to install fix

npx skills add https://github.com/alirezarezvani/claude-skills --skill fix
Prerequisites
  • Playwright test framework installed and configured
  • Test file path and test name to diagnose
  • Node.js and npm available in the environment
Claude Code
Cursor
Windsurf
Cline

How to use fix

  1. 1.Provide the test file path, test name, and description of the failure
  2. 2.The skill will run the test to reproduce the failure
  3. 3.If the test passes, it will run burn-in tests (10+ repetitions) to catch flakiness
  4. 4.Traces will be captured and analyzed to identify the root cause
  5. 5.A targeted fix will be applied based on the failure category (timing, isolation, environment, or infrastructure)
  6. 6.The test will be run 10 times to verify the fix resolves the issue
  7. 7.Prevention recommendations will be provided for your CI configuration

Use cases

Good for
  • Fix a test that passes locally but fails in CI pipelines
  • Debug intermittent test failures that occur randomly during test runs
  • Resolve test isolation issues where tests pass individually but fail in suites
  • Diagnose timing-related flakiness caused by missing waits or async issues
  • Stabilize tests affected by environment differences between local and CI
Who it's for
  • QA engineers and test automation specialists
  • Full-stack developers maintaining Playwright test suites
  • CI/CD engineers troubleshooting flaky test pipelines
  • Teams adopting end-to-end testing practices

fix FAQ

What if the test passes on the first run?

The skill will run burn-in tests with `--repeat-each=10` to catch intermittent failures. If it still passes, it will try with parallel workers (`--fully-parallel --workers=4`) to expose timing or isolation issues.

How does the skill categorize failures?

It uses a four-category taxonomy: Timing/Async (intermittent everywhere), Test Isolation (fails in suite, passes alone), Environment (fails in CI, passes locally), and Infrastructure (random patterns with browser errors).

What counts as a successful fix?

The test must pass all 10 consecutive runs without failure. If any run fails, the skill returns to diagnosis to identify a different root cause.

Can this fix tests other than Playwright?

No, this skill is specifically designed for Playwright tests. Other test frameworks would require different diagnostic approaches.

What prevention strategies are recommended?

Add retries in CI config, enable trace on first retry, match viewport sizes and environments between local and CI, and document test conventions to prevent similar issues.

Full instructions (SKILL.md)

Source of truth, from alirezarezvani/claude-skills.


name: "fix" description: >- 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".

Fix Failing or Flaky Tests

Diagnose and fix a Playwright test that fails or passes intermittently using a systematic taxonomy.

Input

$ARGUMENTS contains:

  • A test file path: e2e/login.spec.ts
  • A test name: ""should redirect after login"`
  • A description: "the checkout test fails in CI but passes locally"

Steps

1. Reproduce the Failure

Run the test to capture the error:

npx playwright test <file> --reporter=list

If the test passes, it's likely flaky. Run burn-in:

npx playwright test <file> --repeat-each=10 --reporter=list

If it still passes, try with parallel workers:

npx playwright test --fully-parallel --workers=4 --repeat-each=5

2. Capture Trace

Run with full tracing:

npx playwright test <file> --trace=on --retries=0

Read the trace output. Use /debug to analyze trace files if available.

3. Categorize the Failure

Load flaky-taxonomy.md from this skill directory.

Every failing test falls into one of four categories:

CategorySymptomDiagnosis
Timing/AsyncFails intermittently everywhere--repeat-each=20 reproduces locally
Test IsolationFails in suite, passes alone--workers=1 --grep "test name" passes
EnvironmentFails in CI, passes locallyCompare CI vs local screenshots/traces
InfrastructureRandom, no patternError references browser internals

4. Apply Targeted Fix

Timing/Async:

  • Replace waitForTimeout() with web-first assertions
  • Add await to missing Playwright calls
  • Wait for specific network responses before asserting
  • Use toBeVisible() before interacting with elements

Test Isolation:

  • Remove shared mutable state between tests
  • Create test data per-test via API or fixtures
  • Use unique identifiers (timestamps, random strings) for test data
  • Check for database state leaks

Environment:

  • Match viewport sizes between local and CI
  • Account for font rendering differences in screenshots
  • Use docker locally to match CI environment
  • Check for timezone-dependent assertions

Infrastructure:

  • Increase timeout for slow CI runners
  • Add retries in CI config (retries: 2)
  • Check for browser OOM (reduce parallel workers)
  • Ensure browser dependencies are installed

5. Verify the Fix

Run the test 10 times to confirm stability:

npx playwright test <file> --repeat-each=10 --reporter=list

All 10 must pass. If any fail, go back to step 3.

6. Prevent Recurrence

Suggest:

  • Add to CI with retries: 2 if not already
  • Enable trace: 'on-first-retry' in config
  • Add the fix pattern to project's test conventions doc

Output

  • Root cause category and specific issue
  • The fix applied (with diff)
  • Verification result (10/10 passes)
  • Prevention recommendation

Related skills

More from alirezarezvani/claude-skills and the wider catalog.

GCgcp-cloud-architect logo

gcp-cloud-architect

alirezarezvani/claude-skills

Design GCP architectures for startups and enterprises. Use when asked to design Google Cloud infrastructure, deploy to GKE or Cloud Run, configure BigQuery pipelines, optimize GCP costs, or migrate to GCP. Covers Cloud Run, GKE, Cloud Functions, Cloud SQL, BigQuery, and cost optimization.

604 installs
GDgdpr-dsgvo-expert logo

gdpr-dsgvo-expert

alirezarezvani/claude-skills

GDPR and German DSGVO compliance automation. Scans codebases for privacy risks, generates DPIA documentation, tracks data subject rights requests with Art. 12(3) one-month deadlines. Use when running GDPR compliance assessments, privacy audits, data protection planning, DPIA generation, or data subject rights (DSAR) management (e.g., 'check this service for GDPR risks', 'track an access request deadline'). Final compliance determinations route to the DPO or legal counsel.

818 installs
GEgenerate logo

generate

alirezarezvani/claude-skills

Generate production-ready Playwright tests from user stories, URLs, or component names.

1.6k installs
GRgrill-me logo

grill-me

alirezarezvani/claude-skills

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

942 installs
HAhard-call logo

hard-call

alirezarezvani/claude-skills

Framework for irreversible decisions with no good options—use 10/10/10, reversibility test, and regret minimization.

1.4k installsAudited
INinformation-security-manager-iso27001 logo

information-security-manager-iso27001

alirezarezvani/claude-skills

ISO 27001 ISMS implementation and cybersecurity governance for HealthTech and MedTech companies. Use when designing an ISMS, running security risk assessments, implementing controls, pursuing ISO 27001 certification, preparing security audits, responding to security incidents, or verifying compliance. Covers ISO 27001, ISO 27002, healthcare security, and medical device cybersecurity.

781 installs