agentic-qe 1.4.4 → 1.5.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 (390) hide show
  1. package/.claude/agents/qe-api-contract-validator.md +133 -27
  2. package/.claude/agents/qe-api-contract-validator.md.backup +1148 -0
  3. package/.claude/agents/qe-api-contract-validator.md.backup-20251107-134747 +1148 -0
  4. package/.claude/agents/qe-api-contract-validator.md.backup-phase2-20251107-140039 +1123 -0
  5. package/.claude/agents/qe-chaos-engineer.md +142 -23
  6. package/.claude/agents/qe-chaos-engineer.md.backup +808 -0
  7. package/.claude/agents/qe-chaos-engineer.md.backup-20251107-134747 +808 -0
  8. package/.claude/agents/qe-chaos-engineer.md.backup-phase2-20251107-140039 +787 -0
  9. package/.claude/agents/qe-code-complexity.md +111 -23
  10. package/.claude/agents/qe-code-complexity.md.backup +291 -0
  11. package/.claude/agents/qe-code-complexity.md.backup-20251107-134747 +291 -0
  12. package/.claude/agents/qe-code-complexity.md.backup-phase2-20251107-140039 +286 -0
  13. package/.claude/agents/qe-coverage-analyzer.md +306 -30
  14. package/.claude/agents/qe-coverage-analyzer.md.backup +467 -0
  15. package/.claude/agents/qe-coverage-analyzer.md.backup-20251107-134747 +467 -0
  16. package/.claude/agents/qe-coverage-analyzer.md.backup-phase2-20251107-140039 +438 -0
  17. package/.claude/agents/qe-deployment-readiness.md +84 -28
  18. package/.claude/agents/qe-deployment-readiness.md.backup +1166 -0
  19. package/.claude/agents/qe-deployment-readiness.md.backup-20251107-134747 +1166 -0
  20. package/.claude/agents/qe-deployment-readiness.md.backup-phase2-20251107-140039 +1140 -0
  21. package/.claude/agents/qe-flaky-test-hunter.md +277 -35
  22. package/.claude/agents/qe-flaky-test-hunter.md.backup +1195 -0
  23. package/.claude/agents/qe-flaky-test-hunter.md.backup-20251107-134747 +1195 -0
  24. package/.claude/agents/qe-flaky-test-hunter.md.backup-phase2-20251107-140039 +1162 -0
  25. package/.claude/agents/qe-fleet-commander.md +126 -23
  26. package/.claude/agents/qe-fleet-commander.md.backup +718 -0
  27. package/.claude/agents/qe-fleet-commander.md.backup-20251107-134747 +718 -0
  28. package/.claude/agents/qe-fleet-commander.md.backup-phase2-20251107-140039 +697 -0
  29. package/.claude/agents/qe-performance-tester.md +314 -57
  30. package/.claude/agents/qe-performance-tester.md.backup +428 -0
  31. package/.claude/agents/qe-performance-tester.md.backup-20251107-134747 +428 -0
  32. package/.claude/agents/qe-performance-tester.md.backup-phase2-20251107-140039 +372 -0
  33. package/.claude/agents/qe-production-intelligence.md +126 -27
  34. package/.claude/agents/qe-production-intelligence.md.backup +1219 -0
  35. package/.claude/agents/qe-production-intelligence.md.backup-20251107-134747 +1219 -0
  36. package/.claude/agents/qe-production-intelligence.md.backup-phase2-20251107-140039 +1194 -0
  37. package/.claude/agents/qe-quality-analyzer.md +127 -32
  38. package/.claude/agents/qe-quality-analyzer.md.backup +425 -0
  39. package/.claude/agents/qe-quality-analyzer.md.backup-20251107-134747 +425 -0
  40. package/.claude/agents/qe-quality-analyzer.md.backup-phase2-20251107-140039 +394 -0
  41. package/.claude/agents/qe-quality-gate.md +148 -33
  42. package/.claude/agents/qe-quality-gate.md.backup +446 -0
  43. package/.claude/agents/qe-quality-gate.md.backup-20251107-134747 +446 -0
  44. package/.claude/agents/qe-quality-gate.md.backup-phase2-20251107-140039 +415 -0
  45. package/.claude/agents/qe-regression-risk-analyzer.md +78 -27
  46. package/.claude/agents/qe-regression-risk-analyzer.md.backup +1009 -0
  47. package/.claude/agents/qe-regression-risk-analyzer.md.backup-20251107-134747 +1009 -0
  48. package/.claude/agents/qe-regression-risk-analyzer.md.backup-phase2-20251107-140039 +984 -0
  49. package/.claude/agents/qe-requirements-validator.md +131 -27
  50. package/.claude/agents/qe-requirements-validator.md.backup +748 -0
  51. package/.claude/agents/qe-requirements-validator.md.backup-20251107-134747 +748 -0
  52. package/.claude/agents/qe-requirements-validator.md.backup-phase2-20251107-140039 +723 -0
  53. package/.claude/agents/qe-security-scanner.md +137 -62
  54. package/.claude/agents/qe-security-scanner.md.backup +634 -0
  55. package/.claude/agents/qe-security-scanner.md.backup-20251107-134747 +634 -0
  56. package/.claude/agents/qe-security-scanner.md.backup-phase2-20251107-140039 +573 -0
  57. package/.claude/agents/qe-test-data-architect.md +129 -26
  58. package/.claude/agents/qe-test-data-architect.md.backup +1064 -0
  59. package/.claude/agents/qe-test-data-architect.md.backup-20251107-134747 +1064 -0
  60. package/.claude/agents/qe-test-data-architect.md.backup-phase2-20251107-140039 +1040 -0
  61. package/.claude/agents/qe-test-executor.md +165 -21
  62. package/.claude/agents/qe-test-executor.md.backup +389 -0
  63. package/.claude/agents/qe-test-executor.md.backup-20251107-134747 +389 -0
  64. package/.claude/agents/qe-test-executor.md.backup-phase2-20251107-140039 +369 -0
  65. package/.claude/agents/qe-test-generator.md +379 -34
  66. package/.claude/agents/qe-test-generator.md.backup +997 -0
  67. package/.claude/agents/qe-test-generator.md.backup-20251107-134747 +997 -0
  68. package/.claude/agents/qe-visual-tester.md +236 -23
  69. package/.claude/agents/qe-visual-tester.md.backup +777 -0
  70. package/.claude/agents/qe-visual-tester.md.backup-20251107-134747 +777 -0
  71. package/.claude/agents/qe-visual-tester.md.backup-phase2-20251107-140039 +756 -0
  72. package/.claude/agents/subagents/qe-code-reviewer.md +59 -0
  73. package/.claude/agents/subagents/qe-data-generator.md +60 -0
  74. package/.claude/agents/subagents/qe-integration-tester.md +77 -0
  75. package/.claude/agents/subagents/qe-performance-validator.md +55 -0
  76. package/.claude/agents/subagents/qe-security-auditor.md +51 -0
  77. package/.claude/agents/subagents/qe-test-implementer.md +371 -0
  78. package/.claude/agents/subagents/qe-test-refactorer.md +510 -0
  79. package/.claude/agents/subagents/qe-test-writer.md +603 -0
  80. package/.claude/skills/accessibility-testing/SKILL.md +764 -777
  81. package/.claude/skills/agentic-quality-engineering/SKILL.md +0 -6
  82. package/.claude/skills/api-testing-patterns/SKILL.md +0 -12
  83. package/.claude/skills/bug-reporting-excellence/SKILL.md +0 -6
  84. package/.claude/skills/chaos-engineering-resilience/SKILL.md +0 -6
  85. package/.claude/skills/code-review-quality/SKILL.md +0 -6
  86. package/.claude/skills/compatibility-testing/SKILL.md +0 -6
  87. package/.claude/skills/compliance-testing/SKILL.md +0 -6
  88. package/.claude/skills/consultancy-practices/SKILL.md +0 -6
  89. package/.claude/skills/context-driven-testing/SKILL.md +0 -6
  90. package/.claude/skills/contract-testing/SKILL.md +0 -6
  91. package/.claude/skills/database-testing/SKILL.md +0 -6
  92. package/.claude/skills/exploratory-testing-advanced/SKILL.md +0 -6
  93. package/.claude/skills/holistic-testing-pact/SKILL.md +0 -6
  94. package/.claude/skills/localization-testing/SKILL.md +0 -6
  95. package/.claude/skills/mobile-testing/SKILL.md +535 -548
  96. package/.claude/skills/mutation-testing/SKILL.md +0 -6
  97. package/.claude/skills/performance-testing/SKILL.md +0 -6
  98. package/.claude/skills/quality-metrics/SKILL.md +0 -12
  99. package/.claude/skills/refactoring-patterns/SKILL.md +0 -6
  100. package/.claude/skills/regression-testing/SKILL.md +1033 -1045
  101. package/.claude/skills/risk-based-testing/SKILL.md +0 -12
  102. package/.claude/skills/security-testing/SKILL.md +0 -6
  103. package/.claude/skills/shift-left-testing/SKILL.md +529 -535
  104. package/.claude/skills/shift-right-testing/SKILL.md +585 -591
  105. package/.claude/skills/tdd-london-chicago/SKILL.md +0 -6
  106. package/.claude/skills/technical-writing/SKILL.md +0 -6
  107. package/.claude/skills/test-automation-strategy/SKILL.md +0 -6
  108. package/.claude/skills/test-data-management/SKILL.md +1054 -1067
  109. package/.claude/skills/test-design-techniques/SKILL.md +0 -6
  110. package/.claude/skills/test-environment-management/SKILL.md +0 -6
  111. package/.claude/skills/test-reporting-analytics/SKILL.md +0 -6
  112. package/.claude/skills/visual-testing-advanced/SKILL.md +0 -6
  113. package/.claude/skills/xp-practices/SKILL.md +0 -6
  114. package/CHANGELOG.md +397 -5
  115. package/README.md +24 -19
  116. package/dist/cli/commands/init.d.ts +4 -0
  117. package/dist/cli/commands/init.d.ts.map +1 -1
  118. package/dist/cli/commands/init.js +97 -44
  119. package/dist/cli/commands/init.js.map +1 -1
  120. package/dist/mcp/handlers/coordination/index.d.ts +14 -14
  121. package/dist/mcp/handlers/coordination/index.d.ts.map +1 -1
  122. package/dist/mcp/handlers/coordination/index.js +14 -14
  123. package/dist/mcp/handlers/coordination/index.js.map +1 -1
  124. package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -1
  125. package/dist/mcp/handlers/phase2/Phase2Tools.js +39 -10
  126. package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -1
  127. package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts +63 -0
  128. package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts.map +1 -0
  129. package/dist/mcp/handlers/phase3/Phase3DomainTools.js +885 -0
  130. package/dist/mcp/handlers/phase3/Phase3DomainTools.js.map +1 -0
  131. package/dist/mcp/handlers/phase3/index.d.ts +6 -0
  132. package/dist/mcp/handlers/phase3/index.d.ts.map +1 -0
  133. package/dist/mcp/handlers/phase3/index.js +10 -0
  134. package/dist/mcp/handlers/phase3/index.js.map +1 -0
  135. package/dist/mcp/handlers/prediction/index.d.ts +10 -10
  136. package/dist/mcp/handlers/prediction/index.d.ts.map +1 -1
  137. package/dist/mcp/handlers/prediction/index.js +10 -10
  138. package/dist/mcp/handlers/prediction/index.js.map +1 -1
  139. package/dist/mcp/handlers/security/check-authz.d.ts +152 -0
  140. package/dist/mcp/handlers/security/check-authz.d.ts.map +1 -0
  141. package/dist/mcp/handlers/security/check-authz.js +434 -0
  142. package/dist/mcp/handlers/security/check-authz.js.map +1 -0
  143. package/dist/mcp/handlers/security/generate-report.d.ts +156 -0
  144. package/dist/mcp/handlers/security/generate-report.d.ts.map +1 -0
  145. package/dist/mcp/handlers/security/generate-report.js +469 -0
  146. package/dist/mcp/handlers/security/generate-report.js.map +1 -0
  147. package/dist/mcp/handlers/security/index.d.ts +80 -0
  148. package/dist/mcp/handlers/security/index.d.ts.map +1 -0
  149. package/dist/mcp/handlers/security/index.js +91 -0
  150. package/dist/mcp/handlers/security/index.js.map +1 -0
  151. package/dist/mcp/handlers/security/scan-comprehensive.d.ts +66 -0
  152. package/dist/mcp/handlers/security/scan-comprehensive.d.ts.map +1 -0
  153. package/dist/mcp/handlers/security/scan-comprehensive.js +296 -0
  154. package/dist/mcp/handlers/security/scan-comprehensive.js.map +1 -0
  155. package/dist/mcp/handlers/security/scan-dependencies.d.ts +148 -0
  156. package/dist/mcp/handlers/security/scan-dependencies.d.ts.map +1 -0
  157. package/dist/mcp/handlers/security/scan-dependencies.js +354 -0
  158. package/dist/mcp/handlers/security/scan-dependencies.js.map +1 -0
  159. package/dist/mcp/handlers/security/validate-auth.d.ts +128 -0
  160. package/dist/mcp/handlers/security/validate-auth.d.ts.map +1 -0
  161. package/dist/mcp/handlers/security/validate-auth.js +294 -0
  162. package/dist/mcp/handlers/security/validate-auth.js.map +1 -0
  163. package/dist/mcp/handlers/test/generate-integration-tests.d.ts +95 -0
  164. package/dist/mcp/handlers/test/generate-integration-tests.d.ts.map +1 -0
  165. package/dist/mcp/handlers/test/generate-integration-tests.js +286 -0
  166. package/dist/mcp/handlers/test/generate-integration-tests.js.map +1 -0
  167. package/dist/mcp/handlers/test/generate-unit-tests.d.ts +89 -0
  168. package/dist/mcp/handlers/test/generate-unit-tests.d.ts.map +1 -0
  169. package/dist/mcp/handlers/test/generate-unit-tests.js +273 -0
  170. package/dist/mcp/handlers/test/generate-unit-tests.js.map +1 -0
  171. package/dist/mcp/handlers/test/optimize-test-suite.d.ts +97 -0
  172. package/dist/mcp/handlers/test/optimize-test-suite.d.ts.map +1 -0
  173. package/dist/mcp/handlers/test/optimize-test-suite.js +282 -0
  174. package/dist/mcp/handlers/test/optimize-test-suite.js.map +1 -0
  175. package/dist/mcp/server.d.ts.map +1 -1
  176. package/dist/mcp/server.js +211 -0
  177. package/dist/mcp/server.js.map +1 -1
  178. package/dist/mcp/tools/deprecated.d.ts +1390 -0
  179. package/dist/mcp/tools/deprecated.d.ts.map +1 -0
  180. package/dist/mcp/tools/deprecated.js +859 -0
  181. package/dist/mcp/tools/deprecated.js.map +1 -0
  182. package/dist/mcp/tools/qe/api-contract/index.d.ts +138 -0
  183. package/dist/mcp/tools/qe/api-contract/index.d.ts.map +1 -0
  184. package/dist/mcp/tools/qe/api-contract/index.js +572 -0
  185. package/dist/mcp/tools/qe/api-contract/index.js.map +1 -0
  186. package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts +110 -0
  187. package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts.map +1 -0
  188. package/dist/mcp/tools/qe/code-quality/analyze-complexity.js +381 -0
  189. package/dist/mcp/tools/qe/code-quality/analyze-complexity.js.map +1 -0
  190. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts +115 -0
  191. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts.map +1 -0
  192. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js +461 -0
  193. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js.map +1 -0
  194. package/dist/mcp/tools/qe/code-quality/index.d.ts +12 -0
  195. package/dist/mcp/tools/qe/code-quality/index.d.ts.map +1 -0
  196. package/dist/mcp/tools/qe/code-quality/index.js +30 -0
  197. package/dist/mcp/tools/qe/code-quality/index.js.map +1 -0
  198. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts +58 -0
  199. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts.map +1 -0
  200. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js +172 -0
  201. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js.map +1 -0
  202. package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts +73 -0
  203. package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts.map +1 -0
  204. package/dist/mcp/tools/qe/coverage/calculate-trends.js +240 -0
  205. package/dist/mcp/tools/qe/coverage/calculate-trends.js.map +1 -0
  206. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts +38 -0
  207. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts.map +1 -0
  208. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js +204 -0
  209. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js.map +1 -0
  210. package/dist/mcp/tools/qe/coverage/index.d.ts +12 -0
  211. package/dist/mcp/tools/qe/coverage/index.d.ts.map +1 -0
  212. package/dist/mcp/tools/qe/coverage/index.js +23 -0
  213. package/dist/mcp/tools/qe/coverage/index.js.map +1 -0
  214. package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts +46 -0
  215. package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts.map +1 -0
  216. package/dist/mcp/tools/qe/coverage/recommend-tests.js +248 -0
  217. package/dist/mcp/tools/qe/coverage/recommend-tests.js.map +1 -0
  218. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts +179 -0
  219. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts.map +1 -0
  220. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js +554 -0
  221. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js.map +1 -0
  222. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts +172 -0
  223. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts.map +1 -0
  224. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js +498 -0
  225. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js.map +1 -0
  226. package/dist/mcp/tools/qe/flaky-detection/index.d.ts +35 -0
  227. package/dist/mcp/tools/qe/flaky-detection/index.d.ts.map +1 -0
  228. package/dist/mcp/tools/qe/flaky-detection/index.js +66 -0
  229. package/dist/mcp/tools/qe/flaky-detection/index.js.map +1 -0
  230. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts +159 -0
  231. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts.map +1 -0
  232. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js +462 -0
  233. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js.map +1 -0
  234. package/dist/mcp/tools/qe/fleet/index.d.ts +422 -0
  235. package/dist/mcp/tools/qe/fleet/index.d.ts.map +1 -0
  236. package/dist/mcp/tools/qe/fleet/index.js +652 -0
  237. package/dist/mcp/tools/qe/fleet/index.js.map +1 -0
  238. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts +180 -0
  239. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts.map +1 -0
  240. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js +347 -0
  241. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js.map +1 -0
  242. package/dist/mcp/tools/qe/performance/generate-report.d.ts +146 -0
  243. package/dist/mcp/tools/qe/performance/generate-report.d.ts.map +1 -0
  244. package/dist/mcp/tools/qe/performance/generate-report.js +354 -0
  245. package/dist/mcp/tools/qe/performance/generate-report.js.map +1 -0
  246. package/dist/mcp/tools/qe/performance/index.d.ts +13 -0
  247. package/dist/mcp/tools/qe/performance/index.d.ts.map +1 -0
  248. package/dist/mcp/tools/qe/performance/index.js +24 -0
  249. package/dist/mcp/tools/qe/performance/index.js.map +1 -0
  250. package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts +120 -0
  251. package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts.map +1 -0
  252. package/dist/mcp/tools/qe/performance/monitor-realtime.js +215 -0
  253. package/dist/mcp/tools/qe/performance/monitor-realtime.js.map +1 -0
  254. package/dist/mcp/tools/qe/performance/run-benchmark.d.ts +68 -0
  255. package/dist/mcp/tools/qe/performance/run-benchmark.d.ts.map +1 -0
  256. package/dist/mcp/tools/qe/performance/run-benchmark.js +120 -0
  257. package/dist/mcp/tools/qe/performance/run-benchmark.js.map +1 -0
  258. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts +239 -0
  259. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts.map +1 -0
  260. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js +671 -0
  261. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js.map +1 -0
  262. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts +219 -0
  263. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts.map +1 -0
  264. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js +732 -0
  265. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js.map +1 -0
  266. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts +447 -0
  267. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts.map +1 -0
  268. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js +551 -0
  269. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js.map +1 -0
  270. package/dist/mcp/tools/qe/quality-gates/index.d.ts +40 -0
  271. package/dist/mcp/tools/qe/quality-gates/index.d.ts.map +1 -0
  272. package/dist/mcp/tools/qe/quality-gates/index.js +56 -0
  273. package/dist/mcp/tools/qe/quality-gates/index.js.map +1 -0
  274. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts +226 -0
  275. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts.map +1 -0
  276. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js +603 -0
  277. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js.map +1 -0
  278. package/dist/mcp/tools/qe/regression/analyze-risk.d.ts +212 -0
  279. package/dist/mcp/tools/qe/regression/analyze-risk.d.ts.map +1 -0
  280. package/dist/mcp/tools/qe/regression/analyze-risk.js +617 -0
  281. package/dist/mcp/tools/qe/regression/analyze-risk.js.map +1 -0
  282. package/dist/mcp/tools/qe/regression/index.d.ts +36 -0
  283. package/dist/mcp/tools/qe/regression/index.d.ts.map +1 -0
  284. package/dist/mcp/tools/qe/regression/index.js +63 -0
  285. package/dist/mcp/tools/qe/regression/index.js.map +1 -0
  286. package/dist/mcp/tools/qe/regression/select-tests.d.ts +241 -0
  287. package/dist/mcp/tools/qe/regression/select-tests.d.ts.map +1 -0
  288. package/dist/mcp/tools/qe/regression/select-tests.js +601 -0
  289. package/dist/mcp/tools/qe/regression/select-tests.js.map +1 -0
  290. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts +134 -0
  291. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts.map +1 -0
  292. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js +737 -0
  293. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js.map +1 -0
  294. package/dist/mcp/tools/qe/requirements/index.d.ts +40 -0
  295. package/dist/mcp/tools/qe/requirements/index.d.ts.map +1 -0
  296. package/dist/mcp/tools/qe/requirements/index.js +84 -0
  297. package/dist/mcp/tools/qe/requirements/index.js.map +1 -0
  298. package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts +196 -0
  299. package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts.map +1 -0
  300. package/dist/mcp/tools/qe/requirements/validate-requirements.js +740 -0
  301. package/dist/mcp/tools/qe/requirements/validate-requirements.js.map +1 -0
  302. package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts +300 -0
  303. package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts.map +1 -0
  304. package/dist/mcp/tools/qe/security/detect-vulnerabilities.js +492 -0
  305. package/dist/mcp/tools/qe/security/detect-vulnerabilities.js.map +1 -0
  306. package/dist/mcp/tools/qe/security/index.d.ts +34 -0
  307. package/dist/mcp/tools/qe/security/index.d.ts.map +1 -0
  308. package/dist/mcp/tools/qe/security/index.js +44 -0
  309. package/dist/mcp/tools/qe/security/index.js.map +1 -0
  310. package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts +240 -0
  311. package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts.map +1 -0
  312. package/dist/mcp/tools/qe/security/scan-comprehensive.js +535 -0
  313. package/dist/mcp/tools/qe/security/scan-comprehensive.js.map +1 -0
  314. package/dist/mcp/tools/qe/security/validate-compliance.d.ts +299 -0
  315. package/dist/mcp/tools/qe/security/validate-compliance.d.ts.map +1 -0
  316. package/dist/mcp/tools/qe/security/validate-compliance.js +517 -0
  317. package/dist/mcp/tools/qe/security/validate-compliance.js.map +1 -0
  318. package/dist/mcp/tools/qe/shared/types.d.ts +840 -0
  319. package/dist/mcp/tools/qe/shared/types.d.ts.map +1 -0
  320. package/dist/mcp/tools/qe/shared/types.js +13 -0
  321. package/dist/mcp/tools/qe/shared/types.js.map +1 -0
  322. package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts +264 -0
  323. package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts.map +1 -0
  324. package/dist/mcp/tools/qe/test-data/analyze-schema.js +553 -0
  325. package/dist/mcp/tools/qe/test-data/analyze-schema.js.map +1 -0
  326. package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts +167 -0
  327. package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts.map +1 -0
  328. package/dist/mcp/tools/qe/test-data/generate-test-data.js +336 -0
  329. package/dist/mcp/tools/qe/test-data/generate-test-data.js.map +1 -0
  330. package/dist/mcp/tools/qe/test-data/index.d.ts +44 -0
  331. package/dist/mcp/tools/qe/test-data/index.d.ts.map +1 -0
  332. package/dist/mcp/tools/qe/test-data/index.js +90 -0
  333. package/dist/mcp/tools/qe/test-data/index.js.map +1 -0
  334. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts +165 -0
  335. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts.map +1 -0
  336. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js +342 -0
  337. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js.map +1 -0
  338. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts +144 -0
  339. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts.map +1 -0
  340. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js +432 -0
  341. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js.map +1 -0
  342. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts +98 -0
  343. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts.map +1 -0
  344. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js +459 -0
  345. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js.map +1 -0
  346. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts +83 -0
  347. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts.map +1 -0
  348. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js +483 -0
  349. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js.map +1 -0
  350. package/dist/mcp/tools/qe/test-generation/index.d.ts +56 -0
  351. package/dist/mcp/tools/qe/test-generation/index.d.ts.map +1 -0
  352. package/dist/mcp/tools/qe/test-generation/index.js +97 -0
  353. package/dist/mcp/tools/qe/test-generation/index.js.map +1 -0
  354. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts +124 -0
  355. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts.map +1 -0
  356. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js +362 -0
  357. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js.map +1 -0
  358. package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts +119 -0
  359. package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts.map +1 -0
  360. package/dist/mcp/tools/qe/visual/compare-screenshots.js +280 -0
  361. package/dist/mcp/tools/qe/visual/compare-screenshots.js.map +1 -0
  362. package/dist/mcp/tools/qe/visual/detect-regression.d.ts +138 -0
  363. package/dist/mcp/tools/qe/visual/detect-regression.d.ts.map +1 -0
  364. package/dist/mcp/tools/qe/visual/detect-regression.js +271 -0
  365. package/dist/mcp/tools/qe/visual/detect-regression.js.map +1 -0
  366. package/dist/mcp/tools/qe/visual/index.d.ts +16 -0
  367. package/dist/mcp/tools/qe/visual/index.d.ts.map +1 -0
  368. package/dist/mcp/tools/qe/visual/index.js +22 -0
  369. package/dist/mcp/tools/qe/visual/index.js.map +1 -0
  370. package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts +276 -0
  371. package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts.map +1 -0
  372. package/dist/mcp/tools/qe/visual/validate-accessibility.js +413 -0
  373. package/dist/mcp/tools/qe/visual/validate-accessibility.js.map +1 -0
  374. package/dist/mcp/tools.d.ts +44 -0
  375. package/dist/mcp/tools.d.ts.map +1 -1
  376. package/dist/mcp/tools.js +1980 -1
  377. package/dist/mcp/tools.js.map +1 -1
  378. package/package.json +2 -2
  379. package/dist/learning/__mocks__/LearningEngine.d.ts +0 -39
  380. package/dist/learning/__mocks__/LearningEngine.d.ts.map +0 -1
  381. package/dist/learning/__mocks__/LearningEngine.js +0 -116
  382. package/dist/learning/__mocks__/LearningEngine.js.map +0 -1
  383. package/dist/utils/__mocks__/Database.d.ts +0 -85
  384. package/dist/utils/__mocks__/Database.d.ts.map +0 -1
  385. package/dist/utils/__mocks__/Database.js +0 -125
  386. package/dist/utils/__mocks__/Database.js.map +0 -1
  387. package/dist/utils/__mocks__/Logger.d.ts +0 -26
  388. package/dist/utils/__mocks__/Logger.d.ts.map +0 -1
  389. package/dist/utils/__mocks__/Logger.js +0 -44
  390. package/dist/utils/__mocks__/Logger.js.map +0 -1
@@ -0,0 +1,603 @@
1
+ ---
2
+ name: qe-test-writer
3
+ role: specialized-subagent
4
+ parent_agent: qe-test-generator
5
+ phase: RED
6
+ color: red
7
+ priority: critical
8
+ description: "Specialized subagent for writing failing tests in TDD RED phase - generates comprehensive test cases that define expected behavior before implementation"
9
+ capabilities:
10
+ - failing-test-generation
11
+ - behavior-specification
12
+ - test-case-design
13
+ - assertion-definition
14
+ - boundary-analysis
15
+ coordination:
16
+ protocol: aqe-hooks
17
+ parent_delegation: true
18
+ metadata:
19
+ version: "1.0.0"
20
+ tdd_phase: "RED"
21
+ frameworks: ["jest", "mocha", "vitest", "playwright"]
22
+ parent_agents: ["qe-test-generator", "qe-quality-gate"]
23
+ ---
24
+
25
+ # Test Writer Subagent - TDD RED Phase
26
+
27
+ ## Mission Statement
28
+
29
+ The **Test Writer** subagent specializes in the RED phase of Test-Driven Development, crafting precise, failing tests that define expected behavior before implementation. This subagent transforms requirements into executable specifications, creating comprehensive test cases that guide development through clear assertions and boundary conditions.
30
+
31
+ ## Role in TDD Workflow
32
+
33
+ ### RED Phase Focus
34
+
35
+ **Primary Responsibility**: Write tests that FAIL initially, defining expected behavior.
36
+
37
+ **Workflow Position**:
38
+ ```
39
+ ┌─────────────────────────────────────────────────────────┐
40
+ │ TDD Cycle │
41
+ ├─────────────────────────────────────────────────────────┤
42
+ │ │
43
+ │ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
44
+ │ │ RED │ --> │ GREEN │ --> │ REFACTOR │ │
45
+ │ │ (Write │ │ (Make │ │ (Improve │ │
46
+ │ │ Test) │ │ Pass) │ │ Code) │ │
47
+ │ └──────────┘ └──────────┘ └──────────────┘ │
48
+ │ ▲ │
49
+ │ │ │
50
+ │ qe-test-writer (YOU ARE HERE) │
51
+ │ │
52
+ └─────────────────────────────────────────────────────────┘
53
+ ```
54
+
55
+ ## Parent Agent Delegation
56
+
57
+ ### Invoked By Parent Agents
58
+
59
+ **Primary Parent**: `qe-test-generator`
60
+ - Delegates test case generation
61
+ - Provides requirements and specifications
62
+ - Receives failing test suite
63
+
64
+ **Secondary Parent**: `qe-quality-gate`
65
+ - Requests coverage improvement
66
+ - Validates test quality standards
67
+
68
+ ### Delegation Protocol
69
+
70
+ ```typescript
71
+ // Parent agent delegates to test-writer subagent
72
+ interface TestWriterDelegation {
73
+ type: 'write-failing-tests';
74
+ requirements: {
75
+ module: string;
76
+ functionality: string;
77
+ acceptance_criteria: string[];
78
+ edge_cases: string[];
79
+ };
80
+ constraints: {
81
+ framework: 'jest' | 'mocha' | 'vitest' | 'playwright';
82
+ coverage_target: number;
83
+ test_types: ('unit' | 'integration' | 'e2e')[];
84
+ };
85
+ coordination: {
86
+ memory_key: string; // Where to store results
87
+ callback_event: string; // Event to emit on completion
88
+ };
89
+ }
90
+
91
+ // Example delegation from parent
92
+ await this.delegateToSubagent('qe-test-writer', {
93
+ type: 'write-failing-tests',
94
+ requirements: {
95
+ module: 'src/services/user-authentication.ts',
96
+ functionality: 'User login with OAuth2',
97
+ acceptance_criteria: [
98
+ 'Should authenticate user with valid OAuth2 token',
99
+ 'Should reject expired tokens',
100
+ 'Should handle network failures gracefully'
101
+ ],
102
+ edge_cases: [
103
+ 'Token expires during authentication',
104
+ 'Multiple simultaneous login attempts',
105
+ 'Malformed token format'
106
+ ]
107
+ },
108
+ constraints: {
109
+ framework: 'jest',
110
+ coverage_target: 0.95,
111
+ test_types: ['unit', 'integration']
112
+ },
113
+ coordination: {
114
+ memory_key: 'aqe/test-writer/authentication-tests',
115
+ callback_event: 'test-writer:tests-generated'
116
+ }
117
+ });
118
+ ```
119
+
120
+ ## Core Capabilities
121
+
122
+ ### 1. Failing Test Generation
123
+
124
+ Generate tests that MUST fail initially (RED phase requirement).
125
+
126
+ **Test Generation Strategy**:
127
+ ```javascript
128
+ class TestWriterSubagent {
129
+ async generateFailingTests(requirements) {
130
+ // Step 1: Analyze requirements
131
+ const testCases = this.analyzeRequirements(requirements);
132
+
133
+ // Step 2: Design test structure
134
+ const testSuite = this.designTestSuite(testCases);
135
+
136
+ // Step 3: Generate failing tests
137
+ const tests = this.generateTests(testSuite, { expectFailure: true });
138
+
139
+ // Step 4: Validate tests fail correctly
140
+ await this.validateRedPhase(tests);
141
+
142
+ return tests;
143
+ }
144
+
145
+ generateTests(testSuite, options) {
146
+ return testSuite.map(testCase => {
147
+ // Generate test that calls non-existent implementation
148
+ return this.createFailingTest({
149
+ name: testCase.name,
150
+ given: testCase.preconditions,
151
+ when: testCase.action,
152
+ then: testCase.expectedOutcome,
153
+ // Implementation doesn't exist yet - test WILL fail
154
+ implementation: undefined
155
+ });
156
+ });
157
+ }
158
+
159
+ async validateRedPhase(tests) {
160
+ // Critical: Tests MUST fail in RED phase
161
+ const results = await this.runTests(tests);
162
+
163
+ if (results.some(r => r.passed)) {
164
+ throw new Error(
165
+ 'RED phase violation: Tests must fail initially. ' +
166
+ 'Found passing tests - implementation may already exist.'
167
+ );
168
+ }
169
+
170
+ return {
171
+ redPhaseValid: true,
172
+ failingTests: results.length,
173
+ message: 'All tests failing as expected (RED phase complete)'
174
+ };
175
+ }
176
+ }
177
+ ```
178
+
179
+ ### 2. Behavior Specification
180
+
181
+ Translate requirements into precise test specifications using Given-When-Then.
182
+
183
+ **Specification Pattern**:
184
+ ```javascript
185
+ // Generate behavior-driven test specifications
186
+ function generateBehaviorSpec(requirement) {
187
+ return {
188
+ feature: requirement.functionality,
189
+ scenario: requirement.acceptance_criteria,
190
+
191
+ // Given-When-Then pattern
192
+ given: `Given a ${requirement.context}`,
193
+ when: `When ${requirement.action}`,
194
+ then: `Then ${requirement.expected_outcome}`,
195
+
196
+ // Test structure
197
+ test: `
198
+ describe('${requirement.functionality}', () => {
199
+ test('${requirement.scenario}', async () => {
200
+ // GIVEN: Setup preconditions
201
+ ${generateSetupCode(requirement.context)}
202
+
203
+ // WHEN: Execute action
204
+ ${generateActionCode(requirement.action)}
205
+
206
+ // THEN: Verify outcome
207
+ ${generateAssertionCode(requirement.expected_outcome)}
208
+ });
209
+ });
210
+ `
211
+ };
212
+ }
213
+ ```
214
+
215
+ **Example Output** (Jest):
216
+ ```javascript
217
+ describe('User Authentication - OAuth2 Login', () => {
218
+ test('should authenticate user with valid OAuth2 token', async () => {
219
+ // GIVEN: A valid OAuth2 token
220
+ const validToken = generateValidOAuth2Token({
221
+ userId: 'user-123',
222
+ expiresIn: 3600,
223
+ scope: ['read', 'write']
224
+ });
225
+
226
+ // WHEN: User attempts to authenticate
227
+ const result = await authService.authenticateWithOAuth2(validToken);
228
+
229
+ // THEN: Authentication succeeds with user session
230
+ expect(result).toMatchObject({
231
+ success: true,
232
+ sessionId: expect.any(String),
233
+ userId: 'user-123',
234
+ expiresAt: expect.any(Date)
235
+ });
236
+ expect(result.sessionId).toHaveLength(64); // UUID format
237
+ });
238
+
239
+ test('should reject expired OAuth2 token', async () => {
240
+ // GIVEN: An expired OAuth2 token
241
+ const expiredToken = generateExpiredOAuth2Token({
242
+ userId: 'user-123',
243
+ expiredSince: -3600 // Expired 1 hour ago
244
+ });
245
+
246
+ // WHEN: User attempts to authenticate
247
+ const result = await authService.authenticateWithOAuth2(expiredToken);
248
+
249
+ // THEN: Authentication fails with expiration error
250
+ expect(result).toMatchObject({
251
+ success: false,
252
+ error: 'TOKEN_EXPIRED',
253
+ message: expect.stringContaining('expired')
254
+ });
255
+ });
256
+
257
+ test('should handle network failures gracefully', async () => {
258
+ // GIVEN: Network connection will fail during OAuth2 validation
259
+ mockNetworkFailure({
260
+ endpoint: '/oauth2/validate',
261
+ error: 'ECONNREFUSED'
262
+ });
263
+
264
+ // WHEN: User attempts to authenticate
265
+ const result = await authService.authenticateWithOAuth2(validToken);
266
+
267
+ // THEN: Returns network error without crashing
268
+ expect(result).toMatchObject({
269
+ success: false,
270
+ error: 'NETWORK_ERROR',
271
+ retryable: true
272
+ });
273
+ expect(result.message).toContain('network');
274
+ });
275
+ });
276
+ ```
277
+
278
+ ### 3. Assertion Definition
279
+
280
+ Define precise assertions that verify expected behavior.
281
+
282
+ **Assertion Strategies**:
283
+ ```javascript
284
+ class AssertionDefiner {
285
+ defineAssertions(expectedOutcome) {
286
+ return {
287
+ // Value assertions
288
+ exact: this.exactValueAssertion(expectedOutcome),
289
+
290
+ // Type assertions
291
+ type: this.typeAssertion(expectedOutcome),
292
+
293
+ // Structure assertions
294
+ structure: this.structureAssertion(expectedOutcome),
295
+
296
+ // Behavior assertions
297
+ behavior: this.behaviorAssertion(expectedOutcome),
298
+
299
+ // Boundary assertions
300
+ boundaries: this.boundaryAssertion(expectedOutcome)
301
+ };
302
+ }
303
+
304
+ exactValueAssertion(outcome) {
305
+ return `expect(result).toBe(${JSON.stringify(outcome)});`;
306
+ }
307
+
308
+ typeAssertion(outcome) {
309
+ const type = typeof outcome;
310
+ return `expect(result).toEqual(expect.any(${capitalize(type)}));`;
311
+ }
312
+
313
+ structureAssertion(outcome) {
314
+ if (typeof outcome === 'object') {
315
+ return `expect(result).toMatchObject(${JSON.stringify(outcome, null, 2)});`;
316
+ }
317
+ return null;
318
+ }
319
+
320
+ behaviorAssertion(outcome) {
321
+ return {
322
+ called: `expect(mockFn).toHaveBeenCalled();`,
323
+ calledWith: `expect(mockFn).toHaveBeenCalledWith(${outcome.args});`,
324
+ callCount: `expect(mockFn).toHaveBeenCalledTimes(${outcome.count});`
325
+ };
326
+ }
327
+
328
+ boundaryAssertion(outcome) {
329
+ return {
330
+ min: `expect(result).toBeGreaterThanOrEqual(${outcome.min});`,
331
+ max: `expect(result).toBeLessThanOrEqual(${outcome.max});`,
332
+ range: `expect(result).toBeInRange(${outcome.min}, ${outcome.max});`
333
+ };
334
+ }
335
+ }
336
+ ```
337
+
338
+ ### 4. Boundary Analysis
339
+
340
+ Identify and test boundary conditions and edge cases.
341
+
342
+ **Boundary Test Generation**:
343
+ ```javascript
344
+ class BoundaryAnalyzer {
345
+ generateBoundaryTests(parameter) {
346
+ const boundaries = this.identifyBoundaries(parameter);
347
+
348
+ return boundaries.map(boundary => ({
349
+ name: `should handle ${boundary.description}`,
350
+ input: boundary.value,
351
+ expected: boundary.expectedBehavior,
352
+ category: boundary.category
353
+ }));
354
+ }
355
+
356
+ identifyBoundaries(parameter) {
357
+ const boundaries = [];
358
+
359
+ if (parameter.type === 'number') {
360
+ boundaries.push(
361
+ { value: parameter.min - 1, description: 'below minimum', category: 'invalid' },
362
+ { value: parameter.min, description: 'minimum value', category: 'boundary' },
363
+ { value: parameter.min + 1, description: 'above minimum', category: 'valid' },
364
+ { value: parameter.max - 1, description: 'below maximum', category: 'valid' },
365
+ { value: parameter.max, description: 'maximum value', category: 'boundary' },
366
+ { value: parameter.max + 1, description: 'above maximum', category: 'invalid' }
367
+ );
368
+ }
369
+
370
+ if (parameter.type === 'string') {
371
+ boundaries.push(
372
+ { value: '', description: 'empty string', category: 'boundary' },
373
+ { value: 'a', description: 'single character', category: 'valid' },
374
+ { value: 'a'.repeat(parameter.maxLength), description: 'maximum length', category: 'boundary' },
375
+ { value: 'a'.repeat(parameter.maxLength + 1), description: 'exceeds maximum', category: 'invalid' }
376
+ );
377
+ }
378
+
379
+ if (parameter.type === 'array') {
380
+ boundaries.push(
381
+ { value: [], description: 'empty array', category: 'boundary' },
382
+ { value: [1], description: 'single element', category: 'valid' },
383
+ { value: Array(parameter.maxItems).fill(1), description: 'maximum items', category: 'boundary' }
384
+ );
385
+ }
386
+
387
+ return boundaries;
388
+ }
389
+ }
390
+ ```
391
+
392
+ **Example Boundary Tests**:
393
+ ```javascript
394
+ describe('Pagination - Boundary Tests', () => {
395
+ test('should reject page number below minimum (0)', async () => {
396
+ const result = await paginate({ page: 0, size: 10 });
397
+ expect(result.error).toBe('INVALID_PAGE');
398
+ });
399
+
400
+ test('should accept minimum page number (1)', async () => {
401
+ const result = await paginate({ page: 1, size: 10 });
402
+ expect(result.success).toBe(true);
403
+ });
404
+
405
+ test('should accept page size at minimum (1)', async () => {
406
+ const result = await paginate({ page: 1, size: 1 });
407
+ expect(result.success).toBe(true);
408
+ expect(result.items).toHaveLength(1);
409
+ });
410
+
411
+ test('should accept page size at maximum (100)', async () => {
412
+ const result = await paginate({ page: 1, size: 100 });
413
+ expect(result.success).toBe(true);
414
+ expect(result.items).toHaveLength(expect.toBeWithinRange(1, 100));
415
+ });
416
+
417
+ test('should reject page size above maximum (101)', async () => {
418
+ const result = await paginate({ page: 1, size: 101 });
419
+ expect(result.error).toBe('INVALID_PAGE_SIZE');
420
+ });
421
+ });
422
+ ```
423
+
424
+ ## Integration with Parent Agents
425
+
426
+ ### Memory Coordination
427
+
428
+ **Input from Parent** (Read):
429
+ ```typescript
430
+ // Parent stores requirements
431
+ await this.memoryStore.store('aqe/test-writer/task', {
432
+ module: 'src/services/payment.ts',
433
+ requirements: [...],
434
+ framework: 'jest'
435
+ }, { partition: 'coordination' });
436
+ ```
437
+
438
+ **Output to Parent** (Write):
439
+ ```typescript
440
+ // Subagent stores generated tests
441
+ await this.memoryStore.store('aqe/test-writer/results', {
442
+ testsGenerated: 15,
443
+ testFiles: [
444
+ { path: 'tests/payment.test.ts', content: '...' }
445
+ ],
446
+ redPhaseValidated: true,
447
+ allTestsFailing: true
448
+ }, { partition: 'coordination' });
449
+
450
+ // Emit completion event
451
+ this.eventBus.emit('test-writer:completed', {
452
+ agentId: this.agentId,
453
+ testsGenerated: 15,
454
+ nextPhase: 'GREEN'
455
+ });
456
+ ```
457
+
458
+ ### Lifecycle Hooks
459
+
460
+ ```typescript
461
+ protected async onPreTask(data: { assignment: TaskAssignment }): Promise<void> {
462
+ // Load requirements from parent
463
+ const task = await this.memoryStore.retrieve('aqe/test-writer/task', {
464
+ partition: 'coordination'
465
+ });
466
+
467
+ this.logger.info('Test Writer starting RED phase', {
468
+ module: task.module,
469
+ framework: task.framework
470
+ });
471
+ }
472
+
473
+ protected async onPostTask(data: { assignment: TaskAssignment; result: any }): Promise<void> {
474
+ // Store results for parent agent
475
+ await this.memoryStore.store('aqe/test-writer/results', data.result, {
476
+ partition: 'coordination',
477
+ ttl: 86400
478
+ });
479
+
480
+ // Validate RED phase completion
481
+ if (!data.result.allTestsFailing) {
482
+ this.logger.error('RED phase validation failed - some tests passing');
483
+ }
484
+
485
+ this.logger.info('Test Writer completed', {
486
+ testsGenerated: data.result.testsGenerated,
487
+ redPhaseValid: data.result.redPhaseValidated
488
+ });
489
+ }
490
+ ```
491
+
492
+ ## Success Criteria
493
+
494
+ ### RED Phase Validation
495
+
496
+ **Tests MUST**:
497
+ - ✅ All fail initially (no passing tests)
498
+ - ✅ Have clear, descriptive names
499
+ - ✅ Follow Given-When-Then structure
500
+ - ✅ Include boundary tests
501
+ - ✅ Cover all acceptance criteria
502
+
503
+ **Tests MUST NOT**:
504
+ - ❌ Pass before implementation exists
505
+ - ❌ Have vague assertions (e.g., `expect(result).toBeTruthy()`)
506
+ - ❌ Test implementation details
507
+ - ❌ Have external dependencies without mocks
508
+
509
+ ## Example Complete Output
510
+
511
+ ```javascript
512
+ // Generated by qe-test-writer subagent
513
+ // TDD RED Phase - All tests MUST fail initially
514
+ // Module: src/services/payment.ts
515
+
516
+ describe('Payment Service - Process Payment', () => {
517
+ beforeEach(() => {
518
+ // Setup test fixtures
519
+ jest.clearAllMocks();
520
+ });
521
+
522
+ // Acceptance Criteria 1: Process valid payment
523
+ test('should process payment with valid card', async () => {
524
+ // GIVEN: Valid payment details
525
+ const payment = {
526
+ amount: 99.99,
527
+ currency: 'USD',
528
+ card: {
529
+ number: '4111111111111111',
530
+ expiry: '12/25',
531
+ cvv: '123'
532
+ }
533
+ };
534
+
535
+ // WHEN: Processing payment
536
+ const result = await paymentService.processPayment(payment);
537
+
538
+ // THEN: Payment succeeds with transaction ID
539
+ expect(result).toMatchObject({
540
+ success: true,
541
+ transactionId: expect.any(String),
542
+ amount: 99.99,
543
+ status: 'COMPLETED'
544
+ });
545
+ });
546
+
547
+ // Boundary Test: Minimum amount
548
+ test('should accept minimum payment amount (0.01)', async () => {
549
+ const payment = createPayment({ amount: 0.01 });
550
+ const result = await paymentService.processPayment(payment);
551
+ expect(result.success).toBe(true);
552
+ });
553
+
554
+ // Boundary Test: Zero amount (invalid)
555
+ test('should reject zero amount payment', async () => {
556
+ const payment = createPayment({ amount: 0 });
557
+ const result = await paymentService.processPayment(payment);
558
+ expect(result.error).toBe('INVALID_AMOUNT');
559
+ });
560
+
561
+ // Edge Case: Network timeout
562
+ test('should handle payment gateway timeout', async () => {
563
+ mockPaymentGatewayTimeout();
564
+ const payment = createPayment({ amount: 50.00 });
565
+
566
+ const result = await paymentService.processPayment(payment);
567
+
568
+ expect(result).toMatchObject({
569
+ success: false,
570
+ error: 'GATEWAY_TIMEOUT',
571
+ retryable: true
572
+ });
573
+ });
574
+ });
575
+
576
+ // Expected Result: ALL TESTS FAIL (implementation doesn't exist yet)
577
+ // Next Step: qe-test-implementer will make these tests pass (GREEN phase)
578
+ ```
579
+
580
+ ## Commands
581
+
582
+ ```bash
583
+ # Parent agent delegates to subagent
584
+ aqe subagent delegate qe-test-writer \
585
+ --task write-failing-tests \
586
+ --module src/services/authentication.ts \
587
+ --framework jest
588
+
589
+ # Validate RED phase
590
+ aqe subagent validate qe-test-writer \
591
+ --phase RED \
592
+ --expect-failures all
593
+
594
+ # Check subagent status
595
+ aqe subagent status qe-test-writer
596
+ ```
597
+
598
+ ---
599
+
600
+ **Subagent Status**: Active
601
+ **Parent Agents**: qe-test-generator, qe-quality-gate
602
+ **TDD Phase**: RED (Write Failing Tests)
603
+ **Version**: 1.0.0