qa-skills 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +20 -149
  2. package/bin/cli.js +1 -40
  3. package/package.json +23 -26
  4. package/dist/agents/registry.d.ts +0 -5
  5. package/dist/agents/registry.d.ts.map +0 -1
  6. package/dist/agents/registry.js +0 -101
  7. package/dist/agents/registry.js.map +0 -1
  8. package/dist/agents/types.d.ts +0 -9
  9. package/dist/agents/types.d.ts.map +0 -1
  10. package/dist/agents/types.js +0 -2
  11. package/dist/agents/types.js.map +0 -1
  12. package/dist/dependencies.d.ts +0 -21
  13. package/dist/dependencies.d.ts.map +0 -1
  14. package/dist/dependencies.js +0 -125
  15. package/dist/dependencies.js.map +0 -1
  16. package/dist/installer.d.ts +0 -25
  17. package/dist/installer.d.ts.map +0 -1
  18. package/dist/installer.js +0 -437
  19. package/dist/installer.js.map +0 -1
  20. package/dist/scaffold.d.ts +0 -27
  21. package/dist/scaffold.d.ts.map +0 -1
  22. package/dist/scaffold.js +0 -182
  23. package/dist/scaffold.js.map +0 -1
  24. package/skills/qa-accessibility-test-writer/SKILL.md +0 -127
  25. package/skills/qa-accessibility-test-writer/references/axe-core-patterns.md +0 -349
  26. package/skills/qa-accessibility-test-writer/references/best-practices.md +0 -184
  27. package/skills/qa-accessibility-test-writer/references/wcag-tests.md +0 -331
  28. package/skills/qa-api-contract-curator/SKILL.md +0 -104
  29. package/skills/qa-api-contract-curator/references/breaking-changes.md +0 -363
  30. package/skills/qa-api-contract-curator/references/openapi-structure.md +0 -404
  31. package/skills/qa-browser-data-collector/SKILL.md +0 -132
  32. package/skills/qa-browser-data-collector/references/data-collection-checklist.md +0 -91
  33. package/skills/qa-browser-data-collector/references/playwright-mcp-patterns.md +0 -113
  34. package/skills/qa-bug-ticket-creator/SKILL.md +0 -148
  35. package/skills/qa-bug-ticket-creator/references/bug-report-format.md +0 -149
  36. package/skills/qa-bug-ticket-creator/references/severity-guide.md +0 -81
  37. package/skills/qa-bug-ticket-creator/templates/bug-ticket-template.md +0 -39
  38. package/skills/qa-changelog-analyzer/SKILL.md +0 -134
  39. package/skills/qa-changelog-analyzer/references/git-analysis-patterns.md +0 -138
  40. package/skills/qa-changelog-analyzer/references/impact-mapping.md +0 -120
  41. package/skills/qa-clickup-integration/SKILL.md +0 -166
  42. package/skills/qa-clickup-integration/references/api-patterns.md +0 -102
  43. package/skills/qa-clickup-integration/references/field-mapping.md +0 -71
  44. package/skills/qa-codeceptjs-writer/SKILL.md +0 -136
  45. package/skills/qa-codeceptjs-writer/references/best-practices.md +0 -207
  46. package/skills/qa-codeceptjs-writer/references/config.md +0 -255
  47. package/skills/qa-codeceptjs-writer/references/patterns.md +0 -285
  48. package/skills/qa-coverage-analyzer/SKILL.md +0 -166
  49. package/skills/qa-coverage-analyzer/references/best-practices.md +0 -142
  50. package/skills/qa-coverage-analyzer/references/coverage-dimensions.md +0 -155
  51. package/skills/qa-coverage-analyzer/references/tools.md +0 -204
  52. package/skills/qa-cypress-writer/SKILL.md +0 -134
  53. package/skills/qa-cypress-writer/references/assertions.md +0 -121
  54. package/skills/qa-cypress-writer/references/best-practices.md +0 -82
  55. package/skills/qa-cypress-writer/references/config.md +0 -121
  56. package/skills/qa-cypress-writer/references/patterns.md +0 -170
  57. package/skills/qa-data-factory/SKILL.md +0 -126
  58. package/skills/qa-data-factory/references/factory-patterns.md +0 -164
  59. package/skills/qa-data-factory/references/faker-guide.md +0 -131
  60. package/skills/qa-diagram-generator/SKILL.md +0 -125
  61. package/skills/qa-diagram-generator/references/c4-model.md +0 -53
  62. package/skills/qa-diagram-generator/references/charts.md +0 -58
  63. package/skills/qa-diagram-generator/references/class-diagram.md +0 -85
  64. package/skills/qa-diagram-generator/references/er-diagram.md +0 -69
  65. package/skills/qa-diagram-generator/references/flowchart.md +0 -92
  66. package/skills/qa-diagram-generator/references/from-screenshot.md +0 -45
  67. package/skills/qa-diagram-generator/references/gantt.md +0 -49
  68. package/skills/qa-diagram-generator/references/journey.md +0 -50
  69. package/skills/qa-diagram-generator/references/mindmap.md +0 -75
  70. package/skills/qa-diagram-generator/references/sequence.md +0 -69
  71. package/skills/qa-diagram-generator/references/state-diagram.md +0 -56
  72. package/skills/qa-discovery-interview/SKILL.md +0 -182
  73. package/skills/qa-discovery-interview/references/completeness-checklist.md +0 -53
  74. package/skills/qa-discovery-interview/references/conflict-patterns.md +0 -101
  75. package/skills/qa-discovery-interview/references/qa-categories.md +0 -147
  76. package/skills/qa-discovery-interview/templates/qa-brief-template.md +0 -168
  77. package/skills/qa-environment-checker/SKILL.md +0 -142
  78. package/skills/qa-environment-checker/references/dependency-matrix.md +0 -101
  79. package/skills/qa-environment-checker/references/health-checks.md +0 -209
  80. package/skills/qa-environment-checker/templates/env-readiness-template.md +0 -64
  81. package/skills/qa-flaky-detector/SKILL.md +0 -153
  82. package/skills/qa-flaky-detector/references/ci-analysis.md +0 -140
  83. package/skills/qa-flaky-detector/references/flaky-patterns.md +0 -247
  84. package/skills/qa-github-issues-enhanced/SKILL.md +0 -175
  85. package/skills/qa-github-issues-enhanced/references/issue-templates.md +0 -425
  86. package/skills/qa-github-issues-enhanced/references/label-taxonomy.md +0 -130
  87. package/skills/qa-github-issues-enhanced/references/workflow-patterns.md +0 -188
  88. package/skills/qa-httpx-writer/SKILL.md +0 -138
  89. package/skills/qa-httpx-writer/references/assertions.md +0 -195
  90. package/skills/qa-httpx-writer/references/best-practices.md +0 -140
  91. package/skills/qa-httpx-writer/references/config.md +0 -212
  92. package/skills/qa-httpx-writer/references/patterns.md +0 -262
  93. package/skills/qa-jest-writer/SKILL.md +0 -131
  94. package/skills/qa-jest-writer/references/assertions.md +0 -125
  95. package/skills/qa-jest-writer/references/best-practices.md +0 -136
  96. package/skills/qa-jest-writer/references/config.md +0 -134
  97. package/skills/qa-jest-writer/references/patterns.md +0 -172
  98. package/skills/qa-jira-integration/SKILL.md +0 -135
  99. package/skills/qa-jira-integration/references/api-patterns.md +0 -143
  100. package/skills/qa-jira-integration/references/field-mapping.md +0 -79
  101. package/skills/qa-jira-integration/references/xray-integration.md +0 -85
  102. package/skills/qa-jmeter-writer/SKILL.md +0 -171
  103. package/skills/qa-jmeter-writer/references/best-practices.md +0 -157
  104. package/skills/qa-jmeter-writer/references/config.md +0 -204
  105. package/skills/qa-jmeter-writer/references/patterns.md +0 -242
  106. package/skills/qa-junit5-writer/SKILL.md +0 -157
  107. package/skills/qa-junit5-writer/references/assertions.md +0 -118
  108. package/skills/qa-junit5-writer/references/config.md +0 -97
  109. package/skills/qa-junit5-writer/references/patterns.md +0 -162
  110. package/skills/qa-k6-writer/SKILL.md +0 -155
  111. package/skills/qa-k6-writer/references/best-practices.md +0 -236
  112. package/skills/qa-k6-writer/references/config.md +0 -219
  113. package/skills/qa-k6-writer/references/patterns.md +0 -304
  114. package/skills/qa-linear-integration/SKILL.md +0 -137
  115. package/skills/qa-linear-integration/references/api-patterns.md +0 -249
  116. package/skills/qa-linear-integration/references/field-mapping.md +0 -121
  117. package/skills/qa-locust-writer/SKILL.md +0 -151
  118. package/skills/qa-locust-writer/references/best-practices.md +0 -126
  119. package/skills/qa-locust-writer/references/config.md +0 -170
  120. package/skills/qa-locust-writer/references/patterns.md +0 -235
  121. package/skills/qa-manual-test-designer/SKILL.md +0 -145
  122. package/skills/qa-manual-test-designer/references/exploratory-charters.md +0 -138
  123. package/skills/qa-manual-test-designer/references/personas.md +0 -146
  124. package/skills/qa-manual-test-designer/templates/exploratory-charter-template.md +0 -47
  125. package/skills/qa-manual-test-designer/templates/test-case-template.md +0 -31
  126. package/skills/qa-mobile-test-writer/SKILL.md +0 -144
  127. package/skills/qa-mobile-test-writer/references/best-practices.md +0 -214
  128. package/skills/qa-mobile-test-writer/references/config.md +0 -309
  129. package/skills/qa-mobile-test-writer/references/patterns.md +0 -304
  130. package/skills/qa-nfr-analyst/SKILL.md +0 -177
  131. package/skills/qa-nfr-analyst/references/iso-25010-model.md +0 -159
  132. package/skills/qa-nfr-analyst/references/owasp-wstg-baseline.md +0 -202
  133. package/skills/qa-nfr-analyst/references/wcag-checklist.md +0 -184
  134. package/skills/qa-nfr-analyst/templates/owasp-checklist-template.md +0 -89
  135. package/skills/qa-nfr-analyst/templates/wcag-checklist-template.md +0 -48
  136. package/skills/qa-orchestrator/SKILL.md +0 -132
  137. package/skills/qa-orchestrator/references/handoff-chains.md +0 -105
  138. package/skills/qa-orchestrator/references/pipeline-modes.md +0 -115
  139. package/skills/qa-orchestrator/references/scheduler-rules.md +0 -84
  140. package/skills/qa-pact-writer/SKILL.md +0 -133
  141. package/skills/qa-pact-writer/references/best-practices.md +0 -100
  142. package/skills/qa-pact-writer/references/config.md +0 -135
  143. package/skills/qa-pact-writer/references/patterns.md +0 -161
  144. package/skills/qa-plan-creator/SKILL.md +0 -139
  145. package/skills/qa-plan-creator/references/introduction-plan.md +0 -43
  146. package/skills/qa-plan-creator/references/migration-plan.md +0 -44
  147. package/skills/qa-plan-creator/references/onboarding-plan.md +0 -46
  148. package/skills/qa-plan-creator/references/performance-plan.md +0 -44
  149. package/skills/qa-plan-creator/references/regression-plan.md +0 -45
  150. package/skills/qa-plan-creator/references/release-plan.md +0 -45
  151. package/skills/qa-plan-creator/references/sprint-plan.md +0 -44
  152. package/skills/qa-plan-creator/references/test-plan.md +0 -59
  153. package/skills/qa-plan-creator/references/uat-plan.md +0 -43
  154. package/skills/qa-plan-creator/templates/checklist-template.md +0 -36
  155. package/skills/qa-plan-creator/templates/regression-checklist-template.md +0 -49
  156. package/skills/qa-plan-creator/templates/release-checklist-template.md +0 -46
  157. package/skills/qa-plan-creator/templates/test-plan-template.md +0 -74
  158. package/skills/qa-playwright-py-writer/SKILL.md +0 -156
  159. package/skills/qa-playwright-py-writer/references/best-practices.md +0 -194
  160. package/skills/qa-playwright-py-writer/references/config.md +0 -195
  161. package/skills/qa-playwright-py-writer/references/patterns.md +0 -212
  162. package/skills/qa-playwright-ts-writer/SKILL.md +0 -151
  163. package/skills/qa-playwright-ts-writer/references/assertions.md +0 -109
  164. package/skills/qa-playwright-ts-writer/references/best-practices.md +0 -191
  165. package/skills/qa-playwright-ts-writer/references/config.md +0 -144
  166. package/skills/qa-playwright-ts-writer/references/patterns.md +0 -171
  167. package/skills/qa-pytest-writer/SKILL.md +0 -145
  168. package/skills/qa-pytest-writer/references/assertions.md +0 -149
  169. package/skills/qa-pytest-writer/references/best-practices.md +0 -97
  170. package/skills/qa-pytest-writer/references/config.md +0 -176
  171. package/skills/qa-pytest-writer/references/patterns.md +0 -251
  172. package/skills/qa-qase-integration/SKILL.md +0 -149
  173. package/skills/qa-qase-integration/references/api-reference.md +0 -354
  174. package/skills/qa-qase-integration/references/ci-integration.md +0 -196
  175. package/skills/qa-qase-integration/references/field-mapping.md +0 -157
  176. package/skills/qa-requirements-generator/SKILL.md +0 -152
  177. package/skills/qa-requirements-generator/references/iso-29148-structure.md +0 -153
  178. package/skills/qa-requirements-generator/references/requirement-patterns.md +0 -278
  179. package/skills/qa-rest-assured-writer/SKILL.md +0 -137
  180. package/skills/qa-rest-assured-writer/references/best-practices.md +0 -50
  181. package/skills/qa-rest-assured-writer/references/config.md +0 -124
  182. package/skills/qa-rest-assured-writer/references/patterns.md +0 -192
  183. package/skills/qa-risk-analyzer/SKILL.md +0 -158
  184. package/skills/qa-risk-analyzer/references/impact-analysis.md +0 -133
  185. package/skills/qa-risk-analyzer/references/risk-factors.md +0 -123
  186. package/skills/qa-robot-framework-writer/SKILL.md +0 -147
  187. package/skills/qa-robot-framework-writer/references/best-practices.md +0 -249
  188. package/skills/qa-robot-framework-writer/references/config.md +0 -204
  189. package/skills/qa-robot-framework-writer/references/libraries.md +0 -273
  190. package/skills/qa-robot-framework-writer/references/patterns.md +0 -216
  191. package/skills/qa-security-test-writer/SKILL.md +0 -123
  192. package/skills/qa-security-test-writer/references/best-practices.md +0 -155
  193. package/skills/qa-security-test-writer/references/owasp-top10.md +0 -331
  194. package/skills/qa-security-test-writer/references/zap-config.md +0 -258
  195. package/skills/qa-selenium-java-writer/SKILL.md +0 -143
  196. package/skills/qa-selenium-java-writer/references/best-practices.md +0 -59
  197. package/skills/qa-selenium-java-writer/references/config.md +0 -143
  198. package/skills/qa-selenium-java-writer/references/patterns.md +0 -170
  199. package/skills/qa-selenium-py-writer/SKILL.md +0 -150
  200. package/skills/qa-selenium-py-writer/references/best-practices.md +0 -175
  201. package/skills/qa-selenium-py-writer/references/config.md +0 -224
  202. package/skills/qa-selenium-py-writer/references/patterns.md +0 -255
  203. package/skills/qa-shortcut-integration/SKILL.md +0 -143
  204. package/skills/qa-shortcut-integration/references/api-patterns.md +0 -126
  205. package/skills/qa-shortcut-integration/references/field-mapping.md +0 -66
  206. package/skills/qa-spec-auditor/SKILL.md +0 -162
  207. package/skills/qa-spec-auditor/references/audit-checklist.md +0 -144
  208. package/skills/qa-spec-auditor/references/drift-patterns.md +0 -207
  209. package/skills/qa-spec-writer/SKILL.md +0 -143
  210. package/skills/qa-spec-writer/references/gherkin-guide.md +0 -253
  211. package/skills/qa-spec-writer/references/specification-patterns.md +0 -274
  212. package/skills/qa-spring-test-writer/SKILL.md +0 -170
  213. package/skills/qa-spring-test-writer/references/best-practices.md +0 -57
  214. package/skills/qa-spring-test-writer/references/config.md +0 -179
  215. package/skills/qa-spring-test-writer/references/patterns.md +0 -235
  216. package/skills/qa-supertest-writer/SKILL.md +0 -150
  217. package/skills/qa-supertest-writer/references/assertions.md +0 -192
  218. package/skills/qa-supertest-writer/references/best-practices.md +0 -102
  219. package/skills/qa-supertest-writer/references/config.md +0 -166
  220. package/skills/qa-supertest-writer/references/patterns.md +0 -242
  221. package/skills/qa-task-creator/SKILL.md +0 -142
  222. package/skills/qa-task-creator/references/linking-patterns.md +0 -127
  223. package/skills/qa-task-creator/references/task-types.md +0 -169
  224. package/skills/qa-task-creator/templates/task-template.md +0 -24
  225. package/skills/qa-test-doc-compiler/SKILL.md +0 -114
  226. package/skills/qa-test-doc-compiler/references/agile-tailoring.md +0 -220
  227. package/skills/qa-test-doc-compiler/references/iso-29119-3-documents.md +0 -302
  228. package/skills/qa-test-healer/SKILL.md +0 -101
  229. package/skills/qa-test-healer/references/diagnosis-patterns.md +0 -142
  230. package/skills/qa-test-healer/references/fix-strategies.md +0 -177
  231. package/skills/qa-test-reporter/SKILL.md +0 -130
  232. package/skills/qa-test-reporter/references/best-practices.md +0 -162
  233. package/skills/qa-test-reporter/references/iso-29119-reports.md +0 -236
  234. package/skills/qa-test-reporter/references/report-formats.md +0 -287
  235. package/skills/qa-test-reviewer/SKILL.md +0 -142
  236. package/skills/qa-test-reviewer/references/anti-patterns.md +0 -268
  237. package/skills/qa-test-reviewer/references/review-checklist.md +0 -93
  238. package/skills/qa-test-strategy/SKILL.md +0 -133
  239. package/skills/qa-test-strategy/references/entry-exit-criteria.md +0 -176
  240. package/skills/qa-test-strategy/references/risk-matrix.md +0 -102
  241. package/skills/qa-test-strategy/references/testing-types.md +0 -143
  242. package/skills/qa-testcase-from-docs/SKILL.md +0 -161
  243. package/skills/qa-testcase-from-docs/references/test-case-format.md +0 -196
  244. package/skills/qa-testcase-from-docs/references/test-design-techniques.md +0 -126
  245. package/skills/qa-testcase-from-docs/templates/test-case-template.md +0 -31
  246. package/skills/qa-testcase-from-ui/SKILL.md +0 -109
  247. package/skills/qa-testcase-from-ui/references/ui-element-patterns.md +0 -126
  248. package/skills/qa-testcase-from-ui/references/visual-analysis-guide.md +0 -146
  249. package/skills/qa-testcase-from-ui/templates/test-case-template.md +0 -31
  250. package/skills/qa-visual-regression-writer/SKILL.md +0 -175
  251. package/skills/qa-visual-regression-writer/references/best-practices.md +0 -154
  252. package/skills/qa-visual-regression-writer/references/config.md +0 -220
  253. package/skills/qa-visual-regression-writer/references/patterns.md +0 -213
  254. package/skills/qa-vitest-writer/SKILL.md +0 -141
  255. package/skills/qa-vitest-writer/references/assertions.md +0 -105
  256. package/skills/qa-vitest-writer/references/best-practices.md +0 -62
  257. package/skills/qa-vitest-writer/references/config.md +0 -127
  258. package/skills/qa-vitest-writer/references/patterns.md +0 -141
  259. package/skills/qa-webdriverio-writer/SKILL.md +0 -145
  260. package/skills/qa-webdriverio-writer/references/best-practices.md +0 -176
  261. package/skills/qa-webdriverio-writer/references/config.md +0 -240
  262. package/skills/qa-webdriverio-writer/references/patterns.md +0 -269
@@ -1,153 +0,0 @@
1
- ---
2
- name: qa-flaky-detector
3
- description: Analyze CI history and test execution data to identify flaky tests using 4-pattern classification -- race conditions, shared state, time-dependency, external dependencies -- with suggested fixes.
4
- output_dir: reports/flaky
5
- dependencies:
6
- recommended:
7
- - qa-test-healer
8
- ---
9
-
10
- # QA Flaky Detector
11
-
12
- ## Purpose
13
-
14
- Identify and classify flaky tests from CI history and test execution data. Flaky tests pass and fail intermittently for the same code, wasting CI time and masking real failures. This skill detects flakiness, classifies root causes into four patterns, and suggests targeted fixes.
15
-
16
- ## Trigger Phrases
17
-
18
- - "Find flaky tests" / "Identify flaky tests"
19
- - "Analyze CI history for flakiness" / "Flaky test report"
20
- - "Why does this test fail sometimes?" / "Intermittent test failures"
21
- - "Classify flaky test [name]" / "Flaky test patterns"
22
- - "Suggested fixes for flaky tests" / "Fix flaky [test name]"
23
-
24
- ## 4-Pattern Classification
25
-
26
- | Pattern | Description | Typical Causes | Suggested Fixes |
27
- |---------|-------------|----------------|-----------------|
28
- | **1. Race conditions** | Async timing, DOM not ready, API response order | Missing awaits, no explicit waits, parallel execution | Add explicit waits, `await` chains, `waitForSelector` |
29
- | **2. Shared state** | Test order dependency, global state mutation, DB leftover | Global vars, singletons, uncleared DB/cache | Isolate tests, `beforeEach` cleanup, transactional rollback |
30
- | **3. Time-dependency** | Timezone, date/time mocking, daylight saving | `new Date()`, `Date.now()`, hardcoded dates | Mock time (Jest `useFakeTimers`, `freezegun`), use fixed dates |
31
- | **4. External dependencies** | Network calls, third-party APIs, file system | Live HTTP, external services, temp files | Mock/stub APIs, use fixtures, deterministic file paths |
32
-
33
- See `references/flaky-patterns.md` for detailed patterns with code examples and fixes.
34
-
35
- ## Detection Methods
36
-
37
- ### 1. CI History Analysis
38
-
39
- - Same test, different results across runs (pass/fail flip)
40
- - Compare JUnit XML, Allure, or CI job logs over N runs
41
- - Threshold: pass rate < 100% over 10+ runs → flag as flaky
42
-
43
- ### 2. Statistical Analysis
44
-
45
- - Pass rate per test: `passes / (passes + failures)` over recent runs
46
- - Confidence: more runs → higher confidence in flakiness
47
- - Minimum runs: recommend 10+ for reliable detection
48
-
49
- ### 3. Pattern Matching (Code-Based)
50
-
51
- - Scan test code for known flaky signatures:
52
- - No `await` on async operations
53
- - `setTimeout`/`setInterval` without cleanup
54
- - `new Date()` or `Date.now()` without mocking
55
- - Direct HTTP calls, file I/O
56
- - Shared globals, singletons
57
- - Missing `beforeEach`/`afterEach` cleanup
58
-
59
- See `references/ci-analysis.md` for CI history analysis methods.
60
-
61
- ## Workflow
62
-
63
- 1. **Input** — CI artifacts (JUnit XML, Allure, GitHub Actions logs), test execution history, or test file paths
64
- 2. **Collect** — Parse results from N runs; build pass/fail matrix per test
65
- 3. **Detect** — Identify tests with pass rate < 100%
66
- 4. **Classify** — Map each flaky test to one or more of the 4 patterns (code scan + heuristics)
67
- 5. **Suggest** — Generate fix recommendations per pattern
68
- 6. **Output** — Flaky test report, prioritized fix list
69
-
70
- ## Output Deliverables
71
-
72
- ### Flaky Test Report
73
-
74
- ```markdown
75
- # Flaky Test Report — [Project/Branch]
76
-
77
- ## Summary
78
- | Test | Failure Rate | Runs | Classification | Priority |
79
- |------|--------------|------|----------------|----------|
80
- | auth.login.spec.ts:42 | 23% | 26 | Race condition | High |
81
- | checkout.flow.spec.ts:15 | 12% | 18 | Shared state | High |
82
- | utils.date.spec.ts:8 | 8% | 12 | Time-dependency | Medium |
83
-
84
- ## Detailed Findings
85
-
86
- ### auth.login.spec.ts:42 — "should redirect after login"
87
- - **Failure rate:** 6/26 (23%)
88
- - **Classification:** Race condition
89
- - **Likely cause:** DOM not ready before assertion
90
- - **Suggested fix:** Add `await page.waitForSelector('#dashboard')` before assertion
91
- ```
92
-
93
- ### Prioritized Fix List
94
-
95
- 1. **High** — High failure rate, critical path, or easy fix
96
- 2. **Medium** — Moderate rate, non-critical
97
- 3. **Low** — Low rate, edge cases
98
-
99
- ## Integration with Other Skills
100
-
101
- | Need | Skill | Usage |
102
- |------|-------|-------|
103
- | Parse JUnit/Allure | qa-test-reporter | Aggregate results from multiple runs |
104
- | Fix broken selectors | qa-test-healer | Apply suggested waits/selectors |
105
- | Create fix tasks | qa-task-creator | Generate tasks for flaky test fixes |
106
- | Test strategy | qa-test-strategy | Document flaky mitigation in strategy |
107
-
108
- ## Scope
109
-
110
- **Can do (autonomous):**
111
- - Parse CI/test results (JUnit XML, Allure, common formats)
112
- - Compute pass rate per test over N runs
113
- - Classify flaky tests into 4 patterns
114
- - Scan test code for flaky signatures
115
- - Produce flaky report and prioritized fix list
116
- - Suggest fixes per pattern (from reference patterns)
117
-
118
- **Cannot do (requires confirmation):**
119
- - Modify test code directly (suggest only; qa-test-healer can apply)
120
- - Access private CI systems without credentials
121
- - Override classification without evidence
122
-
123
- **Will not do (out of scope):**
124
- - Execute tests or run CI
125
- - Deploy or change production
126
- - Guarantee fix effectiveness (suggestions are heuristic-based)
127
-
128
- ## Quality Checklist
129
-
130
- - [ ] Pass rate calculated over sufficient runs (≥10 recommended)
131
- - [ ] Each flaky test classified into at least one pattern
132
- - [ ] Suggested fixes match pattern and reference examples
133
- - [ ] Report includes test name, file:line, failure rate, classification
134
- - [ ] Prioritized fix list ordered by impact
135
- - [ ] No hardcoded credentials; CI access from user/env
136
-
137
- ## Troubleshooting
138
-
139
- | Symptom | Likely Cause | Fix |
140
- |---------|--------------|-----|
141
- | No flaky tests found | Too few runs, or tests truly stable | Increase run count; verify CI artifacts parsed |
142
- | All tests flagged | Threshold too strict | Raise pass-rate threshold; exclude known-broken tests |
143
- | Wrong classification | Heuristics insufficient | Review code manually; add custom pattern to references |
144
- | Missing CI data | Format not supported | Check qa-test-reporter; add parser for format |
145
- | Fix doesn't work | Root cause different | Re-classify; try alternative pattern fixes |
146
- | Pass rate 0% | Test always fails | Exclude from flaky report; treat as broken |
147
-
148
- ## Reference Files
149
-
150
- | Topic | Reference |
151
- |-------|-----------|
152
- | Flaky patterns with code examples and fixes | `references/flaky-patterns.md` |
153
- | CI history analysis methods | `references/ci-analysis.md` |
@@ -1,140 +0,0 @@
1
- # CI History Analysis for Flaky Detection
2
-
3
- ## Overview
4
-
5
- Flaky tests are identified by analyzing test execution history across multiple CI runs. Same test, different results (pass/fail flip) indicates flakiness.
6
-
7
- ---
8
-
9
- ## 1. Data Sources
10
-
11
- ### JUnit XML
12
-
13
- - **Location:** `test-results/*.xml`, `junit.xml`, `report.xml`
14
- - **Parse:** `testsuites` → `testsuite` → `testcase`; attribute `name`, status (pass/fail)
15
- - **Aggregate:** Collect XML from N runs (e.g., last 20 builds)
16
-
17
- ### Allure
18
-
19
- - **Location:** `allure-results/`, `allure-report/`
20
- - **Parse:** `*-result.json` or `*-container.json`; extract test name, status, history
21
- - **History:** Allure can store history across runs for trend analysis
22
-
23
- ### GitHub Actions
24
-
25
- - **Artifacts:** Test results uploaded as artifacts
26
- - **Logs:** Parse job logs for test output (e.g., Jest, pytest summary)
27
- - **API:** `GET /repos/{owner}/{repo}/actions/runs` to list runs; fetch artifacts
28
-
29
- ### Other CI Systems
30
-
31
- - **GitLab CI:** JUnit reports, `junit: report.xml`
32
- - **Jenkins:** JUnit plugin, `**/junit/*.xml`
33
- - **CircleCI:** Store test results, `store_test_results`
34
- - **Azure Pipelines:** Publish test results task
35
-
36
- ---
37
-
38
- ## 2. Pass Rate Calculation
39
-
40
- ### Formula
41
-
42
- ```
43
- pass_rate = passes / (passes + failures)
44
- ```
45
-
46
- - **Flaky threshold:** `pass_rate < 1.0` and `pass_rate > 0` (i.e., at least one pass and one fail)
47
- - **Always failing:** `pass_rate = 0` → exclude from flaky report (treat as broken)
48
- - **Always passing:** `pass_rate = 1.0` → stable, not flaky
49
-
50
- ### Minimum Runs
51
-
52
- - **Recommended:** 10+ runs for reliable detection
53
- - **Low runs:** High variance; flag as "uncertain" or "needs more data"
54
-
55
- ### Example
56
-
57
- | Test | Run 1 | Run 2 | Run 3 | ... | Run 10 | Pass Rate |
58
- |------|-------|-------|-------|-----|--------|------------|
59
- | login.spec.ts:42 | P | F | P | ... | P | 7/10 = 70% |
60
-
61
- ---
62
-
63
- ## 3. Aggregation Workflow
64
-
65
- 1. **Collect** — Fetch test results from last N CI runs (e.g., 20)
66
- 2. **Normalize** — Map test names to canonical form (file:line or full name)
67
- 3. **Build matrix** — Rows = tests, columns = runs, cells = pass/fail
68
- 4. **Compute** — Pass rate per test
69
- 5. **Filter** — Keep tests with `0 < pass_rate < 1`
70
- 6. **Sort** — By failure rate (high first) or by critical path
71
-
72
- ---
73
-
74
- ## 4. Test Name Normalization
75
-
76
- Different frameworks report names differently:
77
-
78
- | Framework | Example | Normalized |
79
- |-----------|---------|------------|
80
- | Jest | `auth › login › should redirect` | `auth/login.spec.ts` or full name |
81
- | pytest | `tests/test_auth.py::test_login` | `tests/test_auth.py::test_login` |
82
- | Playwright | `auth/login.spec.ts:42` | `auth/login.spec.ts:42` |
83
- | Mocha | `Login should redirect` | Match by file + describe + it |
84
-
85
- Use consistent normalization to merge results across runs.
86
-
87
- ---
88
-
89
- ## 5. CI-Specific Parsing
90
-
91
- ### GitHub Actions
92
-
93
- ```yaml
94
- # In workflow, ensure test results are published
95
- - uses: actions/upload-artifact@v4
96
- with:
97
- name: test-results
98
- path: test-results/
99
- ```
100
-
101
- Parse artifact `test-results/*.xml` from each run.
102
-
103
- ### GitLab CI
104
-
105
- ```yaml
106
- junit: report.xml
107
- ```
108
-
109
- Download `report.xml` from job artifacts via API.
110
-
111
- ### Local Script
112
-
113
- ```bash
114
- # Collect last N runs (conceptual)
115
- for run in $(gh run list --limit 20 --json databaseId -q '.[].databaseId'); do
116
- gh run download $run -n test-results -D results/run-$run
117
- done
118
- ```
119
-
120
- ---
121
-
122
- ## 6. Output for qa-flaky-detector
123
-
124
- Feed aggregated data into the skill:
125
-
126
- ```json
127
- {
128
- "runs": 20,
129
- "tests": [
130
- {
131
- "name": "auth/login.spec.ts:42",
132
- "passes": 14,
133
- "failures": 6,
134
- "pass_rate": 0.7
135
- }
136
- ]
137
- }
138
- ```
139
-
140
- The skill then classifies each flaky test and suggests fixes.
@@ -1,247 +0,0 @@
1
- # Flaky Test Patterns — Code Examples and Fixes
2
-
3
- ## Overview
4
-
5
- Flaky tests pass and fail intermittently. This reference documents four root-cause patterns with code examples and recommended fixes.
6
-
7
- ---
8
-
9
- ## 1. Race Conditions
10
-
11
- ### Description
12
-
13
- Tests fail when async operations complete in unpredictable order or when the UI/API is not ready before assertions.
14
-
15
- ### Signatures in Code
16
-
17
- - `click()` without `waitFor` before assertion
18
- - `fetch()` / `axios` without `await`
19
- - `setTimeout` with fixed delay (fragile)
20
- - Parallel `Promise.all` with order-dependent assertions
21
- - No `waitForSelector` / `waitForLoadState` before DOM checks
22
-
23
- ### Example (Playwright — Flaky)
24
-
25
- ```typescript
26
- test('should show dashboard after login', async ({ page }) => {
27
- await page.fill('#email', 'user@test.com');
28
- await page.fill('#password', 'secret');
29
- await page.click('button[type="submit"]');
30
- // Race: redirect may not have completed
31
- expect(await page.textContent('h1')).toBe('Dashboard'); // Fails sometimes
32
- });
33
- ```
34
-
35
- ### Fix
36
-
37
- ```typescript
38
- test('should show dashboard after login', async ({ page }) => {
39
- await page.fill('#email', 'user@test.com');
40
- await page.fill('#password', 'secret');
41
- await page.click('button[type="submit"]');
42
- await page.waitForSelector('h1:has-text("Dashboard")', { timeout: 5000 });
43
- expect(await page.textContent('h1')).toBe('Dashboard');
44
- });
45
- ```
46
-
47
- ### Example (Jest — Flaky)
48
-
49
- ```typescript
50
- it('fetches user', async () => {
51
- fetchUser().then(data => expect(data.name).toBe('Alice')); // No await
52
- });
53
- ```
54
-
55
- ### Fix
56
-
57
- ```typescript
58
- it('fetches user', async () => {
59
- const data = await fetchUser();
60
- expect(data.name).toBe('Alice');
61
- });
62
- ```
63
-
64
- ---
65
-
66
- ## 2. Shared State
67
-
68
- ### Description
69
-
70
- Tests affect each other via global state, singletons, database, or file system. Order of execution changes outcomes.
71
-
72
- ### Signatures in Code
73
-
74
- - Global variables, module-level caches
75
- - Singleton instances
76
- - Database records not cleaned between tests
77
- - File system writes (temp files, config)
78
- - Browser `localStorage` / `sessionStorage` not cleared
79
-
80
- ### Example (Flaky)
81
-
82
- ```typescript
83
- let currentUser; // Shared across tests
84
-
85
- beforeEach(() => {
86
- currentUser = null; // Missing in some suites
87
- });
88
-
89
- it('sets user', () => {
90
- currentUser = { id: 1, name: 'Alice' };
91
- expect(getUserName()).toBe('Alice');
92
- });
93
-
94
- it('gets user', () => {
95
- expect(getUserName()).toBeNull(); // Fails if previous test ran first
96
- });
97
- ```
98
-
99
- ### Fix
100
-
101
- ```typescript
102
- beforeEach(() => {
103
- currentUser = null;
104
- // Or: reset module, use dependency injection
105
- });
106
- ```
107
-
108
- ### Example (DB — Flaky)
109
-
110
- ```python
111
- def test_create_order():
112
- order = create_order(user_id=1, total=100)
113
- assert order.id is not None
114
-
115
- def test_list_orders():
116
- orders = list_orders(user_id=1)
117
- assert len(orders) == 0 # Fails if test_create_order ran first
118
- ```
119
-
120
- ### Fix
121
-
122
- ```python
123
- @pytest.fixture(autouse=True)
124
- def clean_orders(db):
125
- yield
126
- db.execute("DELETE FROM orders WHERE user_id = 1")
127
- ```
128
-
129
- ---
130
-
131
- ## 3. Time-Dependency
132
-
133
- ### Description
134
-
135
- Tests depend on current date/time, timezone, or system clock. Failures occur at certain times or in different environments.
136
-
137
- ### Signatures in Code
138
-
139
- - `new Date()`, `Date.now()`
140
- - `new Date().toISOString()`
141
- - Timezone-dependent logic
142
- - `setTimeout` with real delays
143
- - Daylight saving transitions
144
-
145
- ### Example (Flaky)
146
-
147
- ```typescript
148
- it('formats expiry date', () => {
149
- const card = { expiry: '12/25' };
150
- expect(formatExpiry(card)).toContain('2025'); // Assumes current year
151
- });
152
- ```
153
-
154
- ### Fix
155
-
156
- ```typescript
157
- beforeEach(() => {
158
- jest.useFakeTimers();
159
- jest.setSystemTime(new Date('2024-06-15'));
160
- });
161
- afterEach(() => jest.useRealTimers());
162
- ```
163
-
164
- ### Example (Python — Flaky)
165
-
166
- ```python
167
- def test_is_expired():
168
- obj = create_obj(expires_at=datetime.now() - timedelta(days=1))
169
- assert obj.is_expired() # Fails near midnight
170
- ```
171
-
172
- ### Fix
173
-
174
- ```python
175
- from freezegun import freeze_time
176
-
177
- @freeze_time('2024-06-15 12:00:00')
178
- def test_is_expired():
179
- obj = create_obj(expires_at=datetime(2024, 6, 14))
180
- assert obj.is_expired()
181
- ```
182
-
183
- ---
184
-
185
- ## 4. External Dependencies
186
-
187
- ### Description
188
-
189
- Tests call real networks, APIs, file system, or third-party services. Variability in response time, availability, or data causes flakiness.
190
-
191
- ### Signatures in Code
192
-
193
- - `fetch()`, `axios`, `http.get` without mocking
194
- - File system reads/writes (`fs`, `path`)
195
- - Environment variables that change by environment
196
- - Third-party SDKs (Stripe, SendGrid, etc.)
197
-
198
- ### Example (Flaky)
199
-
200
- ```typescript
201
- it('fetches weather', async () => {
202
- const res = await fetch('https://api.weather.com/current');
203
- const data = await res.json();
204
- expect(data.temp).toBeGreaterThan(-50); // Network may fail or timeout
205
- });
206
- ```
207
-
208
- ### Fix
209
-
210
- ```typescript
211
- it('fetches weather', async () => {
212
- const res = await fetch('/api/weather'); // Mocked in test env
213
- const data = await res.json();
214
- expect(data.temp).toBe(22); // Deterministic mock response
215
- });
216
- // Or: use MSW, nock, or jest.mock
217
- ```
218
-
219
- ### Example (File System — Flaky)
220
-
221
- ```python
222
- def test_read_config():
223
- with open('/tmp/app-config.json') as f: # May not exist or differ
224
- config = json.load(f)
225
- assert config['env'] == 'test'
226
- ```
227
-
228
- ### Fix
229
-
230
- ```python
231
- def test_read_config(tmp_path):
232
- config_file = tmp_path / 'config.json'
233
- config_file.write_text('{"env": "test"}')
234
- config = read_config(config_file)
235
- assert config['env'] == 'test'
236
- ```
237
-
238
- ---
239
-
240
- ## Quick Reference
241
-
242
- | Pattern | Detection | Fix Strategy |
243
- |---------|-----------|--------------|
244
- | Race condition | Async without await, no explicit wait | Add `await`, `waitForSelector`, `waitFor` |
245
- | Shared state | Globals, DB, files | `beforeEach` cleanup, isolate, transactional rollback |
246
- | Time-dependency | `Date`, `setTimeout` | `useFakeTimers`, `freezegun`, fixed dates |
247
- | External deps | HTTP, files, env | Mock, stub, fixtures, `tmp_path` |