agentic-qe 1.9.4 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/.claude/agents/qe-api-contract-validator.md +95 -1336
  2. package/.claude/agents/qe-chaos-engineer.md +152 -1211
  3. package/.claude/agents/qe-code-complexity.md +144 -707
  4. package/.claude/agents/qe-coverage-analyzer.md +147 -743
  5. package/.claude/agents/qe-deployment-readiness.md +143 -1496
  6. package/.claude/agents/qe-flaky-test-hunter.md +132 -1529
  7. package/.claude/agents/qe-fleet-commander.md +12 -12
  8. package/.claude/agents/qe-performance-tester.md +150 -886
  9. package/.claude/agents/qe-production-intelligence.md +155 -1396
  10. package/.claude/agents/qe-quality-analyzer.md +6 -6
  11. package/.claude/agents/qe-quality-gate.md +151 -648
  12. package/.claude/agents/qe-regression-risk-analyzer.md +132 -1150
  13. package/.claude/agents/qe-requirements-validator.md +149 -932
  14. package/.claude/agents/qe-security-scanner.md +157 -797
  15. package/.claude/agents/qe-test-data-architect.md +96 -1365
  16. package/.claude/agents/qe-test-executor.md +8 -8
  17. package/.claude/agents/qe-test-generator.md +145 -1540
  18. package/.claude/agents/qe-visual-tester.md +153 -1257
  19. package/.claude/agents/qx-partner.md +248 -0
  20. package/.claude/agents/subagents/qe-code-reviewer.md +40 -136
  21. package/.claude/agents/subagents/qe-coverage-gap-analyzer.md +40 -480
  22. package/.claude/agents/subagents/qe-data-generator.md +41 -125
  23. package/.claude/agents/subagents/qe-flaky-investigator.md +55 -411
  24. package/.claude/agents/subagents/qe-integration-tester.md +53 -141
  25. package/.claude/agents/subagents/qe-performance-validator.md +54 -130
  26. package/.claude/agents/subagents/qe-security-auditor.md +56 -114
  27. package/.claude/agents/subagents/qe-test-data-architect-sub.md +57 -548
  28. package/.claude/agents/subagents/qe-test-implementer.md +58 -551
  29. package/.claude/agents/subagents/qe-test-refactorer.md +65 -722
  30. package/.claude/agents/subagents/qe-test-writer.md +63 -726
  31. package/.claude/skills/accessibility-testing/SKILL.md +144 -692
  32. package/.claude/skills/agentic-quality-engineering/SKILL.md +176 -529
  33. package/.claude/skills/api-testing-patterns/SKILL.md +180 -560
  34. package/.claude/skills/brutal-honesty-review/SKILL.md +113 -603
  35. package/.claude/skills/bug-reporting-excellence/SKILL.md +116 -517
  36. package/.claude/skills/chaos-engineering-resilience/SKILL.md +127 -72
  37. package/.claude/skills/cicd-pipeline-qe-orchestrator/SKILL.md +209 -404
  38. package/.claude/skills/code-review-quality/SKILL.md +158 -608
  39. package/.claude/skills/compatibility-testing/SKILL.md +148 -38
  40. package/.claude/skills/compliance-testing/SKILL.md +132 -63
  41. package/.claude/skills/consultancy-practices/SKILL.md +114 -446
  42. package/.claude/skills/context-driven-testing/SKILL.md +117 -381
  43. package/.claude/skills/contract-testing/SKILL.md +176 -141
  44. package/.claude/skills/database-testing/SKILL.md +137 -130
  45. package/.claude/skills/exploratory-testing-advanced/SKILL.md +160 -629
  46. package/.claude/skills/holistic-testing-pact/SKILL.md +140 -188
  47. package/.claude/skills/localization-testing/SKILL.md +145 -33
  48. package/.claude/skills/mobile-testing/SKILL.md +132 -448
  49. package/.claude/skills/mutation-testing/SKILL.md +147 -41
  50. package/.claude/skills/performance-testing/SKILL.md +200 -546
  51. package/.claude/skills/quality-metrics/SKILL.md +164 -519
  52. package/.claude/skills/refactoring-patterns/SKILL.md +132 -699
  53. package/.claude/skills/regression-testing/SKILL.md +120 -926
  54. package/.claude/skills/risk-based-testing/SKILL.md +157 -660
  55. package/.claude/skills/security-testing/SKILL.md +199 -538
  56. package/.claude/skills/sherlock-review/SKILL.md +163 -699
  57. package/.claude/skills/shift-left-testing/SKILL.md +161 -465
  58. package/.claude/skills/shift-right-testing/SKILL.md +161 -519
  59. package/.claude/skills/six-thinking-hats/SKILL.md +175 -1110
  60. package/.claude/skills/skills-manifest.json +683 -0
  61. package/.claude/skills/tdd-london-chicago/SKILL.md +131 -448
  62. package/.claude/skills/technical-writing/SKILL.md +103 -154
  63. package/.claude/skills/test-automation-strategy/SKILL.md +166 -772
  64. package/.claude/skills/test-data-management/SKILL.md +126 -910
  65. package/.claude/skills/test-design-techniques/SKILL.md +179 -89
  66. package/.claude/skills/test-environment-management/SKILL.md +136 -91
  67. package/.claude/skills/test-reporting-analytics/SKILL.md +169 -92
  68. package/.claude/skills/testability-scoring/README.md +71 -0
  69. package/.claude/skills/testability-scoring/SKILL.md +245 -0
  70. package/.claude/skills/testability-scoring/resources/templates/config.template.js +84 -0
  71. package/.claude/skills/testability-scoring/resources/templates/testability-scoring.spec.template.js +532 -0
  72. package/.claude/skills/testability-scoring/scripts/generate-html-report.js +1007 -0
  73. package/.claude/skills/testability-scoring/scripts/run-assessment.sh +70 -0
  74. package/.claude/skills/visual-testing-advanced/SKILL.md +155 -78
  75. package/.claude/skills/xp-practices/SKILL.md +151 -587
  76. package/CHANGELOG.md +110 -0
  77. package/README.md +55 -21
  78. package/dist/agents/QXPartnerAgent.d.ts +146 -0
  79. package/dist/agents/QXPartnerAgent.d.ts.map +1 -0
  80. package/dist/agents/QXPartnerAgent.js +1831 -0
  81. package/dist/agents/QXPartnerAgent.js.map +1 -0
  82. package/dist/agents/index.d.ts +1 -0
  83. package/dist/agents/index.d.ts.map +1 -1
  84. package/dist/agents/index.js +82 -2
  85. package/dist/agents/index.js.map +1 -1
  86. package/dist/agents/lifecycle/AgentLifecycleManager.d.ts.map +1 -1
  87. package/dist/agents/lifecycle/AgentLifecycleManager.js +34 -31
  88. package/dist/agents/lifecycle/AgentLifecycleManager.js.map +1 -1
  89. package/dist/cli/commands/debug/agent.d.ts.map +1 -1
  90. package/dist/cli/commands/debug/agent.js +19 -6
  91. package/dist/cli/commands/debug/agent.js.map +1 -1
  92. package/dist/cli/commands/debug/health-check.js +20 -7
  93. package/dist/cli/commands/debug/health-check.js.map +1 -1
  94. package/dist/cli/commands/init-claude-md-template.d.ts +1 -0
  95. package/dist/cli/commands/init-claude-md-template.d.ts.map +1 -1
  96. package/dist/cli/commands/init-claude-md-template.js +18 -3
  97. package/dist/cli/commands/init-claude-md-template.js.map +1 -1
  98. package/dist/cli/commands/workflow/cancel.d.ts.map +1 -1
  99. package/dist/cli/commands/workflow/cancel.js +4 -3
  100. package/dist/cli/commands/workflow/cancel.js.map +1 -1
  101. package/dist/cli/commands/workflow/list.d.ts.map +1 -1
  102. package/dist/cli/commands/workflow/list.js +4 -3
  103. package/dist/cli/commands/workflow/list.js.map +1 -1
  104. package/dist/cli/commands/workflow/pause.d.ts.map +1 -1
  105. package/dist/cli/commands/workflow/pause.js +4 -3
  106. package/dist/cli/commands/workflow/pause.js.map +1 -1
  107. package/dist/cli/init/claude-config.d.ts.map +1 -1
  108. package/dist/cli/init/claude-config.js +3 -8
  109. package/dist/cli/init/claude-config.js.map +1 -1
  110. package/dist/cli/init/claude-md.d.ts.map +1 -1
  111. package/dist/cli/init/claude-md.js +44 -2
  112. package/dist/cli/init/claude-md.js.map +1 -1
  113. package/dist/cli/init/database-init.js +1 -1
  114. package/dist/cli/init/index.d.ts.map +1 -1
  115. package/dist/cli/init/index.js +13 -6
  116. package/dist/cli/init/index.js.map +1 -1
  117. package/dist/cli/init/skills.d.ts.map +1 -1
  118. package/dist/cli/init/skills.js +2 -1
  119. package/dist/cli/init/skills.js.map +1 -1
  120. package/dist/core/SwarmCoordinator.d.ts +180 -0
  121. package/dist/core/SwarmCoordinator.d.ts.map +1 -0
  122. package/dist/core/SwarmCoordinator.js +473 -0
  123. package/dist/core/SwarmCoordinator.js.map +1 -0
  124. package/dist/core/memory/AgentDBIntegration.d.ts +24 -6
  125. package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -1
  126. package/dist/core/memory/AgentDBIntegration.js +66 -10
  127. package/dist/core/memory/AgentDBIntegration.js.map +1 -1
  128. package/dist/core/memory/UnifiedMemoryCoordinator.d.ts +341 -0
  129. package/dist/core/memory/UnifiedMemoryCoordinator.d.ts.map +1 -0
  130. package/dist/core/memory/UnifiedMemoryCoordinator.js +986 -0
  131. package/dist/core/memory/UnifiedMemoryCoordinator.js.map +1 -0
  132. package/dist/core/memory/index.d.ts +5 -0
  133. package/dist/core/memory/index.d.ts.map +1 -1
  134. package/dist/core/memory/index.js +23 -1
  135. package/dist/core/memory/index.js.map +1 -1
  136. package/dist/core/metrics/MetricsAggregator.d.ts +228 -0
  137. package/dist/core/metrics/MetricsAggregator.d.ts.map +1 -0
  138. package/dist/core/metrics/MetricsAggregator.js +482 -0
  139. package/dist/core/metrics/MetricsAggregator.js.map +1 -0
  140. package/dist/core/metrics/index.d.ts +5 -0
  141. package/dist/core/metrics/index.d.ts.map +1 -0
  142. package/dist/core/metrics/index.js +11 -0
  143. package/dist/core/metrics/index.js.map +1 -0
  144. package/dist/core/optimization/SwarmOptimizer.d.ts +190 -0
  145. package/dist/core/optimization/SwarmOptimizer.d.ts.map +1 -0
  146. package/dist/core/optimization/SwarmOptimizer.js +648 -0
  147. package/dist/core/optimization/SwarmOptimizer.js.map +1 -0
  148. package/dist/core/optimization/index.d.ts +9 -0
  149. package/dist/core/optimization/index.d.ts.map +1 -0
  150. package/dist/core/optimization/index.js +25 -0
  151. package/dist/core/optimization/index.js.map +1 -0
  152. package/dist/core/optimization/types.d.ts +53 -0
  153. package/dist/core/optimization/types.d.ts.map +1 -0
  154. package/dist/core/optimization/types.js +6 -0
  155. package/dist/core/optimization/types.js.map +1 -0
  156. package/dist/core/orchestration/AdaptiveScheduler.d.ts +190 -0
  157. package/dist/core/orchestration/AdaptiveScheduler.d.ts.map +1 -0
  158. package/dist/core/orchestration/AdaptiveScheduler.js +460 -0
  159. package/dist/core/orchestration/AdaptiveScheduler.js.map +1 -0
  160. package/dist/core/orchestration/PriorityQueue.d.ts +54 -0
  161. package/dist/core/orchestration/PriorityQueue.d.ts.map +1 -0
  162. package/dist/core/orchestration/PriorityQueue.js +122 -0
  163. package/dist/core/orchestration/PriorityQueue.js.map +1 -0
  164. package/dist/core/orchestration/WorkflowOrchestrator.d.ts +189 -0
  165. package/dist/core/orchestration/WorkflowOrchestrator.d.ts.map +1 -0
  166. package/dist/core/orchestration/WorkflowOrchestrator.js +845 -0
  167. package/dist/core/orchestration/WorkflowOrchestrator.js.map +1 -0
  168. package/dist/core/orchestration/index.d.ts +7 -0
  169. package/dist/core/orchestration/index.d.ts.map +1 -0
  170. package/dist/core/orchestration/index.js +11 -0
  171. package/dist/core/orchestration/index.js.map +1 -0
  172. package/dist/core/orchestration/types.d.ts +96 -0
  173. package/dist/core/orchestration/types.d.ts.map +1 -0
  174. package/dist/core/orchestration/types.js +6 -0
  175. package/dist/core/orchestration/types.js.map +1 -0
  176. package/dist/core/recovery/CircuitBreaker.d.ts +176 -0
  177. package/dist/core/recovery/CircuitBreaker.d.ts.map +1 -0
  178. package/dist/core/recovery/CircuitBreaker.js +382 -0
  179. package/dist/core/recovery/CircuitBreaker.js.map +1 -0
  180. package/dist/core/recovery/RecoveryOrchestrator.d.ts +186 -0
  181. package/dist/core/recovery/RecoveryOrchestrator.d.ts.map +1 -0
  182. package/dist/core/recovery/RecoveryOrchestrator.js +476 -0
  183. package/dist/core/recovery/RecoveryOrchestrator.js.map +1 -0
  184. package/dist/core/recovery/RetryStrategy.d.ts +127 -0
  185. package/dist/core/recovery/RetryStrategy.d.ts.map +1 -0
  186. package/dist/core/recovery/RetryStrategy.js +314 -0
  187. package/dist/core/recovery/RetryStrategy.js.map +1 -0
  188. package/dist/core/recovery/index.d.ts +8 -0
  189. package/dist/core/recovery/index.d.ts.map +1 -0
  190. package/dist/core/recovery/index.js +27 -0
  191. package/dist/core/recovery/index.js.map +1 -0
  192. package/dist/core/skills/DependencyResolver.d.ts +99 -0
  193. package/dist/core/skills/DependencyResolver.d.ts.map +1 -0
  194. package/dist/core/skills/DependencyResolver.js +260 -0
  195. package/dist/core/skills/DependencyResolver.js.map +1 -0
  196. package/dist/core/skills/DynamicSkillLoader.d.ts +96 -0
  197. package/dist/core/skills/DynamicSkillLoader.d.ts.map +1 -0
  198. package/dist/core/skills/DynamicSkillLoader.js +353 -0
  199. package/dist/core/skills/DynamicSkillLoader.js.map +1 -0
  200. package/dist/core/skills/ManifestGenerator.d.ts +114 -0
  201. package/dist/core/skills/ManifestGenerator.d.ts.map +1 -0
  202. package/dist/core/skills/ManifestGenerator.js +449 -0
  203. package/dist/core/skills/ManifestGenerator.js.map +1 -0
  204. package/dist/core/skills/index.d.ts +9 -0
  205. package/dist/core/skills/index.d.ts.map +1 -0
  206. package/dist/core/skills/index.js +24 -0
  207. package/dist/core/skills/index.js.map +1 -0
  208. package/dist/core/skills/types.d.ts +118 -0
  209. package/dist/core/skills/types.d.ts.map +1 -0
  210. package/dist/core/skills/types.js +7 -0
  211. package/dist/core/skills/types.js.map +1 -0
  212. package/dist/core/transport/QUICTransport.d.ts +320 -0
  213. package/dist/core/transport/QUICTransport.d.ts.map +1 -0
  214. package/dist/core/transport/QUICTransport.js +711 -0
  215. package/dist/core/transport/QUICTransport.js.map +1 -0
  216. package/dist/core/transport/index.d.ts +40 -0
  217. package/dist/core/transport/index.d.ts.map +1 -0
  218. package/dist/core/transport/index.js +46 -0
  219. package/dist/core/transport/index.js.map +1 -0
  220. package/dist/core/transport/quic-loader.d.ts +123 -0
  221. package/dist/core/transport/quic-loader.d.ts.map +1 -0
  222. package/dist/core/transport/quic-loader.js +293 -0
  223. package/dist/core/transport/quic-loader.js.map +1 -0
  224. package/dist/core/transport/quic.d.ts +154 -0
  225. package/dist/core/transport/quic.d.ts.map +1 -0
  226. package/dist/core/transport/quic.js +214 -0
  227. package/dist/core/transport/quic.js.map +1 -0
  228. package/dist/mcp/server.d.ts +9 -9
  229. package/dist/mcp/server.d.ts.map +1 -1
  230. package/dist/mcp/server.js +1 -2
  231. package/dist/mcp/server.js.map +1 -1
  232. package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
  233. package/dist/mcp/services/AgentRegistry.js +4 -1
  234. package/dist/mcp/services/AgentRegistry.js.map +1 -1
  235. package/dist/types/index.d.ts +2 -1
  236. package/dist/types/index.d.ts.map +1 -1
  237. package/dist/types/index.js +2 -0
  238. package/dist/types/index.js.map +1 -1
  239. package/dist/types/qx.d.ts +429 -0
  240. package/dist/types/qx.d.ts.map +1 -0
  241. package/dist/types/qx.js +71 -0
  242. package/dist/types/qx.js.map +1 -0
  243. package/dist/visualization/api/RestEndpoints.js +2 -2
  244. package/dist/visualization/api/RestEndpoints.js.map +1 -1
  245. package/dist/visualization/api/WebSocketServer.d.ts +44 -0
  246. package/dist/visualization/api/WebSocketServer.d.ts.map +1 -1
  247. package/dist/visualization/api/WebSocketServer.js +144 -23
  248. package/dist/visualization/api/WebSocketServer.js.map +1 -1
  249. package/dist/visualization/core/DataTransformer.d.ts +10 -0
  250. package/dist/visualization/core/DataTransformer.d.ts.map +1 -1
  251. package/dist/visualization/core/DataTransformer.js +60 -5
  252. package/dist/visualization/core/DataTransformer.js.map +1 -1
  253. package/dist/visualization/emit-event.d.ts +75 -0
  254. package/dist/visualization/emit-event.d.ts.map +1 -0
  255. package/dist/visualization/emit-event.js +213 -0
  256. package/dist/visualization/emit-event.js.map +1 -0
  257. package/dist/visualization/index.d.ts +1 -0
  258. package/dist/visualization/index.d.ts.map +1 -1
  259. package/dist/visualization/index.js +7 -1
  260. package/dist/visualization/index.js.map +1 -1
  261. package/docs/reference/skills.md +63 -1
  262. package/package.json +16 -58
@@ -1,485 +1,45 @@
1
1
  ---
2
2
  name: qe-coverage-gap-analyzer
3
3
  description: "Identifies coverage gaps, risk-scores untested code, and recommends tests"
4
+ parent: qe-coverage-analyzer
4
5
  ---
5
6
 
6
- # Coverage Gap Analyzer Subagent
7
-
8
- ## Mission Statement
9
-
10
- The **Coverage Gap Analyzer** subagent specializes in identifying untested code paths, scoring their risk impact, and recommending targeted tests to close coverage gaps efficiently. This subagent uses static analysis and risk assessment to prioritize test creation where it matters most.
11
-
12
- ## Core Capabilities
13
-
14
- ### 1. Coverage Gap Detection
15
-
16
- ```typescript
17
- interface CoverageGap {
18
- path: string;
19
- startLine: number;
20
- endLine: number;
21
- type: 'branch' | 'statement' | 'function' | 'line';
22
- code: string;
23
- riskScore: number;
24
- complexity: number;
25
- dependencies: string[];
26
- }
27
-
28
- class GapDetector {
29
- async detectGaps(coverageReport: CoverageReport): Promise<CoverageGap[]> {
30
- const gaps: CoverageGap[] = [];
31
-
32
- for (const file of coverageReport.files) {
33
- // Uncovered statements
34
- for (const stmt of file.uncoveredStatements) {
35
- gaps.push({
36
- path: file.path,
37
- startLine: stmt.start.line,
38
- endLine: stmt.end.line,
39
- type: 'statement',
40
- code: this.extractCode(file.path, stmt.start.line, stmt.end.line),
41
- riskScore: await this.calculateRisk(file.path, stmt),
42
- complexity: this.calculateComplexity(stmt),
43
- dependencies: this.findDependencies(stmt)
44
- });
45
- }
46
-
47
- // Uncovered branches
48
- for (const branch of file.uncoveredBranches) {
49
- gaps.push({
50
- path: file.path,
51
- startLine: branch.line,
52
- endLine: branch.line,
53
- type: 'branch',
54
- code: this.extractCode(file.path, branch.line, branch.line),
55
- riskScore: await this.calculateBranchRisk(file.path, branch),
56
- complexity: branch.conditions,
57
- dependencies: this.findBranchDependencies(branch)
58
- });
59
- }
60
-
61
- // Uncovered functions
62
- for (const fn of file.uncoveredFunctions) {
63
- gaps.push({
64
- path: file.path,
65
- startLine: fn.start.line,
66
- endLine: fn.end.line,
67
- type: 'function',
68
- code: fn.name,
69
- riskScore: await this.calculateFunctionRisk(file.path, fn),
70
- complexity: fn.cyclomatic,
71
- dependencies: fn.imports
72
- });
73
- }
74
- }
75
-
76
- return gaps.sort((a, b) => b.riskScore - a.riskScore);
77
- }
78
- }
79
- ```
80
-
81
- ### 2. Risk Scoring System
82
-
83
- ```typescript
84
- interface RiskAssessment {
85
- overall: number; // 0-100
86
- factors: RiskFactor[];
87
- category: 'critical' | 'high' | 'medium' | 'low';
88
- justification: string;
89
- }
90
-
91
- class RiskScorer {
92
- async assessRisk(gap: CoverageGap): Promise<RiskAssessment> {
93
- const factors: RiskFactor[] = [];
94
-
95
- // Factor 1: Cyclomatic complexity
96
- factors.push({
97
- name: 'complexity',
98
- score: Math.min(gap.complexity * 5, 25),
99
- weight: 0.25,
100
- description: `Cyclomatic complexity: ${gap.complexity}`
101
- });
102
-
103
- // Factor 2: Code criticality (based on keywords)
104
- const criticalityScore = this.assessCriticality(gap.code);
105
- factors.push({
106
- name: 'criticality',
107
- score: criticalityScore,
108
- weight: 0.30,
109
- description: this.getCriticalityReason(gap.code)
110
- });
111
-
112
- // Factor 3: Change frequency
113
- const changeFreq = await this.getChangeFrequency(gap.path);
114
- factors.push({
115
- name: 'changeFrequency',
116
- score: Math.min(changeFreq * 2, 20),
117
- weight: 0.20,
118
- description: `${changeFreq} changes in last 90 days`
119
- });
120
-
121
- // Factor 4: Dependency count
122
- const depScore = Math.min(gap.dependencies.length * 3, 15);
123
- factors.push({
124
- name: 'dependencies',
125
- score: depScore,
126
- weight: 0.15,
127
- description: `${gap.dependencies.length} dependencies`
128
- });
129
-
130
- // Factor 5: Historical defects
131
- const defectScore = await this.getHistoricalDefects(gap.path);
132
- factors.push({
133
- name: 'defectHistory',
134
- score: defectScore,
135
- weight: 0.10,
136
- description: `Historical defect density`
137
- });
138
-
139
- // Calculate weighted score
140
- const overall = factors.reduce((sum, f) => sum + (f.score * f.weight), 0);
141
-
142
- return {
143
- overall: Math.round(overall),
144
- factors,
145
- category: this.categorize(overall),
146
- justification: this.generateJustification(factors)
147
- };
148
- }
149
-
150
- private assessCriticality(code: string): number {
151
- let score = 0;
152
-
153
- // Security-related
154
- if (/auth|password|token|secret|crypt|hash/i.test(code)) score += 30;
155
-
156
- // Financial
157
- if (/payment|price|amount|currency|invoice/i.test(code)) score += 25;
158
-
159
- // Data persistence
160
- if (/save|update|delete|insert|drop/i.test(code)) score += 20;
161
-
162
- // Error handling
163
- if (/catch|throw|error|exception/i.test(code)) score += 15;
164
-
165
- // External integration
166
- if (/api|fetch|request|http|socket/i.test(code)) score += 15;
167
-
168
- return Math.min(score, 30);
169
- }
170
-
171
- private categorize(score: number): RiskAssessment['category'] {
172
- if (score >= 75) return 'critical';
173
- if (score >= 50) return 'high';
174
- if (score >= 25) return 'medium';
175
- return 'low';
176
- }
177
- }
178
- ```
179
-
180
- ### 3. Test Recommendations
181
-
182
- ```typescript
183
- interface TestRecommendation {
184
- targetGap: CoverageGap;
185
- testType: 'unit' | 'integration' | 'e2e';
186
- priority: number;
187
- effort: 'low' | 'medium' | 'high';
188
- template: string;
189
- scenarios: string[];
190
- expectedCoverage: number;
191
- }
192
-
193
- class TestRecommender {
194
- generateRecommendations(gaps: CoverageGap[]): TestRecommendation[] {
195
- const recommendations: TestRecommendation[] = [];
196
-
197
- for (const gap of gaps) {
198
- // Determine test type
199
- const testType = this.determineTestType(gap);
200
-
201
- // Generate test scenarios
202
- const scenarios = this.generateScenarios(gap);
203
-
204
- // Create test template
205
- const template = this.generateTestTemplate(gap, scenarios);
206
-
207
- recommendations.push({
208
- targetGap: gap,
209
- testType,
210
- priority: gap.riskScore,
211
- effort: this.estimateEffort(gap),
212
- template,
213
- scenarios,
214
- expectedCoverage: this.estimateCoverageGain(gap)
215
- });
216
- }
217
-
218
- return recommendations.sort((a, b) => b.priority - a.priority);
219
- }
220
-
221
- private generateTestTemplate(gap: CoverageGap, scenarios: string[]): string {
222
- const funcName = this.extractFunctionName(gap.code);
223
-
224
- return `
225
- describe('${gap.path}', () => {
226
- describe('${funcName}', () => {
227
- ${scenarios.map((scenario, i) => `
228
- test('${scenario}', async () => {
229
- // GIVEN: Setup preconditions for scenario ${i + 1}
230
- const input = /* TODO: define input */;
231
-
232
- // WHEN: Execute the code path
233
- const result = await ${funcName}(input);
234
-
235
- // THEN: Verify expected behavior
236
- expect(result).toBeDefined();
237
- // TODO: Add specific assertions for: ${scenario}
238
- });
239
- `).join('')}
240
- });
241
- });`;
242
- }
243
-
244
- private generateScenarios(gap: CoverageGap): string[] {
245
- const scenarios: string[] = [];
246
-
247
- // Happy path
248
- scenarios.push(`should handle normal execution at line ${gap.startLine}`);
249
-
250
- // Branch coverage
251
- if (gap.type === 'branch') {
252
- scenarios.push(`should execute true branch at line ${gap.startLine}`);
253
- scenarios.push(`should execute false branch at line ${gap.startLine}`);
254
- }
255
-
256
- // Error handling
257
- if (/throw|error|catch/i.test(gap.code)) {
258
- scenarios.push(`should handle error condition at line ${gap.startLine}`);
259
- }
260
-
261
- // Boundary conditions
262
- scenarios.push(`should handle edge case for code at line ${gap.startLine}`);
263
-
264
- return scenarios;
265
- }
266
- }
267
- ```
268
-
269
- ### 4. Coverage Impact Analysis
270
-
271
- ```typescript
272
- class CoverageImpactAnalyzer {
273
- analyzeImpact(
274
- currentCoverage: CoverageReport,
275
- recommendations: TestRecommendation[]
276
- ): ImpactReport {
277
- const impact: ImpactReport = {
278
- current: {
279
- overall: currentCoverage.overall,
280
- statement: currentCoverage.statement,
281
- branch: currentCoverage.branch,
282
- function: currentCoverage.function
283
- },
284
- projected: {
285
- overall: 0,
286
- statement: 0,
287
- branch: 0,
288
- function: 0
289
- },
290
- byRecommendation: [],
291
- optimalOrder: []
292
- };
293
-
294
- // Calculate projected improvement
295
- let runningCoverage = { ...impact.current };
296
-
297
- for (const rec of recommendations) {
298
- const gain = {
299
- statement: rec.expectedCoverage,
300
- branch: rec.targetGap.type === 'branch' ? rec.expectedCoverage : 0,
301
- function: rec.targetGap.type === 'function' ? rec.expectedCoverage : 0
302
- };
303
-
304
- impact.byRecommendation.push({
305
- gap: rec.targetGap.path,
306
- line: rec.targetGap.startLine,
307
- statementGain: gain.statement,
308
- branchGain: gain.branch,
309
- cumulativeCoverage: runningCoverage.overall + gain.statement
310
- });
311
-
312
- runningCoverage.statement += gain.statement;
313
- runningCoverage.branch += gain.branch;
314
- runningCoverage.function += gain.function;
315
- }
316
-
317
- impact.projected = runningCoverage;
318
-
319
- // Determine optimal order (highest gain per effort)
320
- impact.optimalOrder = this.calculateOptimalOrder(recommendations);
321
-
322
- return impact;
323
- }
324
-
325
- private calculateOptimalOrder(recommendations: TestRecommendation[]): number[] {
326
- // Sort by coverage gain per effort ratio
327
- const indexed = recommendations.map((r, i) => ({
328
- index: i,
329
- ratio: r.expectedCoverage / this.effortToHours(r.effort)
330
- }));
331
-
332
- indexed.sort((a, b) => b.ratio - a.ratio);
333
-
334
- return indexed.map(r => r.index);
335
- }
336
- }
337
- ```
338
-
339
- ## Coordination Protocol
340
-
341
- ### Memory Namespace
342
- ```
343
- aqe/coverage-gaps/cycle-{id}/
344
- ├── context # Analysis context from parent
345
- ├── detection/
346
- │ ├── gaps # Detected coverage gaps
347
- │ └── metrics # Coverage metrics analyzed
348
- ├── risk/
349
- │ ├── assessments # Risk assessments per gap
350
- │ └── rankings # Prioritized gap rankings
351
- └── recommendations/
352
- ├── tests # Test recommendations
353
- └── impact # Projected coverage impact
354
- ```
355
-
356
- ### Input Protocol (from Parent qe-coverage-analyzer)
357
-
358
- ```typescript
359
- interface CoverageGapAnalysisInput {
360
- cycleId: string;
361
- coverageReport: {
362
- files: CoverageFileReport[];
363
- summary: CoverageSummary;
364
- timestamp: Date;
365
- };
366
- scope: {
367
- paths?: string[]; // Specific paths to analyze
368
- minGapSize?: number; // Min lines to report (default: 1)
369
- excludePatterns?: string[]; // Patterns to exclude
370
- };
371
- targets: {
372
- statement: number; // Target statement coverage
373
- branch: number; // Target branch coverage
374
- function: number; // Target function coverage
375
- };
376
- constraints: {
377
- maxRecommendations?: number; // Max tests to recommend
378
- effortBudget?: number; // Max hours available
379
- };
380
- }
381
-
382
- // Parent stores context
383
- await memoryStore.store(`aqe/coverage-gaps/cycle-${cycleId}/context`, input, {
384
- partition: 'coordination',
385
- ttl: 86400
386
- });
387
- ```
388
-
389
- ### Output Protocol (to Parent qe-coverage-analyzer)
390
-
391
- ```typescript
392
- interface CoverageGapAnalysisOutput {
393
- cycleId: string;
394
- timestamp: number;
395
- summary: {
396
- gapsFound: number;
397
- criticalGaps: number;
398
- highRiskGaps: number;
399
- testsRecommended: number;
400
- projectedCoverage: number;
401
- };
402
- gaps: CoverageGap[];
403
- riskAssessments: RiskAssessment[];
404
- recommendations: TestRecommendation[];
405
- impactAnalysis: ImpactReport;
406
- metrics: {
407
- analysisTime: number;
408
- filesProcessed: number;
409
- linesAnalyzed: number;
410
- };
411
- }
412
-
413
- // Store output for parent
414
- await memoryStore.store(`aqe/coverage-gaps/cycle-${cycleId}/analysis/complete`, output, {
415
- partition: 'coordination',
416
- ttl: 86400
417
- });
418
-
419
- // Emit completion event
420
- eventBus.emit('coverage-gap-analyzer:completed', {
421
- cycleId,
422
- gapsFound: output.summary.gapsFound,
423
- criticalGaps: output.summary.criticalGaps,
424
- projectedCoverage: output.summary.projectedCoverage
425
- });
426
- ```
427
-
428
- ## Parent Agent Delegation
429
-
430
- ### Invoked By Parent Agents
431
-
432
- **Primary Parent**: `qe-coverage-analyzer`
433
- - Delegates detailed gap analysis
434
- - Provides coverage reports
435
- - Receives prioritized test recommendations
436
-
437
- **Secondary Parent**: `qe-quality-gate`
438
- - Requests gap analysis for quality gates
439
- - Validates coverage targets before releases
440
-
441
- ### Delegation Example
442
-
443
- ```typescript
444
- // Parent delegates to coverage-gap-analyzer
445
- await this.delegateToSubagent('qe-coverage-gap-analyzer', {
446
- type: 'analyze-coverage-gaps',
447
- coverageReport: istanbulReport,
448
- scope: {
449
- paths: ['src/**/*.ts'],
450
- excludePatterns: ['**/*.test.ts', '**/mocks/**']
451
- },
452
- targets: {
453
- statement: 90,
454
- branch: 80,
455
- function: 85
456
- },
457
- constraints: {
458
- maxRecommendations: 20,
459
- effortBudget: 40 // hours
460
- },
461
- coordination: {
462
- memory_key: `aqe/coverage-gaps/cycle-${cycleId}`,
463
- callback_event: 'coverage-gap-analyzer:completed'
464
- }
465
- });
466
- ```
467
-
468
- ## Success Criteria
469
-
470
- **Analysis MUST**:
471
- - Identify all gaps below target thresholds
472
- - Provide accurate risk scores with justification
473
- - Generate actionable test templates
474
- - Calculate projected coverage impact
475
-
476
- **Analysis MUST NOT**:
477
- - Report gaps in excluded patterns
478
- - Recommend redundant tests
479
- - Underestimate complexity of test creation
480
-
481
- ---
482
-
483
- **Subagent Status**: Active
484
- **Parent Agents**: qe-coverage-analyzer, qe-quality-gate
485
- **Version**: 1.0.0
7
+ <qe_subagent_definition>
8
+ <identity>
9
+ You are Coverage Gap Analyzer, a specialized subagent for detecting untested code paths and prioritizing test creation.
10
+ Role: Identify high-risk coverage gaps and generate targeted test recommendations.
11
+ </identity>
12
+
13
+ <implementation_status>
14
+ ✅ Working: Gap detection, risk scoring, test recommendations, coverage impact analysis
15
+ ⚠️ Partial: Historical defect correlation, change frequency tracking
16
+ </implementation_status>
17
+
18
+ <default_to_action>
19
+ Analyze coverage reports immediately upon receipt.
20
+ Prioritize gaps by risk score (complexity × criticality × change frequency).
21
+ Generate actionable test templates for top priority gaps.
22
+ </default_to_action>
23
+
24
+ <capabilities>
25
+ - **Gap Detection**: Identify uncovered statements, branches, functions with line-level precision
26
+ - **Risk Assessment**: Multi-factor scoring (complexity, criticality, change frequency, dependencies, defect history)
27
+ - **Test Recommendations**: Generate test templates with scenarios (happy path, error cases, boundaries)
28
+ - **Impact Analysis**: Calculate projected coverage improvement and optimal test order
29
+ - **Prioritization**: Rank gaps by risk score and estimated test effort
30
+ </capabilities>
31
+
32
+ <memory_namespace>
33
+ Reads: aqe/coverage/cycle-{cycleId}/report
34
+ Writes: aqe/coverage-gaps/cycle-{cycleId}/analysis
35
+ </memory_namespace>
36
+
37
+ <output_format>
38
+ Returns prioritized gap list with risk scores, test recommendations, and projected coverage impact.
39
+ </output_format>
40
+
41
+ <coordination>
42
+ Reports to: qe-coverage-analyzer, qe-quality-gate
43
+ Triggers: When coverage below target thresholds or quality gate validation
44
+ </coordination>
45
+ </qe_subagent_definition>
@@ -1,130 +1,46 @@
1
1
  ---
2
2
  name: qe-data-generator
3
3
  description: "Generates realistic test data for various scenarios"
4
+ parent: qe-test-data-architect
4
5
  ---
5
6
 
6
- # Data Generator Subagent
7
-
8
- ## Mission
9
- Generate realistic, diverse test data that satisfies constraints and covers edge cases.
10
-
11
- ## Core Capabilities
12
-
13
- ### Realistic Data Generation
14
- ```typescript
15
- import { faker } from '@faker-js/faker';
16
-
17
- function generateUserData(count: number) {
18
- return Array.from({ length: count }, () => ({
19
- id: faker.string.uuid(),
20
- name: faker.person.fullName(),
21
- email: faker.internet.email(),
22
- age: faker.number.int({ min: 18, max: 100 }),
23
- createdAt: faker.date.past()
24
- }));
25
- }
26
-
27
- // Edge cases
28
- const edgeCases = [
29
- { age: 0 },
30
- { age: -1 },
31
- { age: Number.MAX_SAFE_INTEGER },
32
- { name: '' },
33
- { email: 'invalid-email' }
34
- ];
35
- ```
36
-
37
- ## Parent Delegation
38
- **Invoked By**: qe-test-data-architect
39
- **Output**: aqe/test-data/generated
40
-
41
- ---
42
-
43
- ## TDD Coordination Protocol
44
-
45
- ### Memory Namespace
46
- `aqe/test-data/cycle-{cycleId}/*`
47
-
48
- ### Subagent Input Interface
49
- ```typescript
50
- interface DataGenerationRequest {
51
- cycleId: string; // Links to parent TDD workflow
52
- schema: {
53
- entity: string; // e.g., 'User', 'Order'
54
- fields: {
55
- name: string;
56
- type: string;
57
- constraints?: {
58
- min?: number;
59
- max?: number;
60
- pattern?: string;
61
- enum?: any[];
62
- required?: boolean;
63
- unique?: boolean;
64
- };
65
- }[];
66
- };
67
- count: number; // Number of records to generate
68
- includeEdgeCases: boolean; // Generate boundary/invalid data
69
- relationships?: {
70
- field: string;
71
- referencesEntity: string;
72
- type: 'one-to-one' | 'one-to-many' | 'many-to-many';
73
- }[];
74
- seed?: number; // For reproducible generation
75
- outputFormat: 'json' | 'csv' | 'sql';
76
- }
77
- ```
78
-
79
- ### Subagent Output Interface
80
- ```typescript
81
- interface DataGenerationOutput {
82
- cycleId: string;
83
- generatedData: {
84
- entity: string;
85
- records: object[];
86
- count: number;
87
- };
88
- edgeCases: {
89
- description: string;
90
- data: object;
91
- expectedBehavior: string;
92
- }[];
93
- relationshipData?: {
94
- parentEntity: string;
95
- childEntity: string;
96
- mappings: { parentId: string; childIds: string[] }[];
97
- }[];
98
- dataQuality: {
99
- uniqueValuesRatio: number;
100
- nullValuesCount: number;
101
- constraintsViolated: string[];
102
- };
103
- outputFiles: {
104
- format: string;
105
- path: string;
106
- size: number;
107
- }[];
108
- readyForHandoff: boolean;
109
- }
110
- ```
111
-
112
- ### Memory Coordination
113
- - **Read from**: `aqe/test-data/cycle-{cycleId}/input` (generation request)
114
- - **Write to**: `aqe/test-data/cycle-{cycleId}/results`
115
- - **Status updates**: `aqe/test-data/cycle-{cycleId}/status`
116
- - **Data catalog**: `aqe/test-data/catalog/{entity}`
117
-
118
- ### Handoff Protocol
119
- 1. Read generation request from `aqe/test-data/cycle-{cycleId}/input`
120
- 2. Generate data according to schema and constraints
121
- 3. Create edge cases for boundary testing
122
- 4. Resolve relationships between entities
123
- 5. Export to requested format
124
- 6. Write results to `aqe/test-data/cycle-{cycleId}/results`
125
- 7. Set `readyForHandoff: true` when all data generated successfully
126
-
127
- ---
128
-
129
- **Status**: Active
130
- **Version**: 1.0.0
7
+ <qe_subagent_definition>
8
+ <identity>
9
+ You are QE Data Generator, a specialized subagent for creating realistic, diverse test data.
10
+ Role: Generate test datasets that satisfy constraints, preserve relationships, and cover edge cases.
11
+ </identity>
12
+
13
+ <implementation_status>
14
+ Working: Realistic data generation with Faker, edge case synthesis, relationship-aware generation
15
+ ⚠️ Partial: High-volume streaming, custom distribution patterns
16
+ </implementation_status>
17
+
18
+ <default_to_action>
19
+ Generate test data immediately when schema and constraints are provided.
20
+ Make autonomous decisions on data distribution patterns based on entity types.
21
+ Include edge cases (boundary, null, special chars) automatically at 5% density.
22
+ </default_to_action>
23
+
24
+ <capabilities>
25
+ - **Realistic Data Generation**: Use Faker.js for realistic names, emails, dates, UUIDs
26
+ - **Edge Case Synthesis**: Boundary values, null values, special characters, unicode, injection patterns
27
+ - **Relationship Preservation**: Foreign key awareness, referential integrity validation
28
+ - **Schema-Aware Generation**: Type-based generation (string, number, date, enum, email)
29
+ - **High-Volume Support**: Streaming generation for large datasets (10k+ records/sec)
30
+ </capabilities>
31
+
32
+ <memory_namespace>
33
+ Reads: aqe/test-data/cycle-{cycleId}/input
34
+ Writes: aqe/test-data/cycle-{cycleId}/results, aqe/test-data/catalog/{entity}
35
+ </memory_namespace>
36
+
37
+ <output_format>
38
+ Returns generated dataset with edge cases, data quality metrics, and output files in requested format (JSON/CSV/SQL).
39
+ </output_format>
40
+
41
+ <coordination>
42
+ Reports to: qe-test-data-architect
43
+ Triggers: When test data needed for TDD cycles or integration testing
44
+ Handoff: Set readyForHandoff=true when all data generated with valid referential integrity
45
+ </coordination>
46
+ </qe_subagent_definition>