一键导入
flaky-test-detector
Identifies flaky tests in the affected test suite before shipping, because flaky tests kill Deployment Frequency by making CI untrustworthy.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Identifies flaky tests in the affected test suite before shipping, because flaky tests kill Deployment Frequency by making CI untrustworthy.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Detects files that always change together, exposing hidden coupling that inflates Lead Time for Change and makes every PR bigger than it needs to be.
Generates a deployment-specific checklist before any code ships, covering rollout, monitoring, communication, and rollback. Directly reduces Change Failure Rate and Mean Time to Restore.
Requires a feature flag for any user-facing change, giving teams an instant kill switch without a deployment.
Blocks shipping code where test coverage for changed files drops below threshold, and flags untested paths that directly raise Change Failure Rate.
Detects breaking changes to public APIs, interfaces, and exported symbols, and blocks shipping without a migration path.
Audits any new dependency before it enters the codebase, covering license, maintenance health, CVEs, and bundle impact.
| name | flaky-test-detector |
| description | Identifies flaky tests in the affected test suite before shipping, because flaky tests kill Deployment Frequency by making CI untrustworthy. |
| when_to_use | Apply automatically before marking any implementation complete, and before creating a PR. |
A flaky test is a test that sometimes passes and sometimes fails with no change to the code. One flaky test in a suite is an annoyance. Ten flaky tests is a culture problem. When engineers learn that CI is a coin flip, they start ignoring red builds. When they ignore red builds, real failures ship.
This is one of the most direct attacks on Deployment Frequency in existence. Teams with flaky test suites deploy less often not because they move slowly but because they have lost confidence in their own pipeline.
This skill finds and flags flaky tests before they can spread.
Before shipping new tests, check for the following patterns that cause flakiness:
Time-dependent behavior
Date.now(), time.Now(), datetime.now(), or equivalent without injecting a clocksleep() or explicit waits instead of polling for a conditionOrder-dependent behavior
beforeEach / afterEach / setUp / tearDown lifecycle managementNetwork and I/O dependency
Concurrency issues
Environment assumptions
## Flaky Test Report
### New tests added in this PR
| Test | Flakiness risk | Reason |
|------|---------------|--------|
| [test name] | LOW / MEDIUM / HIGH | [specific pattern found] |
### Existing tests in affected files
[Scan for known flakiness patterns in tests near the changed code]
| Test | Flakiness risk | Reason |
|------|---------------|--------|
### Verdict
[CLEAN — no flakiness patterns detected]
[REVIEW NEEDED — [N] tests have medium or high flakiness risk]
Do not ship a test with HIGH flakiness risk. Fix it before the PR merges.
For MEDIUM risk tests, output a specific recommendation:
Flakiness risk: [test name]
Pattern: [what was found]
Fix: [concrete suggestion — inject a clock, use temp directory, add teardown, etc.]
A single flaky test that fails 10% of the time means one in ten CI runs fails for no reason. If your team runs CI 50 times a day, that is five false failures per day. Each one requires someone to re-run the build, notice it passed the second time, and merge. Small cost per incident, significant cost across a quarter.
If the test is in a critical path and the team learns to re-run on failure, they will eventually stop noticing when the failure is real. That is when a real bug ships.
This skill detects flakiness patterns in code being written now. It does not fix flaky tests already in the suite. If you have a known flaky test problem, the fix is a dedicated cleanup sprint, not a skill.
What this skill does is prevent the suite from getting worse with every PR.