一键导入
flaky-test-detector
Identify and fix intermittently failing tests. Use when the user mentions flaky tests, random failures, or unreliable CI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Identify and fix intermittently failing tests. Use when the user mentions flaky tests, random failures, or unreliable CI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full QA audit orchestrator. Use when the user asks to "test my app", "run a full QA audit", "test everything", or invokes /qa-audit. Discovers what kind of application this is, selects the relevant QA agents (ui-inspector, api-sentinel, security-scout, perf-guardian, data-validator, regression-watcher), runs them, and merges their reports into one master QA report.
Onboard the QA toolkit onto any project. Use on first contact with a new codebase, when the user says "set up QA", "qa init", "/qa-init", or when any QA agent finds no qa-profile.md. Studies the project deeply and writes the persistent QA profile that every other agent reads first — the toolkit's long-term memory for this project.
Wire the QA suite into CI. Use when the user wants tests running automatically on every PR or on a schedule: "add this to CI", "run tests on every push", "/qa-ci". Generates GitHub Actions workflows for the generated Playwright suite and (optionally) scheduled full audits.
Self-healing for the generated test suite. Use when previously-green Playwright tests are failing, the user says "my tests broke", "fix the tests", "/qa-heal", or after a UI refactor breaks selectors. Classifies each failure (real bug vs test drift) and repairs the drift — never papers over real bugs.
Compare two QA audit runs and report what improved, what regressed, and what persists. Use when the user asks "did it improve since last time?", "compare audits", "QA trend", or invokes /qa-trend. Requires at least two timestamped runs under qa-reports/runs/.
Audit web pages for WCAG 2.1 compliance. Use when the user asks about accessibility, a11y, WCAG, screen readers, or contrast issues.
| name | flaky-test-detector |
| description | Identify and fix intermittently failing tests. Use when the user mentions flaky tests, random failures, or unreliable CI. |
Identify, analyze, and fix flaky tests that undermine CI/CD reliability.
This skill helps QA teams identify flaky tests (tests that pass and fail intermittently without code changes), analyze their root causes, and generate fixes. Flaky tests erode team confidence in test suites and slow down development.
When the user provides test results, test code, or describes intermittent failures:
sleep() with explicit waits, use polling with timeouts, await promises/futures## Flaky Test Analysis: [test_name]
### Identification
- [ ] Failure rate: X out of Y runs
- [ ] First observed: [date]
- [ ] Affected environments: [list]
- [ ] Passes in isolation: yes/no
### Root Cause Category
- [ ] Timing/Async
- [ ] Test Order Dependency
- [ ] Environment Dependency
- [ ] Data Dependency
- [ ] Network/External Service
- [ ] Resource Contention
- [ ] Non-deterministic Logic
### Evidence
- [Log snippets, error messages, timing data]
### Recommended Fix
- [Specific code changes]
### Prevention
- [What practice would have prevented this]
When reviewing test code, flag these anti-patterns:
FLAKY RISK: sleep()/setTimeout() without condition check
FLAKY RISK: Shared database without transaction isolation
FLAKY RISK: Assertions on timestamps without tolerance
FLAKY RISK: Unordered collection compared with strict equality
FLAKY RISK: File system operations without cleanup
FLAKY RISK: Port hardcoding without availability check
FLAKY RISK: Date.now() or new Date() in assertions
FLAKY RISK: Missing await/async handling
These tests are flaky in our CI pipeline. Here are results from 5 runs:
Run 1: test_checkout PASS, test_payment FAIL
Run 2: test_checkout FAIL, test_payment PASS
...
Here's the test code: [paste code]
Review this test file and identify potential flaky test risks:
[paste test code]