qaa-agent 1.6.2 → 1.6.3

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 (73) hide show
  1. package/.claude/commands/create-test.md +164 -164
  2. package/.claude/commands/qa-audit.md +37 -37
  3. package/.claude/commands/qa-blueprint.md +54 -54
  4. package/.claude/commands/qa-fix.md +36 -36
  5. package/.claude/commands/qa-from-ticket.md +24 -24
  6. package/.claude/commands/qa-gap.md +20 -20
  7. package/.claude/commands/qa-map.md +47 -47
  8. package/.claude/commands/qa-pom.md +36 -36
  9. package/.claude/commands/qa-pr.md +23 -23
  10. package/.claude/commands/qa-pyramid.md +37 -37
  11. package/.claude/commands/qa-report.md +38 -38
  12. package/.claude/commands/qa-research.md +33 -33
  13. package/.claude/commands/qa-start.md +22 -22
  14. package/.claude/commands/qa-testid.md +19 -19
  15. package/.claude/commands/qa-validate.md +42 -42
  16. package/.claude/commands/update-test.md +58 -58
  17. package/.claude/settings.json +20 -20
  18. package/.claude/skills/qa-bug-detective/SKILL.md +122 -122
  19. package/.claude/skills/qa-learner/SKILL.md +150 -150
  20. package/.claude/skills/qa-repo-analyzer/SKILL.md +88 -88
  21. package/.claude/skills/qa-self-validator/SKILL.md +109 -109
  22. package/.claude/skills/qa-template-engine/SKILL.md +113 -113
  23. package/.claude/skills/qa-testid-injector/SKILL.md +93 -93
  24. package/.claude/skills/qa-workflow-documenter/SKILL.md +87 -87
  25. package/.mcp.json +8 -8
  26. package/CHANGELOG.md +71 -71
  27. package/CLAUDE.md +553 -553
  28. package/agents/qa-pipeline-orchestrator.md +1378 -1378
  29. package/agents/qaa-analyzer.md +524 -524
  30. package/agents/qaa-bug-detective.md +446 -446
  31. package/agents/qaa-codebase-mapper.md +935 -935
  32. package/agents/qaa-e2e-runner.md +415 -415
  33. package/agents/qaa-executor.md +651 -651
  34. package/agents/qaa-planner.md +390 -390
  35. package/agents/qaa-project-researcher.md +319 -319
  36. package/agents/qaa-scanner.md +424 -424
  37. package/agents/qaa-testid-injector.md +585 -585
  38. package/agents/qaa-validator.md +452 -452
  39. package/bin/install.cjs +198 -198
  40. package/bin/lib/commands.cjs +709 -709
  41. package/bin/lib/config.cjs +307 -307
  42. package/bin/lib/core.cjs +497 -497
  43. package/bin/lib/frontmatter.cjs +299 -299
  44. package/bin/lib/init.cjs +989 -989
  45. package/bin/lib/milestone.cjs +241 -241
  46. package/bin/lib/model-profiles.cjs +60 -60
  47. package/bin/lib/phase.cjs +911 -911
  48. package/bin/lib/roadmap.cjs +306 -306
  49. package/bin/lib/state.cjs +748 -748
  50. package/bin/lib/template.cjs +222 -222
  51. package/bin/lib/verify.cjs +842 -842
  52. package/bin/qaa-tools.cjs +607 -607
  53. package/docs/COMMANDS.md +341 -341
  54. package/docs/DEMO.md +182 -182
  55. package/docs/TESTING.md +156 -156
  56. package/package.json +41 -41
  57. package/templates/failure-classification.md +391 -391
  58. package/templates/gap-analysis.md +409 -409
  59. package/templates/pr-template.md +48 -48
  60. package/templates/qa-analysis.md +381 -381
  61. package/templates/qa-audit-report.md +465 -465
  62. package/templates/qa-repo-blueprint.md +636 -636
  63. package/templates/scan-manifest.md +312 -312
  64. package/templates/test-inventory.md +582 -582
  65. package/templates/testid-audit-report.md +354 -354
  66. package/templates/validation-report.md +243 -243
  67. package/workflows/qa-analyze.md +296 -296
  68. package/workflows/qa-from-ticket.md +536 -536
  69. package/workflows/qa-gap.md +303 -303
  70. package/workflows/qa-pr.md +389 -389
  71. package/workflows/qa-start.md +1168 -1168
  72. package/workflows/qa-testid.md +356 -356
  73. package/workflows/qa-validate.md +295 -295
@@ -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>