flaky-detect

Analyze CI history and test execution patterns to identify flaky tests.

175|26|Updated Aug 14, 2025
One-click install
npx skills add https://github.com/jmagly/ai-writing-guide --skill flaky-detect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flaky-detect
Source: https://github.com/jmagly/ai-writing-guide/tree/main/.factory/skills/flaky-detect
Command: npx skills add https://github.com/jmagly/ai-writing-guide --skill flaky-detect

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires flaky-fix, and includes references (resource) components.

What problem does it solve?

This Skill eliminates unreliable CI builds by automatically identifying flaky tests through CI history analysis and code pattern scanning.

Core Features & Use Cases

  • Flaky Test Detection: Analyzes CI history and test execution patterns to identify non-deterministic tests.

Quick Start

When you say "find flaky tests", this Skill analyzes your CI history for inconsistent test results and scans code for flaky patterns like timing issues and async dependencies.

Example Output

"Flaky Test Report

Analysis Period: Last 30 days Total Tests: 450 Flaky Tests Found: 12 (2.7%)

Critical Flaky Tests (< 50% pass rate):

  1. test/api/login.test.ts:45 Pass Rate: 42% (21/50 runs) Category: Timing Pattern: Uses Date.now() for token expiry

Root Cause: Test creates token and checks expiry in same millisecond sometimes, different millisecond other times.

Recommended Fix: Use mocked time with vi.setSystemTime()"

Frequently Asked Questions about flaky-detect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify flaky tests in my CI pipeline?

Flaky test detection analyzes your CI history and test execution patterns to automatically identify non-deterministic tests. The Skill scans for common failure patterns—timing issues, async dependencies, and state leaks—then produces a report ranking tests by pass rate and severity to guide remediation.

What causes tests to fail intermittently in CI?

Intermittent test failures stem from timing issues, uncontrolled async operations, shared test state, and external dependencies. Flaky test detection identifies these root causes by examining multi-run execution history and code patterns, pinpointing which tests exhibit non-deterministic behavior across pipeline runs.

Can I detect flaky tests without manually reviewing CI logs?

Yes. Flaky test detection automates the entire process by analyzing CI history over configurable periods, applying code pattern scanning for common flake triggers, and generating actionable reports without manual log review. It identifies critical flaky tests and recommends specific fixes like mocking time or controlling async behavior.

How do I prioritize which flaky tests to fix first?

The detection report ranks flaky tests by pass rate and impact, flagging critical failures below 50% pass rate as highest priority. Tests are categorized by root cause type—timing, async, state—so you can batch similar fixes and restore CI reliability incrementally.

Does flaky test detection work with existing test frameworks?

Flaky test detection operates on CI execution history and code patterns independent of framework choice. It analyzes test results across runs to identify unreliable tests, then scans for framework-agnostic patterns like Date.now() calls and uncontrolled async operations to recommend fixes.