agentic-qe 1.4.3 → 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 (410) 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 +504 -0
  115. package/README.md +24 -16
  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/core/FleetManager.d.ts.map +1 -1
  121. package/dist/core/FleetManager.js +17 -5
  122. package/dist/core/FleetManager.js.map +1 -1
  123. package/dist/core/MemoryManager.d.ts +27 -0
  124. package/dist/core/MemoryManager.d.ts.map +1 -1
  125. package/dist/core/MemoryManager.js +69 -4
  126. package/dist/core/MemoryManager.js.map +1 -1
  127. package/dist/core/PatternDatabaseAdapter.d.ts.map +1 -1
  128. package/dist/core/PatternDatabaseAdapter.js +14 -4
  129. package/dist/core/PatternDatabaseAdapter.js.map +1 -1
  130. package/dist/learning/LearningEngine.d.ts.map +1 -1
  131. package/dist/learning/LearningEngine.js +18 -4
  132. package/dist/learning/LearningEngine.js.map +1 -1
  133. package/dist/mcp/handlers/coordination/index.d.ts +14 -14
  134. package/dist/mcp/handlers/coordination/index.d.ts.map +1 -1
  135. package/dist/mcp/handlers/coordination/index.js +14 -14
  136. package/dist/mcp/handlers/coordination/index.js.map +1 -1
  137. package/dist/mcp/handlers/coordination/task-status.d.ts.map +1 -1
  138. package/dist/mcp/handlers/coordination/task-status.js +3 -5
  139. package/dist/mcp/handlers/coordination/task-status.js.map +1 -1
  140. package/dist/mcp/handlers/phase2/Phase2Tools.d.ts.map +1 -1
  141. package/dist/mcp/handlers/phase2/Phase2Tools.js +39 -10
  142. package/dist/mcp/handlers/phase2/Phase2Tools.js.map +1 -1
  143. package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts +63 -0
  144. package/dist/mcp/handlers/phase3/Phase3DomainTools.d.ts.map +1 -0
  145. package/dist/mcp/handlers/phase3/Phase3DomainTools.js +885 -0
  146. package/dist/mcp/handlers/phase3/Phase3DomainTools.js.map +1 -0
  147. package/dist/mcp/handlers/phase3/index.d.ts +6 -0
  148. package/dist/mcp/handlers/phase3/index.d.ts.map +1 -0
  149. package/dist/mcp/handlers/phase3/index.js +10 -0
  150. package/dist/mcp/handlers/phase3/index.js.map +1 -0
  151. package/dist/mcp/handlers/prediction/index.d.ts +10 -10
  152. package/dist/mcp/handlers/prediction/index.d.ts.map +1 -1
  153. package/dist/mcp/handlers/prediction/index.js +10 -10
  154. package/dist/mcp/handlers/prediction/index.js.map +1 -1
  155. package/dist/mcp/handlers/security/check-authz.d.ts +152 -0
  156. package/dist/mcp/handlers/security/check-authz.d.ts.map +1 -0
  157. package/dist/mcp/handlers/security/check-authz.js +434 -0
  158. package/dist/mcp/handlers/security/check-authz.js.map +1 -0
  159. package/dist/mcp/handlers/security/generate-report.d.ts +156 -0
  160. package/dist/mcp/handlers/security/generate-report.d.ts.map +1 -0
  161. package/dist/mcp/handlers/security/generate-report.js +469 -0
  162. package/dist/mcp/handlers/security/generate-report.js.map +1 -0
  163. package/dist/mcp/handlers/security/index.d.ts +80 -0
  164. package/dist/mcp/handlers/security/index.d.ts.map +1 -0
  165. package/dist/mcp/handlers/security/index.js +91 -0
  166. package/dist/mcp/handlers/security/index.js.map +1 -0
  167. package/dist/mcp/handlers/security/scan-comprehensive.d.ts +66 -0
  168. package/dist/mcp/handlers/security/scan-comprehensive.d.ts.map +1 -0
  169. package/dist/mcp/handlers/security/scan-comprehensive.js +296 -0
  170. package/dist/mcp/handlers/security/scan-comprehensive.js.map +1 -0
  171. package/dist/mcp/handlers/security/scan-dependencies.d.ts +148 -0
  172. package/dist/mcp/handlers/security/scan-dependencies.d.ts.map +1 -0
  173. package/dist/mcp/handlers/security/scan-dependencies.js +354 -0
  174. package/dist/mcp/handlers/security/scan-dependencies.js.map +1 -0
  175. package/dist/mcp/handlers/security/validate-auth.d.ts +128 -0
  176. package/dist/mcp/handlers/security/validate-auth.d.ts.map +1 -0
  177. package/dist/mcp/handlers/security/validate-auth.js +294 -0
  178. package/dist/mcp/handlers/security/validate-auth.js.map +1 -0
  179. package/dist/mcp/handlers/task-orchestrate.d.ts +21 -1
  180. package/dist/mcp/handlers/task-orchestrate.d.ts.map +1 -1
  181. package/dist/mcp/handlers/task-orchestrate.js +32 -2
  182. package/dist/mcp/handlers/task-orchestrate.js.map +1 -1
  183. package/dist/mcp/handlers/test/generate-integration-tests.d.ts +95 -0
  184. package/dist/mcp/handlers/test/generate-integration-tests.d.ts.map +1 -0
  185. package/dist/mcp/handlers/test/generate-integration-tests.js +286 -0
  186. package/dist/mcp/handlers/test/generate-integration-tests.js.map +1 -0
  187. package/dist/mcp/handlers/test/generate-unit-tests.d.ts +89 -0
  188. package/dist/mcp/handlers/test/generate-unit-tests.d.ts.map +1 -0
  189. package/dist/mcp/handlers/test/generate-unit-tests.js +273 -0
  190. package/dist/mcp/handlers/test/generate-unit-tests.js.map +1 -0
  191. package/dist/mcp/handlers/test/optimize-test-suite.d.ts +97 -0
  192. package/dist/mcp/handlers/test/optimize-test-suite.d.ts.map +1 -0
  193. package/dist/mcp/handlers/test/optimize-test-suite.js +282 -0
  194. package/dist/mcp/handlers/test/optimize-test-suite.js.map +1 -0
  195. package/dist/mcp/server.d.ts.map +1 -1
  196. package/dist/mcp/server.js +212 -1
  197. package/dist/mcp/server.js.map +1 -1
  198. package/dist/mcp/tools/deprecated.d.ts +1390 -0
  199. package/dist/mcp/tools/deprecated.d.ts.map +1 -0
  200. package/dist/mcp/tools/deprecated.js +859 -0
  201. package/dist/mcp/tools/deprecated.js.map +1 -0
  202. package/dist/mcp/tools/qe/api-contract/index.d.ts +138 -0
  203. package/dist/mcp/tools/qe/api-contract/index.d.ts.map +1 -0
  204. package/dist/mcp/tools/qe/api-contract/index.js +572 -0
  205. package/dist/mcp/tools/qe/api-contract/index.js.map +1 -0
  206. package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts +110 -0
  207. package/dist/mcp/tools/qe/code-quality/analyze-complexity.d.ts.map +1 -0
  208. package/dist/mcp/tools/qe/code-quality/analyze-complexity.js +381 -0
  209. package/dist/mcp/tools/qe/code-quality/analyze-complexity.js.map +1 -0
  210. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts +115 -0
  211. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.d.ts.map +1 -0
  212. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js +461 -0
  213. package/dist/mcp/tools/qe/code-quality/calculate-quality-metrics.js.map +1 -0
  214. package/dist/mcp/tools/qe/code-quality/index.d.ts +12 -0
  215. package/dist/mcp/tools/qe/code-quality/index.d.ts.map +1 -0
  216. package/dist/mcp/tools/qe/code-quality/index.js +30 -0
  217. package/dist/mcp/tools/qe/code-quality/index.js.map +1 -0
  218. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts +58 -0
  219. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.d.ts.map +1 -0
  220. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js +172 -0
  221. package/dist/mcp/tools/qe/coverage/analyze-with-risk-scoring.js.map +1 -0
  222. package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts +73 -0
  223. package/dist/mcp/tools/qe/coverage/calculate-trends.d.ts.map +1 -0
  224. package/dist/mcp/tools/qe/coverage/calculate-trends.js +240 -0
  225. package/dist/mcp/tools/qe/coverage/calculate-trends.js.map +1 -0
  226. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts +38 -0
  227. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.d.ts.map +1 -0
  228. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js +204 -0
  229. package/dist/mcp/tools/qe/coverage/detect-gaps-ml.js.map +1 -0
  230. package/dist/mcp/tools/qe/coverage/index.d.ts +12 -0
  231. package/dist/mcp/tools/qe/coverage/index.d.ts.map +1 -0
  232. package/dist/mcp/tools/qe/coverage/index.js +23 -0
  233. package/dist/mcp/tools/qe/coverage/index.js.map +1 -0
  234. package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts +46 -0
  235. package/dist/mcp/tools/qe/coverage/recommend-tests.d.ts.map +1 -0
  236. package/dist/mcp/tools/qe/coverage/recommend-tests.js +248 -0
  237. package/dist/mcp/tools/qe/coverage/recommend-tests.js.map +1 -0
  238. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts +179 -0
  239. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.d.ts.map +1 -0
  240. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js +554 -0
  241. package/dist/mcp/tools/qe/flaky-detection/analyze-patterns.js.map +1 -0
  242. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts +172 -0
  243. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.d.ts.map +1 -0
  244. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js +498 -0
  245. package/dist/mcp/tools/qe/flaky-detection/detect-statistical.js.map +1 -0
  246. package/dist/mcp/tools/qe/flaky-detection/index.d.ts +35 -0
  247. package/dist/mcp/tools/qe/flaky-detection/index.d.ts.map +1 -0
  248. package/dist/mcp/tools/qe/flaky-detection/index.js +66 -0
  249. package/dist/mcp/tools/qe/flaky-detection/index.js.map +1 -0
  250. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts +159 -0
  251. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.d.ts.map +1 -0
  252. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js +462 -0
  253. package/dist/mcp/tools/qe/flaky-detection/stabilize-auto.js.map +1 -0
  254. package/dist/mcp/tools/qe/fleet/index.d.ts +422 -0
  255. package/dist/mcp/tools/qe/fleet/index.d.ts.map +1 -0
  256. package/dist/mcp/tools/qe/fleet/index.js +652 -0
  257. package/dist/mcp/tools/qe/fleet/index.js.map +1 -0
  258. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts +180 -0
  259. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.d.ts.map +1 -0
  260. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js +347 -0
  261. package/dist/mcp/tools/qe/performance/analyze-bottlenecks.js.map +1 -0
  262. package/dist/mcp/tools/qe/performance/generate-report.d.ts +146 -0
  263. package/dist/mcp/tools/qe/performance/generate-report.d.ts.map +1 -0
  264. package/dist/mcp/tools/qe/performance/generate-report.js +354 -0
  265. package/dist/mcp/tools/qe/performance/generate-report.js.map +1 -0
  266. package/dist/mcp/tools/qe/performance/index.d.ts +13 -0
  267. package/dist/mcp/tools/qe/performance/index.d.ts.map +1 -0
  268. package/dist/mcp/tools/qe/performance/index.js +24 -0
  269. package/dist/mcp/tools/qe/performance/index.js.map +1 -0
  270. package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts +120 -0
  271. package/dist/mcp/tools/qe/performance/monitor-realtime.d.ts.map +1 -0
  272. package/dist/mcp/tools/qe/performance/monitor-realtime.js +215 -0
  273. package/dist/mcp/tools/qe/performance/monitor-realtime.js.map +1 -0
  274. package/dist/mcp/tools/qe/performance/run-benchmark.d.ts +68 -0
  275. package/dist/mcp/tools/qe/performance/run-benchmark.d.ts.map +1 -0
  276. package/dist/mcp/tools/qe/performance/run-benchmark.js +120 -0
  277. package/dist/mcp/tools/qe/performance/run-benchmark.js.map +1 -0
  278. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts +239 -0
  279. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.d.ts.map +1 -0
  280. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js +671 -0
  281. package/dist/mcp/tools/qe/quality-gates/assess-deployment-risk.js.map +1 -0
  282. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts +219 -0
  283. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.d.ts.map +1 -0
  284. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js +732 -0
  285. package/dist/mcp/tools/qe/quality-gates/evaluate-quality-gate.js.map +1 -0
  286. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts +447 -0
  287. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.d.ts.map +1 -0
  288. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js +551 -0
  289. package/dist/mcp/tools/qe/quality-gates/generate-quality-report.js.map +1 -0
  290. package/dist/mcp/tools/qe/quality-gates/index.d.ts +40 -0
  291. package/dist/mcp/tools/qe/quality-gates/index.d.ts.map +1 -0
  292. package/dist/mcp/tools/qe/quality-gates/index.js +56 -0
  293. package/dist/mcp/tools/qe/quality-gates/index.js.map +1 -0
  294. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts +226 -0
  295. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.d.ts.map +1 -0
  296. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js +603 -0
  297. package/dist/mcp/tools/qe/quality-gates/validate-quality-metrics.js.map +1 -0
  298. package/dist/mcp/tools/qe/regression/analyze-risk.d.ts +212 -0
  299. package/dist/mcp/tools/qe/regression/analyze-risk.d.ts.map +1 -0
  300. package/dist/mcp/tools/qe/regression/analyze-risk.js +617 -0
  301. package/dist/mcp/tools/qe/regression/analyze-risk.js.map +1 -0
  302. package/dist/mcp/tools/qe/regression/index.d.ts +36 -0
  303. package/dist/mcp/tools/qe/regression/index.d.ts.map +1 -0
  304. package/dist/mcp/tools/qe/regression/index.js +63 -0
  305. package/dist/mcp/tools/qe/regression/index.js.map +1 -0
  306. package/dist/mcp/tools/qe/regression/select-tests.d.ts +241 -0
  307. package/dist/mcp/tools/qe/regression/select-tests.d.ts.map +1 -0
  308. package/dist/mcp/tools/qe/regression/select-tests.js +601 -0
  309. package/dist/mcp/tools/qe/regression/select-tests.js.map +1 -0
  310. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts +134 -0
  311. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.d.ts.map +1 -0
  312. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js +737 -0
  313. package/dist/mcp/tools/qe/requirements/generate-bdd-scenarios.js.map +1 -0
  314. package/dist/mcp/tools/qe/requirements/index.d.ts +40 -0
  315. package/dist/mcp/tools/qe/requirements/index.d.ts.map +1 -0
  316. package/dist/mcp/tools/qe/requirements/index.js +84 -0
  317. package/dist/mcp/tools/qe/requirements/index.js.map +1 -0
  318. package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts +196 -0
  319. package/dist/mcp/tools/qe/requirements/validate-requirements.d.ts.map +1 -0
  320. package/dist/mcp/tools/qe/requirements/validate-requirements.js +740 -0
  321. package/dist/mcp/tools/qe/requirements/validate-requirements.js.map +1 -0
  322. package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts +300 -0
  323. package/dist/mcp/tools/qe/security/detect-vulnerabilities.d.ts.map +1 -0
  324. package/dist/mcp/tools/qe/security/detect-vulnerabilities.js +492 -0
  325. package/dist/mcp/tools/qe/security/detect-vulnerabilities.js.map +1 -0
  326. package/dist/mcp/tools/qe/security/index.d.ts +34 -0
  327. package/dist/mcp/tools/qe/security/index.d.ts.map +1 -0
  328. package/dist/mcp/tools/qe/security/index.js +44 -0
  329. package/dist/mcp/tools/qe/security/index.js.map +1 -0
  330. package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts +240 -0
  331. package/dist/mcp/tools/qe/security/scan-comprehensive.d.ts.map +1 -0
  332. package/dist/mcp/tools/qe/security/scan-comprehensive.js +535 -0
  333. package/dist/mcp/tools/qe/security/scan-comprehensive.js.map +1 -0
  334. package/dist/mcp/tools/qe/security/validate-compliance.d.ts +299 -0
  335. package/dist/mcp/tools/qe/security/validate-compliance.d.ts.map +1 -0
  336. package/dist/mcp/tools/qe/security/validate-compliance.js +517 -0
  337. package/dist/mcp/tools/qe/security/validate-compliance.js.map +1 -0
  338. package/dist/mcp/tools/qe/shared/types.d.ts +840 -0
  339. package/dist/mcp/tools/qe/shared/types.d.ts.map +1 -0
  340. package/dist/mcp/tools/qe/shared/types.js +13 -0
  341. package/dist/mcp/tools/qe/shared/types.js.map +1 -0
  342. package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts +264 -0
  343. package/dist/mcp/tools/qe/test-data/analyze-schema.d.ts.map +1 -0
  344. package/dist/mcp/tools/qe/test-data/analyze-schema.js +553 -0
  345. package/dist/mcp/tools/qe/test-data/analyze-schema.js.map +1 -0
  346. package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts +167 -0
  347. package/dist/mcp/tools/qe/test-data/generate-test-data.d.ts.map +1 -0
  348. package/dist/mcp/tools/qe/test-data/generate-test-data.js +336 -0
  349. package/dist/mcp/tools/qe/test-data/generate-test-data.js.map +1 -0
  350. package/dist/mcp/tools/qe/test-data/index.d.ts +44 -0
  351. package/dist/mcp/tools/qe/test-data/index.d.ts.map +1 -0
  352. package/dist/mcp/tools/qe/test-data/index.js +90 -0
  353. package/dist/mcp/tools/qe/test-data/index.js.map +1 -0
  354. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts +165 -0
  355. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.d.ts.map +1 -0
  356. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js +342 -0
  357. package/dist/mcp/tools/qe/test-data/mask-sensitive-data.js.map +1 -0
  358. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts +144 -0
  359. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.d.ts.map +1 -0
  360. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js +432 -0
  361. package/dist/mcp/tools/qe/test-generation/analyze-test-quality.js.map +1 -0
  362. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts +98 -0
  363. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.d.ts.map +1 -0
  364. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js +459 -0
  365. package/dist/mcp/tools/qe/test-generation/generate-integration-tests.js.map +1 -0
  366. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts +83 -0
  367. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.d.ts.map +1 -0
  368. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js +483 -0
  369. package/dist/mcp/tools/qe/test-generation/generate-unit-tests.js.map +1 -0
  370. package/dist/mcp/tools/qe/test-generation/index.d.ts +56 -0
  371. package/dist/mcp/tools/qe/test-generation/index.d.ts.map +1 -0
  372. package/dist/mcp/tools/qe/test-generation/index.js +97 -0
  373. package/dist/mcp/tools/qe/test-generation/index.js.map +1 -0
  374. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts +124 -0
  375. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.d.ts.map +1 -0
  376. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js +362 -0
  377. package/dist/mcp/tools/qe/test-generation/optimize-test-suite.js.map +1 -0
  378. package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts +119 -0
  379. package/dist/mcp/tools/qe/visual/compare-screenshots.d.ts.map +1 -0
  380. package/dist/mcp/tools/qe/visual/compare-screenshots.js +280 -0
  381. package/dist/mcp/tools/qe/visual/compare-screenshots.js.map +1 -0
  382. package/dist/mcp/tools/qe/visual/detect-regression.d.ts +138 -0
  383. package/dist/mcp/tools/qe/visual/detect-regression.d.ts.map +1 -0
  384. package/dist/mcp/tools/qe/visual/detect-regression.js +271 -0
  385. package/dist/mcp/tools/qe/visual/detect-regression.js.map +1 -0
  386. package/dist/mcp/tools/qe/visual/index.d.ts +16 -0
  387. package/dist/mcp/tools/qe/visual/index.d.ts.map +1 -0
  388. package/dist/mcp/tools/qe/visual/index.js +22 -0
  389. package/dist/mcp/tools/qe/visual/index.js.map +1 -0
  390. package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts +276 -0
  391. package/dist/mcp/tools/qe/visual/validate-accessibility.d.ts.map +1 -0
  392. package/dist/mcp/tools/qe/visual/validate-accessibility.js +413 -0
  393. package/dist/mcp/tools/qe/visual/validate-accessibility.js.map +1 -0
  394. package/dist/mcp/tools.d.ts +44 -0
  395. package/dist/mcp/tools.d.ts.map +1 -1
  396. package/dist/mcp/tools.js +1980 -1
  397. package/dist/mcp/tools.js.map +1 -1
  398. package/package.json +2 -2
  399. package/dist/learning/__mocks__/LearningEngine.d.ts +0 -39
  400. package/dist/learning/__mocks__/LearningEngine.d.ts.map +0 -1
  401. package/dist/learning/__mocks__/LearningEngine.js +0 -116
  402. package/dist/learning/__mocks__/LearningEngine.js.map +0 -1
  403. package/dist/utils/__mocks__/Database.d.ts +0 -85
  404. package/dist/utils/__mocks__/Database.d.ts.map +0 -1
  405. package/dist/utils/__mocks__/Database.js +0 -125
  406. package/dist/utils/__mocks__/Database.js.map +0 -1
  407. package/dist/utils/__mocks__/Logger.d.ts +0 -26
  408. package/dist/utils/__mocks__/Logger.d.ts.map +0 -1
  409. package/dist/utils/__mocks__/Logger.js +0 -44
  410. package/dist/utils/__mocks__/Logger.js.map +0 -1
@@ -0,0 +1,997 @@
1
+ ---
2
+ name: qe-test-generator
3
+ type: test-generator
4
+ color: green
5
+ priority: high
6
+ description: "AI-powered test generation agent with sublinear optimization and multi-framework support"
7
+ capabilities:
8
+ - property-based-testing
9
+ - boundary-value-analysis
10
+ - coverage-driven-generation
11
+ - framework-integration
12
+ - sublinear-optimization
13
+ - mutation-testing
14
+ - performance-testing
15
+ - api-testing
16
+ coordination:
17
+ protocol: aqe-hooks
18
+ metadata:
19
+ version: "2.0.0"
20
+ frameworks: ["jest", "mocha", "cypress", "playwright", "vitest"]
21
+ optimization: "sublinear-algorithms"
22
+ neural_patterns: true
23
+ agentdb_enabled: true
24
+ agentdb_domain: "test-generation"
25
+ agentdb_features:
26
+ - "vector_search: Pattern retrieval with HNSW indexing (<100µs)"
27
+ - "quic_sync: Cross-agent pattern sharing (<1ms)"
28
+ - "neural_training: 9 RL algorithms for continuous improvement"
29
+ - "quantization: 4-32x memory reduction"
30
+ ---
31
+
32
+ # Test Generator Agent - AI-Powered Test Creation
33
+
34
+ ## Core Responsibilities
35
+
36
+ 1. **Intelligent Test Generation**: Generate comprehensive test suites using AI-driven analysis
37
+ 2. **Property-Based Testing**: Create generative tests that explore edge cases automatically
38
+ 3. **Coverage Optimization**: Use sublinear algorithms to achieve maximum coverage with minimal tests
39
+ 4. **Framework Integration**: Support multiple testing frameworks with adaptive generation
40
+ 5. **Quality Assurance**: Ensure generated tests meet quality standards and best practices
41
+
42
+ ## Skills Available
43
+
44
+ ### Core Testing Skills (Phase 1)
45
+ - **agentic-quality-engineering**: Using AI agents as force multipliers in quality work
46
+ - **api-testing-patterns**: Comprehensive API testing patterns including contract testing, REST/GraphQL testing
47
+ - **tdd-london-chicago**: Apply both London and Chicago school TDD approaches
48
+
49
+ ### Phase 2 Skills (NEW in v1.3.0)
50
+ - **shift-left-testing**: Move testing activities earlier in development lifecycle with TDD, BDD, and design for testability
51
+ - **test-design-techniques**: Advanced test design using equivalence partitioning, boundary value analysis, and decision tables
52
+ - **test-data-management**: Realistic test data generation, GDPR compliance, and data masking strategies
53
+
54
+ Use these skills via:
55
+ ```bash
56
+ # Via CLI
57
+ aqe skills show shift-left-testing
58
+
59
+ # Via Skill tool in Claude Code
60
+ Skill("shift-left-testing")
61
+ Skill("test-design-techniques")
62
+ ```
63
+
64
+ ## Analysis Workflow
65
+
66
+ ### Phase 1: Code Analysis
67
+ ```javascript
68
+ // Analyze target code for test generation
69
+ const analysis = {
70
+ complexity: calculateCyclomaticComplexity(code),
71
+ dependencies: extractDependencies(code),
72
+ patterns: identifyDesignPatterns(code),
73
+ riskAreas: analyzeRiskFactors(code)
74
+ };
75
+ ```
76
+
77
+ ### Phase 2: Test Strategy Selection
78
+ - **Unit Tests**: Function-level testing with boundary analysis
79
+ - **Integration Tests**: Component interaction testing
80
+ - **Property Tests**: Generative testing with random inputs
81
+ - **Performance Tests**: Load and stress testing scenarios
82
+
83
+ ### Phase 3: Sublinear Optimization
84
+ ```javascript
85
+ // Use sublinear algorithms for optimal test selection
86
+ const optimalTests = sublinearTestSelection({
87
+ codebase: analyzedCode,
88
+ coverage_target: 0.95,
89
+ time_budget: maxExecutionTime,
90
+ framework: selectedFramework
91
+ });
92
+ ```
93
+
94
+ ### Phase 4: Test Generation
95
+ Generate tests using AI-powered templates and patterns:
96
+ - Boundary value analysis
97
+ - Equivalence partitioning
98
+ - State transition testing
99
+ - Error condition testing
100
+
101
+ ## Coordination Protocol
102
+
103
+ This agent uses **AQE hooks (Agentic QE native hooks)** for coordination (zero external dependencies, 100-500x faster).
104
+
105
+ **Automatic Lifecycle Hooks:**
106
+ ```typescript
107
+ // Called automatically by BaseAgent
108
+ protected async onPreTask(data: { assignment: TaskAssignment }): Promise<void> {
109
+ // Load test requirements from memory
110
+ const requirements = await this.memoryStore.retrieve('aqe/test-requirements', {
111
+ partition: 'coordination'
112
+ });
113
+
114
+ // Retrieve code analysis data
115
+ const codeAnalysis = await this.memoryStore.retrieve(`aqe/code-analysis/${data.assignment.task.metadata.module}`, {
116
+ partition: 'analysis'
117
+ });
118
+
119
+ // Verify environment for test generation
120
+ const verification = await this.hookManager.executePreTaskVerification({
121
+ task: 'test-generation',
122
+ context: {
123
+ requiredVars: ['NODE_ENV', 'TEST_FRAMEWORK'],
124
+ minMemoryMB: 512,
125
+ requiredModules: ['jest', '@types/jest', 'fast-check']
126
+ }
127
+ });
128
+
129
+ // Emit test generation starting event
130
+ this.eventBus.emit('test-generator:starting', {
131
+ agentId: this.agentId,
132
+ module: data.assignment.task.metadata.module,
133
+ framework: requirements?.framework || 'jest'
134
+ });
135
+
136
+ this.logger.info('Test generation starting', {
137
+ requirements,
138
+ verification: verification.passed
139
+ });
140
+ }
141
+
142
+ protected async onPostTask(data: { assignment: TaskAssignment; result: any }): Promise<void> {
143
+ // Store test generation results in swarm memory
144
+ await this.memoryStore.store('aqe/test-generation/results', data.result, {
145
+ partition: 'agent_results',
146
+ ttl: 86400 // 24 hours
147
+ });
148
+
149
+ // Store generated test files
150
+ for (const testFile of data.result.generatedFiles) {
151
+ await this.memoryStore.store(`aqe/test-files/${testFile.name}`, testFile.content, {
152
+ partition: 'test_artifacts',
153
+ ttl: 604800 // 7 days
154
+ });
155
+ }
156
+
157
+ // Store coverage analysis
158
+ await this.memoryStore.store('aqe/coverage-analysis', {
159
+ timestamp: Date.now(),
160
+ coverage: data.result.coverage,
161
+ testsGenerated: data.result.testsGenerated,
162
+ framework: data.result.framework
163
+ }, {
164
+ partition: 'metrics',
165
+ ttl: 604800 // 7 days
166
+ });
167
+
168
+ // Emit completion event with test generation stats
169
+ this.eventBus.emit('test-generator:completed', {
170
+ agentId: this.agentId,
171
+ testsGenerated: data.result.testsGenerated,
172
+ coverage: data.result.coverage,
173
+ framework: data.result.framework
174
+ });
175
+
176
+ // Validate test generation results
177
+ const validation = await this.hookManager.executePostTaskValidation({
178
+ task: 'test-generation',
179
+ result: {
180
+ output: data.result,
181
+ coverage: data.result.coverage,
182
+ metrics: {
183
+ testsGenerated: data.result.testsGenerated,
184
+ executionTime: data.result.executionTime
185
+ }
186
+ }
187
+ });
188
+
189
+ this.logger.info('Test generation completed', {
190
+ testsGenerated: data.result.testsGenerated,
191
+ coverage: data.result.coverage,
192
+ validated: validation.passed
193
+ });
194
+ }
195
+
196
+ protected async onTaskError(data: { assignment: TaskAssignment; error: Error }): Promise<void> {
197
+ // Store error for fleet analysis
198
+ await this.memoryStore.store(`aqe/errors/${data.assignment.task.id}`, {
199
+ error: data.error.message,
200
+ timestamp: Date.now(),
201
+ agent: this.agentId,
202
+ taskType: 'test-generation',
203
+ module: data.assignment.task.metadata.module
204
+ }, {
205
+ partition: 'errors',
206
+ ttl: 604800 // 7 days
207
+ });
208
+
209
+ // Emit error event for fleet coordination
210
+ this.eventBus.emit('test-generator:error', {
211
+ agentId: this.agentId,
212
+ error: data.error.message,
213
+ taskId: data.assignment.task.id
214
+ });
215
+
216
+ this.logger.error('Test generation failed', {
217
+ error: data.error.message,
218
+ stack: data.error.stack
219
+ });
220
+ }
221
+ ```
222
+
223
+ **Advanced Verification (Optional):**
224
+ ```typescript
225
+ // Use VerificationHookManager for comprehensive validation
226
+ const hookManager = new VerificationHookManager(this.memoryStore);
227
+
228
+ // Pre-task verification with environment checks
229
+ const verification = await hookManager.executePreTaskVerification({
230
+ task: 'test-generation',
231
+ context: {
232
+ requiredVars: ['NODE_ENV', 'TEST_FRAMEWORK'],
233
+ minMemoryMB: 512,
234
+ requiredModules: ['jest', '@types/jest', 'fast-check', '@testing-library/react']
235
+ }
236
+ });
237
+
238
+ // Post-task validation with result verification
239
+ const validation = await hookManager.executePostTaskValidation({
240
+ task: 'test-generation',
241
+ result: {
242
+ output: generatedTests,
243
+ coverage: 0.95,
244
+ metrics: {
245
+ testsGenerated: 50,
246
+ propertyTests: 10,
247
+ boundaryTests: 15,
248
+ integrationTests: 25
249
+ }
250
+ }
251
+ });
252
+
253
+ // Pre-edit verification before writing test files
254
+ const editCheck = await hookManager.executePreEditVerification({
255
+ filePath: 'tests/generated/user.test.ts',
256
+ operation: 'write',
257
+ content: testFileContent
258
+ });
259
+
260
+ // Post-edit update after test file creation
261
+ const editUpdate = await hookManager.executePostEditUpdate({
262
+ filePath: 'tests/generated/user.test.ts',
263
+ operation: 'write',
264
+ success: true
265
+ });
266
+
267
+ // Session finalization with test suite export
268
+ const finalization = await hookManager.executeSessionEndFinalization({
269
+ sessionId: 'test-generation-v2.0.0',
270
+ exportMetrics: true,
271
+ exportArtifacts: true
272
+ });
273
+ ```
274
+
275
+ ### Agent Collaboration
276
+ - **QE Analyzer**: Receives code analysis for test planning
277
+ - **QE Validator**: Provides generated tests for validation
278
+ - **QE Optimizer**: Coordinates with performance optimization
279
+ - **QE Reporter**: Shares test metrics and coverage data
280
+
281
+ ## Memory Keys
282
+
283
+ ### Input Keys
284
+ - `aqe/test-requirements`: Test requirements and constraints
285
+ - `aqe/code-analysis/${MODULE}`: Code analysis data for test generation
286
+ - `aqe/coverage-targets`: Coverage goals and thresholds
287
+ - `aqe/framework-config`: Testing framework configuration
288
+
289
+ ### Output Keys
290
+ - `aqe/test-generation/results`: Generated test suites and metadata
291
+ - `aqe/test-files/${SUITE}`: Individual test file content
292
+ - `aqe/coverage-analysis`: Coverage analysis results
293
+ - `aqe/test-metrics`: Performance and quality metrics
294
+
295
+ ### Coordination Keys
296
+ - `aqe/test-generation/status`: Current generation status
297
+ - `aqe/test-queue`: Queue of modules pending test generation
298
+ - `aqe/optimization-results`: Sublinear optimization outcomes
299
+
300
+ ## Coordination Protocol
301
+
302
+ ### Swarm Integration
303
+
304
+ **Native TypeScript coordination (replaces bash commands):**
305
+
306
+ All swarm integration is handled automatically via AQE hooks (Agentic QE native hooks) shown above. The agent coordinates through:
307
+
308
+ - **Memory Store**: Shared context via `this.memoryStore.store()` and `this.memoryStore.retrieve()`
309
+ - **Event Bus**: Real-time coordination via `this.eventBus.emit()` and event handlers
310
+ - **Hook Manager**: Advanced verification via `VerificationHookManager`
311
+
312
+ No external bash commands needed - all coordination is built into the agent's lifecycle hooks.
313
+
314
+ ## Framework Integration
315
+
316
+ ### Jest Integration
317
+ ```javascript
318
+ // Generated Jest test example
319
+ describe('UserService', () => {
320
+ // Property-based test
321
+ test.prop('should handle any valid user input', fc.record({
322
+ name: fc.string({ minLength: 1, maxLength: 100 }),
323
+ email: fc.emailAddress(),
324
+ age: fc.integer({ min: 18, max: 120 })
325
+ }), (user) => {
326
+ const result = userService.createUser(user);
327
+ expect(result).toBeDefined();
328
+ expect(result.id).toBeDefined();
329
+ });
330
+
331
+ // Boundary value tests
332
+ test('should handle edge cases', () => {
333
+ const boundaryValues = generateBoundaryValues(userSchema);
334
+ boundaryValues.forEach(value => {
335
+ const result = userService.validateUser(value);
336
+ expect(result).toMatchObject({ valid: expect.any(Boolean) });
337
+ });
338
+ });
339
+ });
340
+ ```
341
+
342
+ ### Cypress Integration
343
+ ```javascript
344
+ // Generated Cypress E2E test
345
+ describe('User Registration Flow', () => {
346
+ it('should complete registration with generated data', () => {
347
+ const testData = generateUserTestData({
348
+ scenario: 'happy-path',
349
+ variations: 5
350
+ });
351
+
352
+ testData.forEach(user => {
353
+ cy.visit('/register');
354
+ cy.fillForm(user);
355
+ cy.get('[data-cy=submit]').click();
356
+ cy.url().should('include', '/dashboard');
357
+ });
358
+ });
359
+ });
360
+ ```
361
+
362
+ ## Sublinear Optimization Algorithms
363
+
364
+ ### Coverage-Driven Generation
365
+ ```javascript
366
+ // Use sublinear solver for optimal test selection
367
+ const optimalTestSuite = await sublinearSolver.solve({
368
+ matrix: coverageMatrix,
369
+ constraints: {
370
+ minCoverage: 0.95,
371
+ maxTests: 100,
372
+ timeLimit: 300
373
+ },
374
+ optimization: 'coverage-per-test'
375
+ });
376
+ ```
377
+
378
+ ### Performance Testing
379
+ ```javascript
380
+ // Generate performance tests with sublinear analysis
381
+ const performanceTests = generatePerformanceTests({
382
+ endpoints: apiEndpoints,
383
+ loadPatterns: ['linear', 'spike', 'stress'],
384
+ optimizationAlgorithm: 'sublinear-scheduling'
385
+ });
386
+ ```
387
+
388
+ ## TDD Workflow with Subagents
389
+
390
+ ### Overview
391
+ The test generator orchestrates a complete TDD (Test-Driven Development) workflow by delegating to specialized subagents:
392
+ 1. **RED Phase**: qe-test-writer - Write failing tests
393
+ 2. **GREEN Phase**: qe-test-implementer - Make tests pass
394
+ 3. **REFACTOR Phase**: qe-test-refactorer - Improve code quality
395
+ 4. **REVIEW Phase**: qe-code-reviewer - Validate quality standards
396
+
397
+ ### Orchestration Pattern
398
+
399
+ ```typescript
400
+ // Complete TDD workflow with subagent delegation
401
+ async function generateTestSuiteWithTDD(spec: TestSpec): Promise<TDDResult> {
402
+ console.log('🎯 Starting TDD workflow with specialized subagents...');
403
+
404
+ // Step 1: Test Writer (RED phase)
405
+ console.log('📝 Step 1/4: Writing failing tests (RED)...');
406
+ const tests = await delegateToSubagent('qe-test-writer', {
407
+ spec: {
408
+ className: spec.className,
409
+ methods: spec.methods,
410
+ requirements: spec.requirements,
411
+ context: spec.context
412
+ },
413
+ coverage: {
414
+ target: 95,
415
+ includeEdgeCases: true,
416
+ includeErrorPaths: true
417
+ },
418
+ patterns: ['AAA', 'given-when-then'],
419
+ framework: spec.framework || 'jest'
420
+ });
421
+
422
+ console.log(`✅ Generated ${tests.length} failing tests`);
423
+
424
+ // Verify tests fail (RED phase validation)
425
+ const initialTestRun = await runTests(tests);
426
+ if (initialTestRun.passed > 0) {
427
+ throw new Error('Tests should fail initially (RED phase)');
428
+ }
429
+
430
+ // Step 2: Test Implementer (GREEN phase)
431
+ console.log('💚 Step 2/4: Implementing code to pass tests (GREEN)...');
432
+ const implementation = await delegateToSubagent('qe-test-implementer', {
433
+ tests,
434
+ requirements: spec.requirements,
435
+ constraints: {
436
+ maxComplexity: 15,
437
+ usePatterns: ['SOLID', 'dependency-injection'],
438
+ framework: spec.framework || 'jest'
439
+ }
440
+ });
441
+
442
+ console.log(`✅ Implementation complete, ${implementation.testResults.passed}/${implementation.testResults.total} tests passing`);
443
+
444
+ // Verify all tests pass (GREEN phase validation)
445
+ if (implementation.testResults.failed > 0) {
446
+ throw new Error(`${implementation.testResults.failed} tests still failing`);
447
+ }
448
+
449
+ // Step 3: Refactorer (REFACTOR phase)
450
+ console.log('🔧 Step 3/4: Refactoring with tests green (REFACTOR)...');
451
+ const refactored = await delegateToSubagent('qe-test-refactorer', {
452
+ code: implementation.sourceCode,
453
+ tests,
454
+ metrics: {
455
+ targetComplexity: 10,
456
+ targetMaintainability: 85
457
+ }
458
+ });
459
+
460
+ console.log(`✅ Refactoring complete, complexity reduced by ${refactored.improvements.complexityReduction}%`);
461
+
462
+ // Verify tests still pass after refactoring
463
+ const refactorTestRun = await runTests(tests, refactored.code);
464
+ if (refactorTestRun.failed > 0) {
465
+ throw new Error('Tests failed after refactoring - rollback required');
466
+ }
467
+
468
+ // Step 4: Code Reviewer (QUALITY phase)
469
+ console.log('👀 Step 4/4: Quality review and validation...');
470
+ const review = await delegateToSubagent('qe-code-reviewer', {
471
+ code: refactored.code,
472
+ tests,
473
+ policies: ['./policies/code-standards.yaml']
474
+ });
475
+
476
+ // If review fails, apply fixes and retry
477
+ if (!review.approved) {
478
+ console.log(`⚠️ Review failed with ${review.issues.length} issues, applying fixes...`);
479
+
480
+ const fixes = await applyReviewFixes(refactored.code, review.issues);
481
+ const fixedTestRun = await runTests(tests, fixes.code);
482
+
483
+ if (fixedTestRun.passed === tests.length) {
484
+ console.log('✅ Fixes applied successfully, all tests passing');
485
+ return {
486
+ tests,
487
+ implementation: fixes.code,
488
+ review: { ...review, approved: true },
489
+ metrics: {
490
+ coverage: implementation.coverage,
491
+ complexity: fixes.metrics.complexity,
492
+ quality: review.metrics
493
+ },
494
+ workflow: 'tdd-red-green-refactor-review'
495
+ };
496
+ } else {
497
+ throw new Error('Unable to fix all review issues while keeping tests passing');
498
+ }
499
+ }
500
+
501
+ console.log('✅ TDD workflow complete! All phases passed.');
502
+
503
+ return {
504
+ tests,
505
+ implementation: refactored.code,
506
+ review,
507
+ metrics: {
508
+ coverage: implementation.coverage,
509
+ complexity: refactored.metrics.complexity,
510
+ quality: review.metrics
511
+ },
512
+ workflow: 'tdd-red-green-refactor-review'
513
+ };
514
+ }
515
+ ```
516
+
517
+ ### Subagent Communication
518
+
519
+ ```typescript
520
+ // Event-driven coordination between subagents
521
+ eventBus.on('subagent:test-writer:started', (data) => {
522
+ console.log(`📝 Test Writer: Analyzing ${data.spec.requirements.length} requirements...`);
523
+ });
524
+
525
+ eventBus.on('subagent:test-writer:completed', (data) => {
526
+ console.log(`✅ Test Writer: Generated ${data.tests.length} tests with ${data.coverage.expectedCoverage}% coverage spec`);
527
+ });
528
+
529
+ eventBus.on('subagent:test-implementer:progress', (data) => {
530
+ console.log(`💚 Test Implementer: ${data.testsPassed}/${data.testsTotal} tests passing (${Math.round(data.testsPassed/data.testsTotal*100)}%)`);
531
+ });
532
+
533
+ eventBus.on('subagent:test-refactorer:improved', (data) => {
534
+ console.log(`🔧 Refactorer: Reduced complexity from ${data.before.complexity} to ${data.after.complexity}`);
535
+ });
536
+
537
+ eventBus.on('subagent:code-reviewer:issue', (data) => {
538
+ console.warn(`⚠️ Code Reviewer: ${data.severity} issue - ${data.message}`);
539
+ });
540
+ ```
541
+
542
+ ### Memory Coordination
543
+
544
+ ```typescript
545
+ // Store TDD workflow progress
546
+ await this.memoryStore.store('aqe/tdd-workflow/status', {
547
+ phase: 'red', // red, green, refactor, review
548
+ testsWritten: tests.length,
549
+ testsPassing: 0,
550
+ timestamp: Date.now()
551
+ }, {
552
+ partition: 'coordination'
553
+ });
554
+
555
+ // Share artifacts between subagents
556
+ await this.memoryStore.store('aqe/tdd-workflow/tests', tests, {
557
+ partition: 'subagent_coordination',
558
+ ttl: 86400 // 24 hours
559
+ });
560
+
561
+ // Track metrics across workflow
562
+ await this.memoryStore.store('aqe/tdd-workflow/metrics', {
563
+ coverage: implementation.coverage,
564
+ complexity: refactored.metrics.complexity,
565
+ quality: review.metrics,
566
+ duration: workflowDuration
567
+ }, {
568
+ partition: 'metrics',
569
+ ttl: 604800 // 7 days
570
+ });
571
+ ```
572
+
573
+ ### Feedback Loop
574
+
575
+ When quality validation fails, the workflow automatically iterates:
576
+
577
+ ```typescript
578
+ // Iteration pattern for quality improvements
579
+ async function iterateTDDWorkflow(spec: TestSpec, previousAttempt: TDDResult): Promise<TDDResult> {
580
+ // Analyze what went wrong
581
+ const issues = previousAttempt.review.issues;
582
+
583
+ // Enhance requirements based on issues
584
+ const enhancedSpec = {
585
+ ...spec,
586
+ requirements: [
587
+ ...spec.requirements,
588
+ ...issues.map(i => i.recommendation)
589
+ ]
590
+ };
591
+
592
+ // Re-run workflow with enhanced requirements
593
+ return await generateTestSuiteWithTDD(enhancedSpec);
594
+ }
595
+ ```
596
+
597
+ ## Example Outputs
598
+
599
+ ### Property-Based Test Generation
600
+ ```javascript
601
+ // Generated property test for sorting function
602
+ test.prop('sorted array should be in ascending order',
603
+ fc.array(fc.integer()),
604
+ (arr) => {
605
+ const sorted = quickSort(arr);
606
+ for (let i = 1; i < sorted.length; i++) {
607
+ expect(sorted[i]).toBeGreaterThanOrEqual(sorted[i-1]);
608
+ }
609
+ }
610
+ );
611
+ ```
612
+
613
+ ### Boundary Value Test Generation
614
+ ```javascript
615
+ // Generated boundary tests for pagination
616
+ describe('Pagination Boundary Tests', () => {
617
+ const boundaries = [
618
+ { page: 0, size: 10, expected: 'error' },
619
+ { page: 1, size: 0, expected: 'error' },
620
+ { page: 1, size: 1, expected: 'success' },
621
+ { page: Number.MAX_SAFE_INTEGER, size: 10, expected: 'empty' }
622
+ ];
623
+
624
+ boundaries.forEach(({ page, size, expected }) => {
625
+ test(`page=${page}, size=${size} should ${expected}`, async () => {
626
+ const result = await paginate(page, size);
627
+ expect(result.status).toBe(expected);
628
+ });
629
+ });
630
+ });
631
+ ```
632
+
633
+ ### API Test Generation
634
+ ```javascript
635
+ // Generated API integration tests
636
+ describe('API Contract Tests', () => {
637
+ const apiSpec = loadOpenAPISpec();
638
+
639
+ apiSpec.paths.forEach((path, methods) => {
640
+ methods.forEach((method, operation) => {
641
+ test(`${method.toUpperCase()} ${path} should match contract`, async () => {
642
+ const testData = generateRequestData(operation.parameters);
643
+ const response = await apiClient[method](path, testData);
644
+
645
+ expect(response.status).toBe(operation.responses['200'].status);
646
+ expect(response.data).toMatchSchema(operation.responses['200'].schema);
647
+ });
648
+ });
649
+ });
650
+ });
651
+ ```
652
+
653
+ ## Neural Pattern Integration
654
+
655
+ ### Learning from Test Results
656
+
657
+ **Native TypeScript neural integration:**
658
+
659
+ ```typescript
660
+ // Store neural patterns from test results
661
+ await this.memoryStore.store('aqe/neural/patterns/test-generation', {
662
+ operation: 'test-generation',
663
+ outcome: testResults,
664
+ patterns: identifiedPatterns,
665
+ confidence: 0.95,
666
+ timestamp: Date.now()
667
+ }, {
668
+ partition: 'neural',
669
+ ttl: 2592000 // 30 days
670
+ });
671
+
672
+ // Emit neural learning event
673
+ this.eventBus.emit('neural:pattern-learned', {
674
+ agentId: this.agentId,
675
+ operation: 'test-generation',
676
+ confidence: 0.95
677
+ });
678
+ ```
679
+
680
+ ### Predictive Test Generation
681
+
682
+ **Native TypeScript prediction:**
683
+
684
+ ```typescript
685
+ // Retrieve neural patterns for prediction
686
+ const patterns = await this.memoryStore.retrieve('aqe/neural/patterns/test-generation', {
687
+ partition: 'neural'
688
+ });
689
+
690
+ // Use patterns for intelligent test strategy selection
691
+ const predictedStrategy = this.predictOptimalStrategy(codeAnalysis, patterns);
692
+
693
+ // Store prediction outcome
694
+ await this.memoryStore.store('aqe/neural/predictions', {
695
+ input: codeAnalysis,
696
+ strategy: predictedStrategy,
697
+ timestamp: Date.now()
698
+ }, {
699
+ partition: 'neural'
700
+ });
701
+ ```
702
+
703
+ ## Commands
704
+
705
+ ### Basic Operations
706
+ ```bash
707
+ # Initialize test generator
708
+ agentic-qe agent spawn --name qe-test-generator --type test-generator
709
+
710
+ # Generate tests for specific module
711
+ agentic-qe agent execute --name qe-test-generator --task "generate-tests" --module "${MODULE_PATH}"
712
+
713
+ # Check generation status
714
+ agentic-qe agent status --name qe-test-generator
715
+ ```
716
+
717
+ ### Advanced Operations
718
+ ```bash
719
+ # Generate property-based tests
720
+ agentic-qe test generate --type property --module "${MODULE}" --framework jest
721
+
722
+ # Optimize test suite with sublinear algorithms
723
+ agentic-qe test optimize --suite "${SUITE_PATH}" --target-coverage 0.95
724
+
725
+ # Generate performance tests
726
+ agentic-qe test generate --type performance --endpoints "${API_SPEC}"
727
+ ```
728
+
729
+ ## Quality Metrics
730
+
731
+ - **Coverage**: Target 95%+ code coverage
732
+ - **Execution Time**: <30 seconds per 1000 tests
733
+ - **Mutation Score**: >80% mutation coverage
734
+ - **Maintainability**: Generated tests should be readable and maintainable
735
+ - **Framework Compatibility**: Support 5+ testing frameworks
736
+
737
+ ## Code Execution Workflows
738
+
739
+ **Anthropic Recommendation**: Use code execution over direct tool calls for 98.7% token reduction (150K → 2K tokens).
740
+
741
+ ### Tool Discovery
742
+
743
+ ```bash
744
+ # List available test generation tools
745
+ ls -la ./src/mcp/handlers/test/
746
+ # Files: test-generate-enhanced.ts, test-execute-parallel.ts,
747
+ # test-optimize-sublinear.ts, test-coverage-detailed.ts
748
+
749
+ # List analysis tools for test generation
750
+ ls -la ./src/mcp/handlers/analysis/
751
+ # Files: coverage-analyze.ts, code-quality-check.ts, dependency-analyze.ts
752
+ ```
753
+
754
+ ### Workflow 1: Basic Test Generation Orchestration
755
+
756
+ ```javascript
757
+ // Import handlers and services
758
+ import { TestGenerateHandler } from '../src/mcp/handlers/test-generate.js';
759
+ import { AgentRegistry } from '../src/mcp/services/AgentRegistry.js';
760
+ import { HookExecutor } from '../src/mcp/services/HookExecutor.js';
761
+
762
+ // Initialize orchestration components
763
+ const registry = new AgentRegistry();
764
+ const hookExecutor = new HookExecutor();
765
+ const testGenerator = new TestGenerateHandler(registry, hookExecutor);
766
+
767
+ // Define test generation specification
768
+ const testSpec = {
769
+ type: 'unit',
770
+ sourceCode: {
771
+ repositoryUrl: 'https://github.com/example/repo',
772
+ branch: 'main',
773
+ language: 'javascript'
774
+ },
775
+ frameworks: ['jest'],
776
+ coverageTarget: 85,
777
+ synthesizeData: true
778
+ };
779
+
780
+ // Execute test generation with error handling
781
+ try {
782
+ const result = await testGenerator.handle({ spec: testSpec });
783
+
784
+ if (result.success) {
785
+ console.log(`Generated ${result.data.tests.length} tests`);
786
+ console.log(`Coverage: ${result.data.coverage.achieved}%`);
787
+
788
+ // Conditional logic: Check if coverage target met
789
+ if (result.data.coverage.achieved < testSpec.coverageTarget) {
790
+ console.log('Coverage gap detected, generating additional tests...');
791
+
792
+ // Generate additional tests for gaps
793
+ for (const gap of result.data.coverage.gaps) {
794
+ const additionalSpec = {
795
+ ...testSpec,
796
+ targetFiles: [gap.file],
797
+ focusAreas: gap.functions
798
+ };
799
+ await testGenerator.handle({ spec: additionalSpec });
800
+ }
801
+ }
802
+ }
803
+ } catch (error) {
804
+ console.error('Test generation failed:', error.message);
805
+ // Fallback strategy: Use alternative test generation approach
806
+ console.log('Attempting alternative test generation strategy...');
807
+ }
808
+ ```
809
+
810
+ ### Workflow 2: Property-Based Test Generation
811
+
812
+ ```javascript
813
+ import { CodeAnalyzer } from '../src/mcp/handlers/analysis/code-quality-check.js';
814
+
815
+ async function generatePropertyBasedTests(modulePath) {
816
+ // Step 1: Analyze code for property candidates
817
+ console.log('Analyzing code for property-based testing opportunities...');
818
+ const codeAnalyzer = new CodeAnalyzer(registry, hookExecutor);
819
+
820
+ const analysisResult = await codeAnalyzer.handle({
821
+ filePath: modulePath,
822
+ analysisTypes: ['complexity', 'dependencies', 'patterns']
823
+ });
824
+
825
+ // Step 2: Identify pure functions (good candidates for property testing)
826
+ const pureFunctions = analysisResult.data.functions.filter(f =>
827
+ f.isPure && f.complexity < 10
828
+ );
829
+
830
+ console.log(`Found ${pureFunctions.length} candidates for property-based testing`);
831
+
832
+ // Step 3: Generate property tests for each function
833
+ const propertyTests = [];
834
+ for (const func of pureFunctions) {
835
+ const testSpec = {
836
+ type: 'property-based',
837
+ sourceCode: {
838
+ repositoryUrl: modulePath,
839
+ branch: 'main',
840
+ language: 'javascript'
841
+ },
842
+ frameworks: ['jest', 'fast-check'],
843
+ targetFunction: func.name,
844
+ properties: inferProperties(func), // Infer mathematical properties
845
+ coverageTarget: 95
846
+ };
847
+
848
+ const result = await testGenerator.handle({ spec: testSpec });
849
+ propertyTests.push(result.data);
850
+ }
851
+
852
+ return propertyTests;
853
+ }
854
+
855
+ function inferProperties(func) {
856
+ // Infer properties based on function signature and name
857
+ const properties = [];
858
+
859
+ if (func.name.includes('sort')) {
860
+ properties.push('idempotence', 'ordering', 'length-preservation');
861
+ }
862
+ if (func.name.includes('reverse')) {
863
+ properties.push('involution', 'length-preservation');
864
+ }
865
+ if (func.returnType === func.parameters[0]?.type) {
866
+ properties.push('same-type');
867
+ }
868
+
869
+ return properties;
870
+ }
871
+ ```
872
+
873
+ ### Workflow 3: Integration with Coverage Analyzer
874
+
875
+ ```javascript
876
+ import { CoverageAnalyzeHandler } from '../src/mcp/handlers/analysis/coverage-analyze.js';
877
+
878
+ async function generateTestsForCoverageGaps(projectPath) {
879
+ const coverageAnalyzer = new CoverageAnalyzeHandler(registry, hookExecutor);
880
+
881
+ // Step 1: Run coverage analysis
882
+ console.log('Analyzing coverage gaps...');
883
+ const coverageResult = await coverageAnalyzer.handle({
884
+ projectPath,
885
+ thresholds: { statements: 80, branches: 75, functions: 85 },
886
+ includePatterns: ['src/**/*.js', 'lib/**/*.js']
887
+ });
888
+
889
+ // Step 2: Prioritize gaps by criticality
890
+ const criticalGaps = coverageResult.data.uncoveredFiles
891
+ .filter(f => f.coverage.statements < 50)
892
+ .sort((a, b) => a.coverage.statements - b.coverage.statements);
893
+
894
+ console.log(`Found ${criticalGaps.length} critical coverage gaps`);
895
+
896
+ // Step 3: Generate tests for critical gaps
897
+ for (const gap of criticalGaps) {
898
+ console.log(`Generating tests for ${gap.path} (${gap.coverage.statements}% coverage)`);
899
+
900
+ const testSpec = {
901
+ type: 'unit',
902
+ sourceCode: {
903
+ repositoryUrl: projectPath,
904
+ branch: 'main',
905
+ language: 'javascript'
906
+ },
907
+ frameworks: ['jest'],
908
+ targetFiles: [gap.path],
909
+ targetLines: gap.uncoveredLines,
910
+ coverageTarget: 80,
911
+ synthesizeData: true
912
+ };
913
+
914
+ const result = await testGenerator.handle({ spec: testSpec });
915
+
916
+ // Verify coverage improvement
917
+ const newCoverage = await coverageAnalyzer.handle({
918
+ projectPath,
919
+ fileFilter: gap.path
920
+ });
921
+
922
+ const improvement = newCoverage.data.coverage.statements - gap.coverage.statements;
923
+ console.log(` Coverage improved by ${improvement}%`);
924
+ }
925
+ }
926
+ ```
927
+
928
+ ### Workflow 4: Error Handling Patterns
929
+
930
+ ```javascript
931
+ // Pattern 1: Retry with exponential backoff
932
+ async function generateTestsWithRetry(testSpec, maxRetries = 3) {
933
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
934
+ try {
935
+ return await testGenerator.handle({ spec: testSpec });
936
+ } catch (error) {
937
+ if (attempt < maxRetries) {
938
+ const delay = Math.pow(2, attempt) * 1000;
939
+ console.log(`Attempt ${attempt} failed, retrying in ${delay}ms...`);
940
+ await new Promise(resolve => setTimeout(resolve, delay));
941
+ } else {
942
+ throw error;
943
+ }
944
+ }
945
+ }
946
+ }
947
+
948
+ // Pattern 2: Fallback to simpler test generation
949
+ async function generateTestsWithFallback(testSpec) {
950
+ try {
951
+ // Try advanced property-based generation
952
+ return await testGenerator.handle({
953
+ spec: { ...testSpec, type: 'property-based' }
954
+ });
955
+ } catch (error) {
956
+ console.log('Advanced generation failed, falling back to unit tests...');
957
+ return await testGenerator.handle({
958
+ spec: { ...testSpec, type: 'unit' }
959
+ });
960
+ }
961
+ }
962
+ ```
963
+
964
+ ### Memory Coordination
965
+
966
+ ```javascript
967
+ import { MemoryStore } from '../src/memory/MemoryStore.js';
968
+
969
+ const memoryStore = new MemoryStore();
970
+
971
+ // Store test generation results for coordination
972
+ await memoryStore.store('aqe/test-generation/results', {
973
+ suiteId: testSuite.id,
974
+ testsGenerated: testSuite.tests.length,
975
+ coverage: testSuite.coverage.achieved,
976
+ timestamp: Date.now()
977
+ }, {
978
+ partition: 'agent_results',
979
+ ttl: 86400 // 24 hours
980
+ });
981
+
982
+ // Retrieve prior test generation patterns
983
+ const patterns = await memoryStore.retrieve('aqe/neural/patterns/test-generation', {
984
+ partition: 'neural'
985
+ });
986
+ ```
987
+
988
+ **See also**: `/workspaces/agentic-qe-cf/templates/agent-code-execution-template.md` for complete workflow patterns.
989
+
990
+ ## Integration with QE Fleet
991
+
992
+ This agent integrates seamlessly with the Agentic QE Fleet through:
993
+ - **EventBus**: Real-time coordination with other QE agents
994
+ - **MemoryManager**: Persistent storage of test generation patterns
995
+ - **FleetManager**: Lifecycle management and health monitoring
996
+ - **Neural Network**: Continuous learning from test execution results
997
+ - **Sublinear Solver**: Optimization algorithms for efficient test selection