Find flaky tests from a CI run log. Use whenever a task gives an input.json with a "runs" array of {commit, test, outcome} records (pass/fail) and asks for flaky-tests.csv, flaky test detection, or a flakiness report per commit. Works by hand, no scripts needed.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Flaky Tests?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-flaky-tests-1aad2f58)
---
name: flaky-tests
description: Find flaky tests from a CI run log. Use whenever a task gives an input.json with a "runs" array of {commit, test, outcome} records (pass/fail) and asks for flaky-tests.csv, flaky test detection, or a flakiness report per commit. Works by hand, no scripts needed.
---
# Flaky test report
Input: `input.json` in the working folder, `{"runs": [{"commit", "test", "outcome"}, ...]}`.
Output: `flaky-tests.csv` in the same folder as input.json.
## Definitions
- A test is **flaky on a commit** if, among that commit's runs of that test, there is at least one "pass" AND at least one "fail". A test that only fails (or only passes) on a commit is not flaky there; consistent failure is a real break, not flakiness.
- **flaky_commits** = number of distinct commits on which the test is flaky.
- **failures** = total count of "fail" runs of that test across ALL commits, including commits where it was not flaky. (Example: a test flaky on commit A with 1 fail, and failing consistently on commit B, has failures = 2.)
- A test appears in the output only if flaky_commits >= 1.
## Procedure (do it by hand, carefully)
1. Read input.json. Ignore run order; it does not matter.
2. Build a tally per (test, commit): number of passes and number of fails. Go through the runs one at a time and keep a written list so none are missed. Treat commit and test names as exact strings.
3. For each test: count commits where passes>=1 and fails>=1 (flaky_commits), and sum fails over all its commits (failures).
4. Drop tests with flaky_commits = 0.
5. Sort rows by failures descending; ties broken by test name ascending (plain alphabetical, case-sensitive). Do NOT sort by flaky_commits.
6. Write flaky-tests.csv.
## Output format
- First line exactly: `test,flaky_commits,failures`
- One line per flaky test: `name,flaky_commits,failures`, no quotes, no spaces, integers.
- Newline after each line, including the last.
- If no test is flaky, the file contains only the header line.
## Check against example
Runs: commit X: api pass, api fail, ui fail, ui pass, db fail; commit Y: db pass, ui fail, api pass.
- api: flaky on X only; fails = 1 → `api,1,1`
- ui: flaky on X; fails on X and Y = 2 → `ui,1,2`
- db: never mixed in a commit → excluded.
Sorted by failures desc: `ui,1,2` then `api,1,1`.