qaa-agent 1.6.2 → 1.7.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 (78) hide show
  1. package/.mcp.json +8 -8
  2. package/CHANGELOG.md +93 -71
  3. package/CLAUDE.md +553 -553
  4. package/agents/qa-pipeline-orchestrator.md +1378 -1378
  5. package/agents/qaa-analyzer.md +539 -524
  6. package/agents/qaa-bug-detective.md +479 -446
  7. package/agents/qaa-codebase-mapper.md +935 -935
  8. package/agents/qaa-discovery.md +384 -0
  9. package/agents/qaa-e2e-runner.md +416 -415
  10. package/agents/qaa-executor.md +651 -651
  11. package/agents/qaa-planner.md +405 -390
  12. package/agents/qaa-project-researcher.md +319 -319
  13. package/agents/qaa-scanner.md +424 -424
  14. package/agents/qaa-testid-injector.md +643 -585
  15. package/agents/qaa-validator.md +490 -452
  16. package/bin/install.cjs +200 -198
  17. package/bin/lib/commands.cjs +709 -709
  18. package/bin/lib/config.cjs +307 -307
  19. package/bin/lib/core.cjs +497 -497
  20. package/bin/lib/frontmatter.cjs +299 -299
  21. package/bin/lib/init.cjs +989 -989
  22. package/bin/lib/milestone.cjs +241 -241
  23. package/bin/lib/model-profiles.cjs +60 -60
  24. package/bin/lib/phase.cjs +911 -911
  25. package/bin/lib/roadmap.cjs +306 -306
  26. package/bin/lib/state.cjs +748 -748
  27. package/bin/lib/template.cjs +222 -222
  28. package/bin/lib/verify.cjs +842 -842
  29. package/bin/qaa-tools.cjs +607 -607
  30. package/commands/qa-audit.md +119 -0
  31. package/commands/qa-create-test.md +288 -0
  32. package/commands/qa-fix.md +147 -0
  33. package/commands/qa-map.md +137 -0
  34. package/{.claude/commands → commands}/qa-pr.md +23 -23
  35. package/{.claude/commands → commands}/qa-start.md +22 -22
  36. package/{.claude/commands → commands}/qa-testid.md +19 -19
  37. package/docs/COMMANDS.md +341 -341
  38. package/docs/DEMO.md +182 -182
  39. package/docs/TESTING.md +156 -156
  40. package/package.json +6 -7
  41. package/{.claude/settings.json → settings.json} +1 -2
  42. package/templates/failure-classification.md +391 -391
  43. package/templates/gap-analysis.md +409 -409
  44. package/templates/pr-template.md +48 -48
  45. package/templates/qa-analysis.md +381 -381
  46. package/templates/qa-audit-report.md +465 -465
  47. package/templates/qa-repo-blueprint.md +636 -636
  48. package/templates/scan-manifest.md +312 -312
  49. package/templates/test-inventory.md +582 -582
  50. package/templates/testid-audit-report.md +354 -354
  51. package/templates/validation-report.md +243 -243
  52. package/workflows/qa-analyze.md +296 -296
  53. package/workflows/qa-from-ticket.md +536 -536
  54. package/workflows/qa-gap.md +309 -303
  55. package/workflows/qa-pr.md +389 -389
  56. package/workflows/qa-start.md +1192 -1168
  57. package/workflows/qa-testid.md +384 -356
  58. package/workflows/qa-validate.md +299 -295
  59. package/.claude/commands/create-test.md +0 -164
  60. package/.claude/commands/qa-audit.md +0 -37
  61. package/.claude/commands/qa-blueprint.md +0 -54
  62. package/.claude/commands/qa-fix.md +0 -36
  63. package/.claude/commands/qa-from-ticket.md +0 -24
  64. package/.claude/commands/qa-gap.md +0 -20
  65. package/.claude/commands/qa-map.md +0 -47
  66. package/.claude/commands/qa-pom.md +0 -36
  67. package/.claude/commands/qa-pyramid.md +0 -37
  68. package/.claude/commands/qa-report.md +0 -38
  69. package/.claude/commands/qa-research.md +0 -33
  70. package/.claude/commands/qa-validate.md +0 -42
  71. package/.claude/commands/update-test.md +0 -58
  72. package/.claude/skills/qa-learner/SKILL.md +0 -150
  73. /package/{.claude/skills → skills}/qa-bug-detective/SKILL.md +0 -0
  74. /package/{.claude/skills → skills}/qa-repo-analyzer/SKILL.md +0 -0
  75. /package/{.claude/skills → skills}/qa-self-validator/SKILL.md +0 -0
  76. /package/{.claude/skills → skills}/qa-template-engine/SKILL.md +0 -0
  77. /package/{.claude/skills → skills}/qa-testid-injector/SKILL.md +0 -0
  78. /package/{.claude/skills → skills}/qa-workflow-documenter/SKILL.md +0 -0
@@ -1,296 +1,296 @@
1
- <purpose>
2
- Analysis-only workflow. Scans a developer repository (and optionally a QA repository) to produce comprehensive analysis artifacts -- SCAN_MANIFEST.md, QA_ANALYSIS.md, TEST_INVENTORY.md, and optionally QA_REPO_BLUEPRINT.md or GAP_ANALYSIS.md. No test generation, no git operations, no PR. Use this workflow to understand a codebase's testability before committing to full test generation.
3
- </purpose>
4
-
5
- <required_reading>
6
- - `CLAUDE.md` -- QA automation standards, pipeline stages, module boundaries, verification commands
7
- - `agents/qaa-scanner.md` -- Scanner agent definition (produces SCAN_MANIFEST.md)
8
- - `agents/qaa-analyzer.md` -- Analyzer agent definition (produces QA_ANALYSIS.md, TEST_INVENTORY.md, QA_REPO_BLUEPRINT.md or GAP_ANALYSIS.md)
9
- - `templates/scan-manifest.md` -- SCAN_MANIFEST.md format contract
10
- - `templates/qa-analysis.md` -- QA_ANALYSIS.md format contract
11
- - `templates/test-inventory.md` -- TEST_INVENTORY.md format contract
12
- - `templates/qa-repo-blueprint.md` -- QA_REPO_BLUEPRINT.md format contract (Option 1 only)
13
- - `templates/gap-analysis.md` -- GAP_ANALYSIS.md format contract (Option 2/3 only)
14
- </required_reading>
15
-
16
- <process>
17
-
18
- <step name="parse_arguments">
19
- ## Step 1: Parse Arguments
20
-
21
- Parse `$ARGUMENTS` for repository paths.
22
-
23
- **Supported arguments:**
24
- - `--dev-repo <path>` -- Path to the developer repository to analyze
25
- - `--qa-repo <path>` -- Path to an existing QA repository (optional)
26
- - No arguments -- defaults to the current working directory as the dev repo
27
-
28
- **Parsing logic:**
29
-
30
- ```bash
31
- DEV_REPO=""
32
- QA_REPO=""
33
-
34
- # Parse --dev-repo and --qa-repo from $ARGUMENTS
35
- # If --dev-repo is provided, use it
36
- # If --qa-repo is provided, use it
37
- # If neither is provided, DEV_REPO defaults to current working directory
38
- ```
39
-
40
- **Validation:**
41
- - If `--dev-repo` is provided, verify the path exists and is a directory. If not, print error: `"Error: Dev repo path does not exist: {path}"` and STOP.
42
- - If `--qa-repo` is provided, verify the path exists and is a directory. If not, print error: `"Error: QA repo path does not exist: {path}"` and STOP.
43
- - If no arguments provided, set `DEV_REPO` to the current working directory.
44
- </step>
45
-
46
- <step name="determine_mode">
47
- ## Step 2: Determine Analysis Mode
48
-
49
- Set the workflow option based on whether a QA repo was provided.
50
-
51
- **Mode selection:**
52
-
53
- | QA Repo Provided | Mode | Description |
54
- |-------------------|------|-------------|
55
- | No | `full` (Option 1) | Dev-only analysis. Produces QA_ANALYSIS.md + TEST_INVENTORY.md + QA_REPO_BLUEPRINT.md |
56
- | Yes | `gap` (Option 2/3) | Gap analysis. Produces QA_ANALYSIS.md + TEST_INVENTORY.md + GAP_ANALYSIS.md |
57
-
58
- ```
59
- MODE="full"
60
- if QA_REPO is not empty:
61
- MODE="gap"
62
- ```
63
-
64
- **Set output directory:**
65
-
66
- ```bash
67
- OUTPUT_DIR=".qa-output"
68
- mkdir -p "${OUTPUT_DIR}"
69
- ```
70
-
71
- **Print analysis banner:**
72
-
73
- ```
74
- === QA Analysis Workflow ===
75
- Mode: {MODE} ({description})
76
- Dev Repo: {DEV_REPO}
77
- QA Repo: {QA_REPO or 'N/A'}
78
- Output: {OUTPUT_DIR}
79
- ============================
80
- ```
81
- </step>
82
-
83
- <step name="run_scanner">
84
- ## Step 3: Spawn Scanner Agent
85
-
86
- Spawn the scanner agent to produce SCAN_MANIFEST.md.
87
-
88
- **For full mode (Option 1):**
89
-
90
- ```
91
- Task(
92
- prompt="
93
- <objective>Scan repository and produce SCAN_MANIFEST.md</objective>
94
- <execution_context>@agents/qaa-scanner.md</execution_context>
95
- <files_to_read>
96
- - CLAUDE.md
97
- </files_to_read>
98
- <parameters>
99
- dev_repo_path: {DEV_REPO}
100
- qa_repo_path: null
101
- output_path: {OUTPUT_DIR}/SCAN_MANIFEST.md
102
- </parameters>
103
- "
104
- )
105
- ```
106
-
107
- **For gap mode (Option 2/3):**
108
-
109
- ```
110
- Task(
111
- prompt="
112
- <objective>Scan both developer and QA repositories and produce SCAN_MANIFEST.md</objective>
113
- <execution_context>@agents/qaa-scanner.md</execution_context>
114
- <files_to_read>
115
- - CLAUDE.md
116
- </files_to_read>
117
- <parameters>
118
- dev_repo_path: {DEV_REPO}
119
- qa_repo_path: {QA_REPO}
120
- output_path: {OUTPUT_DIR}/SCAN_MANIFEST.md
121
- </parameters>
122
- "
123
- )
124
- ```
125
-
126
- **Handle scanner return:**
127
-
128
- - If scanner returns `decision: STOP` -- print the stop reason and STOP the workflow. The repository has no testable surfaces or an uncertain framework.
129
- - If scanner returns `decision: PROCEED` -- continue to next step.
130
- - Extract `has_frontend` and `detection_confidence` from scanner return for use in the summary.
131
-
132
- **Verify SCAN_MANIFEST.md exists:**
133
-
134
- ```bash
135
- [ -f "${OUTPUT_DIR}/SCAN_MANIFEST.md" ] && echo "FOUND" || echo "MISSING"
136
- ```
137
-
138
- If missing, print error: `"Error: Scanner did not produce SCAN_MANIFEST.md. Check scanner output for details."` and STOP.
139
- </step>
140
-
141
- <step name="run_analyzer">
142
- ## Step 4: Spawn Analyzer Agent
143
-
144
- Spawn the analyzer agent to produce analysis artifacts.
145
-
146
- **For full mode (Option 1):**
147
-
148
- ```
149
- Task(
150
- prompt="
151
- <objective>Analyze scanned repository and produce QA_ANALYSIS.md, TEST_INVENTORY.md, and QA_REPO_BLUEPRINT.md</objective>
152
- <execution_context>@agents/qaa-analyzer.md</execution_context>
153
- <files_to_read>
154
- - {OUTPUT_DIR}/SCAN_MANIFEST.md
155
- - CLAUDE.md
156
- </files_to_read>
157
- <parameters>
158
- workflow_option: 1
159
- qa_analysis_path: {OUTPUT_DIR}/QA_ANALYSIS.md
160
- test_inventory_path: {OUTPUT_DIR}/TEST_INVENTORY.md
161
- blueprint_path: {OUTPUT_DIR}/QA_REPO_BLUEPRINT.md
162
- </parameters>
163
- "
164
- )
165
- ```
166
-
167
- **For gap mode (Option 2/3):**
168
-
169
- ```
170
- Task(
171
- prompt="
172
- <objective>Analyze scanned repositories and produce QA_ANALYSIS.md, TEST_INVENTORY.md, and GAP_ANALYSIS.md</objective>
173
- <execution_context>@agents/qaa-analyzer.md</execution_context>
174
- <files_to_read>
175
- - {OUTPUT_DIR}/SCAN_MANIFEST.md
176
- - CLAUDE.md
177
- </files_to_read>
178
- <parameters>
179
- workflow_option: 2
180
- qa_analysis_path: {OUTPUT_DIR}/QA_ANALYSIS.md
181
- test_inventory_path: {OUTPUT_DIR}/TEST_INVENTORY.md
182
- gap_analysis_path: {OUTPUT_DIR}/GAP_ANALYSIS.md
183
- </parameters>
184
- "
185
- )
186
- ```
187
-
188
- **Handle analyzer return:**
189
-
190
- - Extract `total_test_count`, `pyramid_breakdown`, and `risk_count` from the analyzer's return values.
191
- - Verify all expected artifacts exist on disk.
192
-
193
- **Verify artifacts exist:**
194
-
195
- ```bash
196
- [ -f "${OUTPUT_DIR}/QA_ANALYSIS.md" ] && echo "FOUND: QA_ANALYSIS.md" || echo "MISSING: QA_ANALYSIS.md"
197
- [ -f "${OUTPUT_DIR}/TEST_INVENTORY.md" ] && echo "FOUND: TEST_INVENTORY.md" || echo "MISSING: TEST_INVENTORY.md"
198
-
199
- # For Option 1 only:
200
- [ -f "${OUTPUT_DIR}/QA_REPO_BLUEPRINT.md" ] && echo "FOUND: QA_REPO_BLUEPRINT.md" || echo "MISSING: QA_REPO_BLUEPRINT.md"
201
-
202
- # For Option 2/3 only:
203
- [ -f "${OUTPUT_DIR}/GAP_ANALYSIS.md" ] && echo "FOUND: GAP_ANALYSIS.md" || echo "MISSING: GAP_ANALYSIS.md"
204
- ```
205
-
206
- If any required artifact is missing, print error with the specific missing file and STOP.
207
- </step>
208
-
209
- <step name="print_summary">
210
- ## Step 5: Print Analysis Summary
211
-
212
- Print a human-readable summary of the analysis results. No git operations are performed.
213
-
214
- **Read QA_ANALYSIS.md to extract summary data:**
215
-
216
- - Count risks by severity: HIGH, MEDIUM, LOW
217
- - Count test cases by pyramid tier from TEST_INVENTORY.md
218
- - Extract Top 10 unit test targets
219
- - Extract architecture overview (framework, language, runtime)
220
-
221
- **Print summary:**
222
-
223
- ```
224
- === Analysis Complete ===
225
-
226
- Architecture:
227
- Framework: {framework}
228
- Language: {language}
229
- Runtime: {runtime}
230
- Frontend: {has_frontend}
231
- Detection Confidence: {detection_confidence}
232
-
233
- Risk Assessment:
234
- HIGH: {high_count}
235
- MEDIUM: {medium_count}
236
- LOW: {low_count}
237
-
238
- Test Case Inventory:
239
- Unit Tests: {unit_count} ({unit_percent}%)
240
- Integration Tests: {integration_count} ({integration_percent}%)
241
- API Tests: {api_count} ({api_percent}%)
242
- E2E Tests: {e2e_count} ({e2e_percent}%)
243
- --------------------------
244
- Total: {total_count}
245
-
246
- Priority Distribution:
247
- P0 (blocks release): {p0_count}
248
- P1 (should fix): {p1_count}
249
- P2 (nice to have): {p2_count}
250
-
251
- Artifacts Produced:
252
- - {OUTPUT_DIR}/SCAN_MANIFEST.md
253
- - {OUTPUT_DIR}/QA_ANALYSIS.md
254
- - {OUTPUT_DIR}/TEST_INVENTORY.md
255
- - {OUTPUT_DIR}/QA_REPO_BLUEPRINT.md (Option 1 only)
256
- - {OUTPUT_DIR}/GAP_ANALYSIS.md (Option 2/3 only)
257
-
258
- No git operations performed. No PR created.
259
- Run the full pipeline with /qa-start to generate tests.
260
- ===========================
261
- ```
262
- </step>
263
-
264
- </process>
265
-
266
- <output>
267
- This workflow produces analysis artifacts only. No test files are generated. No git operations are performed.
268
-
269
- **Artifacts produced:**
270
-
271
- | Artifact | When Produced | Description |
272
- |----------|---------------|-------------|
273
- | SCAN_MANIFEST.md | Always | Repository scan with file tree, framework detection, testable surfaces |
274
- | QA_ANALYSIS.md | Always | Architecture overview, risks, top 10 targets, API targets, testing pyramid |
275
- | TEST_INVENTORY.md | Always | Complete test case inventory with IDs, inputs, expected outcomes |
276
- | QA_REPO_BLUEPRINT.md | Option 1 (no QA repo) | Repository structure, configs, CI/CD strategy for new QA repo |
277
- | GAP_ANALYSIS.md | Option 2/3 (QA repo exists) | Coverage gaps, missing tests, broken tests, quality assessment |
278
-
279
- **No side effects:**
280
- - No git branches created
281
- - No git commits made
282
- - No PRs created
283
- - No test files generated
284
- - No source files modified
285
- </output>
286
-
287
- <error_handling>
288
- | Error | Cause | Action |
289
- |-------|-------|--------|
290
- | Dev repo path does not exist | Invalid --dev-repo argument | Print error with path, STOP |
291
- | QA repo path does not exist | Invalid --qa-repo argument | Print error with path, STOP |
292
- | Scanner returns STOP | No testable surfaces or uncertain framework | Print scanner's reason, STOP |
293
- | SCAN_MANIFEST.md missing after scanner | Scanner failed silently | Print error, STOP |
294
- | Analyzer artifacts missing | Analyzer failed silently | Print error with specific missing file, STOP |
295
- | Framework detection LOW confidence | Ambiguous tech stack | Scanner checkpoints for user confirmation |
296
- </error_handling>
1
+ <purpose>
2
+ Analysis-only workflow. Scans a developer repository (and optionally a QA repository) to produce comprehensive analysis artifacts -- SCAN_MANIFEST.md, QA_ANALYSIS.md, TEST_INVENTORY.md, and optionally QA_REPO_BLUEPRINT.md or GAP_ANALYSIS.md. No test generation, no git operations, no PR. Use this workflow to understand a codebase's testability before committing to full test generation.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ - `CLAUDE.md` -- QA automation standards, pipeline stages, module boundaries, verification commands
7
+ - `agents/qaa-scanner.md` -- Scanner agent definition (produces SCAN_MANIFEST.md)
8
+ - `agents/qaa-analyzer.md` -- Analyzer agent definition (produces QA_ANALYSIS.md, TEST_INVENTORY.md, QA_REPO_BLUEPRINT.md or GAP_ANALYSIS.md)
9
+ - `templates/scan-manifest.md` -- SCAN_MANIFEST.md format contract
10
+ - `templates/qa-analysis.md` -- QA_ANALYSIS.md format contract
11
+ - `templates/test-inventory.md` -- TEST_INVENTORY.md format contract
12
+ - `templates/qa-repo-blueprint.md` -- QA_REPO_BLUEPRINT.md format contract (Option 1 only)
13
+ - `templates/gap-analysis.md` -- GAP_ANALYSIS.md format contract (Option 2/3 only)
14
+ </required_reading>
15
+
16
+ <process>
17
+
18
+ <step name="parse_arguments">
19
+ ## Step 1: Parse Arguments
20
+
21
+ Parse `$ARGUMENTS` for repository paths.
22
+
23
+ **Supported arguments:**
24
+ - `--dev-repo <path>` -- Path to the developer repository to analyze
25
+ - `--qa-repo <path>` -- Path to an existing QA repository (optional)
26
+ - No arguments -- defaults to the current working directory as the dev repo
27
+
28
+ **Parsing logic:**
29
+
30
+ ```bash
31
+ DEV_REPO=""
32
+ QA_REPO=""
33
+
34
+ # Parse --dev-repo and --qa-repo from $ARGUMENTS
35
+ # If --dev-repo is provided, use it
36
+ # If --qa-repo is provided, use it
37
+ # If neither is provided, DEV_REPO defaults to current working directory
38
+ ```
39
+
40
+ **Validation:**
41
+ - If `--dev-repo` is provided, verify the path exists and is a directory. If not, print error: `"Error: Dev repo path does not exist: {path}"` and STOP.
42
+ - If `--qa-repo` is provided, verify the path exists and is a directory. If not, print error: `"Error: QA repo path does not exist: {path}"` and STOP.
43
+ - If no arguments provided, set `DEV_REPO` to the current working directory.
44
+ </step>
45
+
46
+ <step name="determine_mode">
47
+ ## Step 2: Determine Analysis Mode
48
+
49
+ Set the workflow option based on whether a QA repo was provided.
50
+
51
+ **Mode selection:**
52
+
53
+ | QA Repo Provided | Mode | Description |
54
+ |-------------------|------|-------------|
55
+ | No | `full` (Option 1) | Dev-only analysis. Produces QA_ANALYSIS.md + TEST_INVENTORY.md + QA_REPO_BLUEPRINT.md |
56
+ | Yes | `gap` (Option 2/3) | Gap analysis. Produces QA_ANALYSIS.md + TEST_INVENTORY.md + GAP_ANALYSIS.md |
57
+
58
+ ```
59
+ MODE="full"
60
+ if QA_REPO is not empty:
61
+ MODE="gap"
62
+ ```
63
+
64
+ **Set output directory:**
65
+
66
+ ```bash
67
+ OUTPUT_DIR=".qa-output"
68
+ mkdir -p "${OUTPUT_DIR}"
69
+ ```
70
+
71
+ **Print analysis banner:**
72
+
73
+ ```
74
+ === QA Analysis Workflow ===
75
+ Mode: {MODE} ({description})
76
+ Dev Repo: {DEV_REPO}
77
+ QA Repo: {QA_REPO or 'N/A'}
78
+ Output: {OUTPUT_DIR}
79
+ ============================
80
+ ```
81
+ </step>
82
+
83
+ <step name="run_scanner">
84
+ ## Step 3: Spawn Scanner Agent
85
+
86
+ Spawn the scanner agent to produce SCAN_MANIFEST.md.
87
+
88
+ **For full mode (Option 1):**
89
+
90
+ ```
91
+ Task(
92
+ prompt="
93
+ <objective>Scan repository and produce SCAN_MANIFEST.md</objective>
94
+ <execution_context>@agents/qaa-scanner.md</execution_context>
95
+ <files_to_read>
96
+ - CLAUDE.md
97
+ </files_to_read>
98
+ <parameters>
99
+ dev_repo_path: {DEV_REPO}
100
+ qa_repo_path: null
101
+ output_path: {OUTPUT_DIR}/SCAN_MANIFEST.md
102
+ </parameters>
103
+ "
104
+ )
105
+ ```
106
+
107
+ **For gap mode (Option 2/3):**
108
+
109
+ ```
110
+ Task(
111
+ prompt="
112
+ <objective>Scan both developer and QA repositories and produce SCAN_MANIFEST.md</objective>
113
+ <execution_context>@agents/qaa-scanner.md</execution_context>
114
+ <files_to_read>
115
+ - CLAUDE.md
116
+ </files_to_read>
117
+ <parameters>
118
+ dev_repo_path: {DEV_REPO}
119
+ qa_repo_path: {QA_REPO}
120
+ output_path: {OUTPUT_DIR}/SCAN_MANIFEST.md
121
+ </parameters>
122
+ "
123
+ )
124
+ ```
125
+
126
+ **Handle scanner return:**
127
+
128
+ - If scanner returns `decision: STOP` -- print the stop reason and STOP the workflow. The repository has no testable surfaces or an uncertain framework.
129
+ - If scanner returns `decision: PROCEED` -- continue to next step.
130
+ - Extract `has_frontend` and `detection_confidence` from scanner return for use in the summary.
131
+
132
+ **Verify SCAN_MANIFEST.md exists:**
133
+
134
+ ```bash
135
+ [ -f "${OUTPUT_DIR}/SCAN_MANIFEST.md" ] && echo "FOUND" || echo "MISSING"
136
+ ```
137
+
138
+ If missing, print error: `"Error: Scanner did not produce SCAN_MANIFEST.md. Check scanner output for details."` and STOP.
139
+ </step>
140
+
141
+ <step name="run_analyzer">
142
+ ## Step 4: Spawn Analyzer Agent
143
+
144
+ Spawn the analyzer agent to produce analysis artifacts.
145
+
146
+ **For full mode (Option 1):**
147
+
148
+ ```
149
+ Task(
150
+ prompt="
151
+ <objective>Analyze scanned repository and produce QA_ANALYSIS.md, TEST_INVENTORY.md, and QA_REPO_BLUEPRINT.md</objective>
152
+ <execution_context>@agents/qaa-analyzer.md</execution_context>
153
+ <files_to_read>
154
+ - {OUTPUT_DIR}/SCAN_MANIFEST.md
155
+ - CLAUDE.md
156
+ </files_to_read>
157
+ <parameters>
158
+ workflow_option: 1
159
+ qa_analysis_path: {OUTPUT_DIR}/QA_ANALYSIS.md
160
+ test_inventory_path: {OUTPUT_DIR}/TEST_INVENTORY.md
161
+ blueprint_path: {OUTPUT_DIR}/QA_REPO_BLUEPRINT.md
162
+ </parameters>
163
+ "
164
+ )
165
+ ```
166
+
167
+ **For gap mode (Option 2/3):**
168
+
169
+ ```
170
+ Task(
171
+ prompt="
172
+ <objective>Analyze scanned repositories and produce QA_ANALYSIS.md, TEST_INVENTORY.md, and GAP_ANALYSIS.md</objective>
173
+ <execution_context>@agents/qaa-analyzer.md</execution_context>
174
+ <files_to_read>
175
+ - {OUTPUT_DIR}/SCAN_MANIFEST.md
176
+ - CLAUDE.md
177
+ </files_to_read>
178
+ <parameters>
179
+ workflow_option: 2
180
+ qa_analysis_path: {OUTPUT_DIR}/QA_ANALYSIS.md
181
+ test_inventory_path: {OUTPUT_DIR}/TEST_INVENTORY.md
182
+ gap_analysis_path: {OUTPUT_DIR}/GAP_ANALYSIS.md
183
+ </parameters>
184
+ "
185
+ )
186
+ ```
187
+
188
+ **Handle analyzer return:**
189
+
190
+ - Extract `total_test_count`, `pyramid_breakdown`, and `risk_count` from the analyzer's return values.
191
+ - Verify all expected artifacts exist on disk.
192
+
193
+ **Verify artifacts exist:**
194
+
195
+ ```bash
196
+ [ -f "${OUTPUT_DIR}/QA_ANALYSIS.md" ] && echo "FOUND: QA_ANALYSIS.md" || echo "MISSING: QA_ANALYSIS.md"
197
+ [ -f "${OUTPUT_DIR}/TEST_INVENTORY.md" ] && echo "FOUND: TEST_INVENTORY.md" || echo "MISSING: TEST_INVENTORY.md"
198
+
199
+ # For Option 1 only:
200
+ [ -f "${OUTPUT_DIR}/QA_REPO_BLUEPRINT.md" ] && echo "FOUND: QA_REPO_BLUEPRINT.md" || echo "MISSING: QA_REPO_BLUEPRINT.md"
201
+
202
+ # For Option 2/3 only:
203
+ [ -f "${OUTPUT_DIR}/GAP_ANALYSIS.md" ] && echo "FOUND: GAP_ANALYSIS.md" || echo "MISSING: GAP_ANALYSIS.md"
204
+ ```
205
+
206
+ If any required artifact is missing, print error with the specific missing file and STOP.
207
+ </step>
208
+
209
+ <step name="print_summary">
210
+ ## Step 5: Print Analysis Summary
211
+
212
+ Print a human-readable summary of the analysis results. No git operations are performed.
213
+
214
+ **Read QA_ANALYSIS.md to extract summary data:**
215
+
216
+ - Count risks by severity: HIGH, MEDIUM, LOW
217
+ - Count test cases by pyramid tier from TEST_INVENTORY.md
218
+ - Extract Top 10 unit test targets
219
+ - Extract architecture overview (framework, language, runtime)
220
+
221
+ **Print summary:**
222
+
223
+ ```
224
+ === Analysis Complete ===
225
+
226
+ Architecture:
227
+ Framework: {framework}
228
+ Language: {language}
229
+ Runtime: {runtime}
230
+ Frontend: {has_frontend}
231
+ Detection Confidence: {detection_confidence}
232
+
233
+ Risk Assessment:
234
+ HIGH: {high_count}
235
+ MEDIUM: {medium_count}
236
+ LOW: {low_count}
237
+
238
+ Test Case Inventory:
239
+ Unit Tests: {unit_count} ({unit_percent}%)
240
+ Integration Tests: {integration_count} ({integration_percent}%)
241
+ API Tests: {api_count} ({api_percent}%)
242
+ E2E Tests: {e2e_count} ({e2e_percent}%)
243
+ --------------------------
244
+ Total: {total_count}
245
+
246
+ Priority Distribution:
247
+ P0 (blocks release): {p0_count}
248
+ P1 (should fix): {p1_count}
249
+ P2 (nice to have): {p2_count}
250
+
251
+ Artifacts Produced:
252
+ - {OUTPUT_DIR}/SCAN_MANIFEST.md
253
+ - {OUTPUT_DIR}/QA_ANALYSIS.md
254
+ - {OUTPUT_DIR}/TEST_INVENTORY.md
255
+ - {OUTPUT_DIR}/QA_REPO_BLUEPRINT.md (Option 1 only)
256
+ - {OUTPUT_DIR}/GAP_ANALYSIS.md (Option 2/3 only)
257
+
258
+ No git operations performed. No PR created.
259
+ Run the full pipeline with /qa-start to generate tests.
260
+ ===========================
261
+ ```
262
+ </step>
263
+
264
+ </process>
265
+
266
+ <output>
267
+ This workflow produces analysis artifacts only. No test files are generated. No git operations are performed.
268
+
269
+ **Artifacts produced:**
270
+
271
+ | Artifact | When Produced | Description |
272
+ |----------|---------------|-------------|
273
+ | SCAN_MANIFEST.md | Always | Repository scan with file tree, framework detection, testable surfaces |
274
+ | QA_ANALYSIS.md | Always | Architecture overview, risks, top 10 targets, API targets, testing pyramid |
275
+ | TEST_INVENTORY.md | Always | Complete test case inventory with IDs, inputs, expected outcomes |
276
+ | QA_REPO_BLUEPRINT.md | Option 1 (no QA repo) | Repository structure, configs, CI/CD strategy for new QA repo |
277
+ | GAP_ANALYSIS.md | Option 2/3 (QA repo exists) | Coverage gaps, missing tests, broken tests, quality assessment |
278
+
279
+ **No side effects:**
280
+ - No git branches created
281
+ - No git commits made
282
+ - No PRs created
283
+ - No test files generated
284
+ - No source files modified
285
+ </output>
286
+
287
+ <error_handling>
288
+ | Error | Cause | Action |
289
+ |-------|-------|--------|
290
+ | Dev repo path does not exist | Invalid --dev-repo argument | Print error with path, STOP |
291
+ | QA repo path does not exist | Invalid --qa-repo argument | Print error with path, STOP |
292
+ | Scanner returns STOP | No testable surfaces or uncertain framework | Print scanner's reason, STOP |
293
+ | SCAN_MANIFEST.md missing after scanner | Scanner failed silently | Print error, STOP |
294
+ | Analyzer artifacts missing | Analyzer failed silently | Print error with specific missing file, STOP |
295
+ | Framework detection LOW confidence | Ambiguous tech stack | Scanner checkpoints for user confirmation |
296
+ </error_handling>