Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Flaky test detector

    1

    Detect, analyze, and fix flaky tests and intermittent CI failures across Jest, Playwright, Pytest, and Cypress.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Flaky test detector

    Example session with this skill installed

    My Playwright test for the login flow fails about 20% of the time in CI with a timeout, but passes locally. Here is the code: await page.goto('/login'); await page.waitForTimeout(2000);

    • Read your context and instructions
    • Compiled the flaky test detector

    I have analyzed the login flow test. The intermittent failure is caused by a hardcoded sleep that doesn't account for varying CI network latency.

    Flaky Test Analysis

    Test / File: login-flow.spec.ts
    Framework: Playwright
    Likely Root Cause Category: Timing / race conditions
    Confidence: High

    Root Cause Explanation

    The test uses a fixed 2000ms timeout to wait for the page to load. In CI environments, resource contention or network latency often exceeds this window, causing the test to attempt interactions before the elements are ready.

    Evidence / Smells Found

    • Use of page.waitForTimeout(2000) which is a non-deterministic wait strategy.
    • Discrepancy between local execution speed and CI runner performance.

    Recommended Fix

    Replace the fixed sleep with a web-first assertion that utilizes Playwright's auto-waiting capabilities.

    Before:

    await page.goto('/login');
    await page.waitForTimeout(2000);
    await page.fill('#username', 'testuser');
    

    After:

    await page.goto('/login');
    // Auto-waits for the element to be visible and actionable
    await page.locator('#username').fill('testuser');
    // Or explicitly wait for a specific state if needed
    await expect(page.locator('#username')).toBeVisible();
    

    Additional Stabilization Tips

    • Use page.waitForURL() after navigation if the login redirects.
    • Check if your CI runners have sufficient CPU/Memory to handle browser contexts.
    • Increase the global action timeout in playwright.config.ts instead of adding local sleeps.

    Prevention Checklist

    • Replace all waitForTimeout calls with locator-based assertions.
    • Ensure await is used on all asynchronous Playwright actions.
    • Use test.slow() for naturally long-running integration paths.

    Next steps

    1. Apply the locator-based fix to the login spec.
    2. Run the test in a loop locally using --repeat-each 10 to verify stability.
    3. Check the Playwright trace file if the failure persists to see the exact state at timeout.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Intermittent test failures waste developer time and degrade CI/CD reliability. This skill identifies the root causes of non-deterministic behavior in your test suite, from race conditions to shared mutable state. It analyzes your code and error logs to determine why tests pass locally but fail in pipelines, providing immediate code fixes to stabilize your builds.

    What it does

    • Root cause identification categorizes flakes into timing issues, network dependencies, or order-dependent failures.
    • Code smell detection flags anti-patterns like fixed sleeps, unhandled promises, and resource leaks.
    • Automated refactoring provides side-by-side before and after code blocks with framework-specific fixes.
    • Confidence scoring ranks the likelihood of the identified cause to help you prioritize investigation.
    • Stabilization strategy generates checklists to prevent regression and ensure long-term suite health.

    How it works

    1. Provide a failing test file, a snippet of code, or the CI error logs.
    2. The skill analyzes the context against common flakiness patterns like async handling or non-deterministic data.
    3. It generates a structured report including a category-based explanation and a concrete code fix.

    Frameworks & tools

    Supports major testing frameworks including Jest, Vitest, Playwright, Cypress, and Pytest. It targets issues related to CI environments, browser contexts, and mock management.

    Why this beats prompting it yourself

    Generic prompts often miss subtle race conditions or framework-specific nuances like Jest's open handles or Playwright's auto-waiting logic. This skill follows a specialized hierarchy of flakiness checks, ensuring you get a production-ready fix rather than generic advice to "add more waits."

    Use cases

    • Stabilizing a Playwright suite that fails randomly in GitHub Actions.
    • Fixing Jest tests that only fail when run in a specific execution order.
    • Refactoring hardcoded sleeps into robust, assertion-based waiting logic.
    • Resolving memory leaks or open handles that stall test runners.

    Known limitations

    Requires either the source code or descriptive error logs to function. It cannot diagnose infrastructure-level failures like runner hardware exhaustion.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.

    Requires source code or logs to analyze. Scope is limited to test code logic, not CI runner hardware or network infrastructure issues.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    Permissions

    Browser

    File Scopes

    **/*.test.*
    **/*.spec.*
    **/__tests__/**

    This skill only needs to read test files to analyze them. It does not modify files, run commands, or require network access unless the user explicitly asks the agent to apply the suggested fixes.

    Listed28 days ago
    Updated17 days ago

    What's inside

    Frequently Asked Questions

    The skill identifies non-deterministic failures such as race conditions, resource leaks, and order-dependent state, providing specific code refactors to replace unstable patterns like fixed sleeps with robust assertions.

    Yes, it is fully compatible with Jest, Vitest, Playwright, Cypress, and Pytest, including specialized logic for framework-specific nuances like Jest’s open handles and Playwright’s auto-waiting.

    Simply provide the failing test file, a code snippet, or your CI error logs; the skill then analyzes the context against a specialized hierarchy of flakiness checks to generate a report.

    Unlike generic prompts, this skill uses a specialized diagnostic framework that understands subtle interactions between browser contexts, async handling, and specific test runner behaviors to ensure production-ready fixes.

    The skill focuses on application-level code and test logic; it cannot diagnose external infrastructure issues such as runner hardware exhaustion or network outages in your CI provider.

    You receive full access to the skill's diagnostic capabilities, including root cause categorization, confidence scoring, and automated refactoring blocks for all supported frameworks.

    New in Testing & Debugging