/analyze-flaky
Reads test results and identifies flaky tests — tests that pass sometimes and fail sometimes without any code changes.
Usage
bash
/analyze-flaky [<results-file>]All command combinations
Every --tool and --id option in one place → Command Combinations
Examples
bash
# Analyze the most recent run results
/analyze-flaky
# Analyze a specific results file
/analyze-flaky reports/results-TEST22.jsonWhat it does
- Reads test results (pass/fail/error per test)
- Classifies each failure:
- Timing — element not ready, race condition
- Selector drift — element moved between renders
- Data dependency — test depends on external state
- Environment — flaky only in CI, not locally
- Real bug — consistently failing, not flaky
- Reports flaky tests with confidence score and recommended fix
- Suggests hardening changes (better waits, data isolation, etc.)
Output
A flaky analysis report with:
- Which tests are flaky (and their flaky rate)
- Root cause classification
- Recommended fix per test
- Tests with 0% flaky rate that are solid (good to know too)
After analyzing
- For selector/timing issues → run
/heal-teststo auto-fix - For data dependency issues → review test isolation in your fixtures
- For environment issues → check CI vs local environment differences