detect-flaky-tests
Identifies flaky tests by correlating and analyzing failure data across multiple CI pipeline runs.
Install
mkdir -p .claude/skills/detect-flaky-tests && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7888" && unzip -o skill.zip -d .claude/skills/detect-flaky-tests && rm skill.zipInstalls to .claude/skills/detect-flaky-tests
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Identify flaky tests by comparing failures across multiple CI runs. Use when the user suspects flaky tests, sees intermittent failures, or wants to analyze test reliability.Key capabilities
- →Get workflow runs
- →Download failed job logs
- →Extract failed test names
- →Correlate failures across runs
How it works
Parses CI logs to identify tests that fail intermittently across multiple runs.
Inputs & outputs
When to use detect-flaky-tests
- →Identifying intermittently failing tests in CI
- →Analyzing test reliability reports
- →Troubleshooting test suite stability
About this skill
Detect Flaky Tests
Identify flaky tests by comparing failures across multiple CI runs.
Prerequisites
ghCLI installed and authenticated (gh auth login)
Instructions
Step 1: Get Recent Workflow Runs
Get last N runs from the specified branch (default: dev):
gh run list --workflow=Rust --branch=dev --limit=10 --json databaseId,conclusion,headSha,createdAt
Step 2: Download Failed Job Logs
For each run, get failed test jobs only (nextest, nextest_all_features, coverage):
gh run view <run-id> --json jobs --jq '.jobs[] | select((.name == "nextest" or .name == "nextest_all_features" or .name == "coverage") and .conclusion == "failure") | {id: .databaseId, name: .name}'
Download logs to ci-logs/flaky-analysis/run-<run-id>/:
gh run view --job <job-id> --log | perl -pe 's/\e\[[0-9;]*m//g' > ci-logs/flaky-analysis/run-<run-id>/<job_name>.log
Step 3: Extract Failed Tests
Parse each log for failed test names. Look for patterns:
FAILEDfollowed by test pathtest result: FAILED- Specific test framework output patterns
Step 4: Correlate Failures
Build a matrix: test name vs run ID (pass/fail).
Identify:
- Flaky tests: Fail in some runs, pass in others
- Consistently failing: Fail in all/most runs (real bugs)
- New failures: Only fail in recent runs
Step 5: Report
Provide summary:
- List of flaky tests with failure rate (e.g., "failed 3/10 runs")
- List of consistently failing tests
- Recommendations:
- Flaky tests to investigate or quarantine
- Real failures to fix
Notes
- Run this on dev to detect flakiness independent of PRs
- Consider running on PR branches to check if PR introduced flakiness
When not to use it
- →When tests are not flaky
- →When CI logs are unavailable
Prerequisites
Limitations
- →Requires access to CI logs
- →Depends on consistent log formats
How it compares
Automates the identification of flaky tests instead of manual log inspection.
Compared to similar skills
detect-flaky-tests side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| detect-flaky-tests (this skill) | 0 | 6mo | Review | Intermediate |
| analyze-failures | 1 | 6mo | Caution | Intermediate |
| moai-workflow-testing | 1 | 2mo | Review | Intermediate |
| triage-ci-flake | 1 | 2mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Sovereign-Labs
View all by Sovereign-Labs →You might also like
analyze-failures
saleor
Analyze Playwright E2E test failure reports from CI. Parses merged blob reports, groups similar errors, and delegates to specialized subagents for investigation and fixes. Use when CI tests fail or when asked to fix E2E test failures.
moai-workflow-testing
modu-ai
Comprehensive development workflow specialist combining DDD testing, debugging, performance optimization, code review, PR review, and quality assurance into unified development workflows
triage-ci-flake
payloadcms
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
debug-ci
Sovereign-Labs
Debug failed CI tests by fetching workflow logs from GitHub Actions and analyzing failures. Use when the user mentions CI failures, test failures, or wants to understand why their PR's CI is failing.
cts-triage
gfx-rs
Run CTS test suites and investigate failures
ci-loop
hyodotdev
Run the full CI pipeline locally and iterate until all tests pass.