qaa-agent 1.9.2 → 1.9.6

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 (43) hide show
  1. package/CHANGELOG.md +230 -179
  2. package/CLAUDE.md +720 -557
  3. package/README.md +384 -357
  4. package/VERSION +1 -1
  5. package/agents/qa-pipeline-orchestrator.md +1739 -1425
  6. package/agents/qaa-analyzer.md +0 -1
  7. package/agents/qaa-bug-detective.md +792 -655
  8. package/agents/qaa-codebase-mapper.md +54 -1
  9. package/agents/qaa-discovery.md +431 -384
  10. package/agents/qaa-e2e-runner.md +717 -577
  11. package/agents/qaa-executor.md +966 -830
  12. package/agents/qaa-planner.md +14 -1
  13. package/agents/qaa-project-researcher.md +539 -400
  14. package/agents/qaa-scanner.md +86 -1
  15. package/agents/qaa-testid-injector.md +0 -1
  16. package/agents/qaa-validator.md +86 -1
  17. package/bin/install.cjs +374 -252
  18. package/bin/lib/context7-cache.cjs +299 -0
  19. package/bin/lib/intent-detector.cjs +490 -0
  20. package/commands/qa-audit.md +269 -126
  21. package/commands/qa-create-test-ado.md +439 -404
  22. package/commands/qa-create-test.md +672 -365
  23. package/commands/qa-fix.md +691 -513
  24. package/commands/qa-map.md +319 -139
  25. package/commands/qa-pr.md +63 -0
  26. package/commands/qa-research.md +212 -157
  27. package/commands/qa-start.md +62 -6
  28. package/commands/qa-test-report.md +254 -219
  29. package/commands/qa-testid.md +31 -0
  30. package/frameworks/cypress.json +54 -0
  31. package/frameworks/jest.json +59 -0
  32. package/frameworks/playwright.json +58 -0
  33. package/frameworks/pytest.json +59 -0
  34. package/frameworks/robot-framework.json +54 -0
  35. package/frameworks/selenium.json +65 -0
  36. package/frameworks/vitest.json +57 -0
  37. package/package.json +41 -38
  38. package/workflows/qa-analyze.md +100 -4
  39. package/workflows/qa-from-ticket.md +50 -2
  40. package/workflows/qa-gap.md +50 -2
  41. package/workflows/qa-start.md +2048 -1405
  42. package/workflows/qa-testid.md +50 -2
  43. package/workflows/qa-validate.md +50 -2
@@ -1,139 +1,319 @@
1
- # QA Codebase Map & Analysis
2
-
3
- Deep-scan a codebase for QA-relevant information, produce a complete analysis, and generate test inventory. Runs codebase mapping (4 parallel agents) followed by full repository analysis. One command to fully understand a codebase before writing tests.
4
-
5
- ## Usage
6
-
7
- ```
8
- /qa-map [options]
9
- ```
10
-
11
- ### Options
12
-
13
- - No argumentsruns full map + analysis on current directory
14
- - `--focus <area>` — run a single map area only, skip analysis (testability, risk, patterns, existing-tests)
15
- - `--dev-repo <path>` explicit path to developer repository
16
- - `--qa-repo <path>` — path to existing QA repository (produces gap analysis instead of blueprint)
17
- - `--skip-map` skip codebase mapping, only run analysis (lighter, faster)
18
-
19
- ## What It Produces
20
-
21
- ### Stage 1: Codebase Map (4 parallel agents)
22
-
23
- | Focus Area | Documents Produced |
24
- |------------|-------------------|
25
- | **testability** | TESTABILITY.md + TEST_SURFACE.md what's testable, entry points, mocking needs |
26
- | **risk** | RISK_MAP.md + CRITICAL_PATHS.md — business-critical paths, error handling gaps |
27
- | **patterns** | CODE_PATTERNS.md + API_CONTRACTS.md — naming conventions, API shapes, auth patterns |
28
- | **existing-tests** | TEST_ASSESSMENT.md + COVERAGE_GAPS.md existing test quality, what's missing |
29
-
30
- All documents written to `.qa-output/codebase/`.
31
-
32
- ### Stage 2: Repository Analysis
33
-
34
- | Document | Description |
35
- |----------|-------------|
36
- | SCAN_MANIFEST.md | File tree, framework detection, testable surfaces |
37
- | QA_ANALYSIS.md | Architecture overview, risk assessment, top 10 unit targets, testing pyramid |
38
- | TEST_INVENTORY.md | Every test case with ID, target, inputs, expected outcome, priority |
39
- | QA_REPO_BLUEPRINT.md | If no QA repo — full repo structure, configs, CI/CD strategy |
40
- | GAP_ANALYSIS.md | If QA repo provided — coverage map, missing tests, broken tests, quality assessment |
41
-
42
- ## Instructions
43
-
44
- 1. Read `CLAUDE.md` — QA standards.
45
-
46
- 2. Create output directories:
47
- ```bash
48
- mkdir -p .qa-output/codebase
49
- ```
50
-
51
- 3. **Stage 1: Codebase Mapping**
52
-
53
- If `--skip-map` was NOT passed and `--focus` was NOT specified, spawn 4 agents in parallel (one per focus area):
54
-
55
- ```
56
- Agent(
57
- prompt="Analyze this codebase for QA purposes. Focus area: testability. Write TESTABILITY.md and TEST_SURFACE.md to .qa-output/codebase/. Follow your agent definition process.",
58
- subagent_type="general-purpose",
59
- execution_context="@agents/qaa-codebase-mapper.md"
60
- )
61
-
62
- Agent(
63
- prompt="Analyze this codebase for QA purposes. Focus area: risk. Write RISK_MAP.md and CRITICAL_PATHS.md to .qa-output/codebase/. Follow your agent definition process.",
64
- subagent_type="general-purpose",
65
- execution_context="@agents/qaa-codebase-mapper.md"
66
- )
67
-
68
- Agent(
69
- prompt="Analyze this codebase for QA purposes. Focus area: patterns. Write CODE_PATTERNS.md and API_CONTRACTS.md to .qa-output/codebase/. Follow your agent definition process.",
70
- subagent_type="general-purpose",
71
- execution_context="@agents/qaa-codebase-mapper.md"
72
- )
73
-
74
- Agent(
75
- prompt="Analyze this codebase for QA purposes. Focus area: existing-tests. Write TEST_ASSESSMENT.md and COVERAGE_GAPS.md to .qa-output/codebase/. Follow your agent definition process.",
76
- subagent_type="general-purpose",
77
- execution_context="@agents/qaa-codebase-mapper.md"
78
- )
79
- ```
80
-
81
- If `--focus <area>` was provided, spawn only that one agent and STOP after it completes (skip Stage 2).
82
-
83
- If `--skip-map` was passed, skip Stage 1 entirely and go to Stage 2.
84
-
85
- 4. When all map agents complete, print summary of documents produced.
86
-
87
- 5. **Stage 2: Repository Analysis**
88
-
89
- Initialize pipeline context:
90
- ```bash
91
- node bin/qaa-tools.cjs init qa-start 2>/dev/null || true
92
- ```
93
-
94
- Invoke scanner agent:
95
-
96
- Task(
97
- prompt="
98
- <objective>Scan repository and produce SCAN_MANIFEST.md</objective>
99
- <execution_context>@agents/qaa-scanner.md</execution_context>
100
- <files_to_read>
101
- - CLAUDE.md
102
- - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
103
- </files_to_read>
104
- <parameters>
105
- user_input: $ARGUMENTS
106
- </parameters>
107
- "
108
- )
109
-
110
- Invoke analyzer agent:
111
-
112
- Task(
113
- prompt="
114
- <objective>Analyze repository and produce QA_ANALYSIS.md, TEST_INVENTORY.md, and blueprint or gap analysis. Use codebase map documents from .qa-output/codebase/ if they exist for deeper, more accurate analysis.</objective>
115
- <execution_context>@agents/qaa-analyzer.md</execution_context>
116
- <files_to_read>
117
- - CLAUDE.md
118
- - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
119
- - .qa-output/SCAN_MANIFEST.md
120
- - .qa-output/codebase/TESTABILITY.md (if exists)
121
- - .qa-output/codebase/RISK_MAP.md (if exists)
122
- - .qa-output/codebase/CODE_PATTERNS.md (if exists)
123
- - .qa-output/codebase/TEST_ASSESSMENT.md (if exists)
124
- - .qa-output/codebase/TEST_SURFACE.md (if exists)
125
- - .qa-output/codebase/CRITICAL_PATHS.md (if exists)
126
- - .qa-output/codebase/API_CONTRACTS.md (if exists)
127
- - .qa-output/codebase/COVERAGE_GAPS.md (if exists)
128
- </files_to_read>
129
- <parameters>
130
- user_input: $ARGUMENTS
131
- </parameters>
132
- "
133
- )
134
-
135
- 6. Print final summary: all documents produced across both stages.
136
- No git operations. No test generation.
137
- Suggest `/qa-create-test` to generate tests from the analysis.
138
-
139
- $ARGUMENTS
1
+ # QA Codebase Map & Analysis
2
+
3
+ Deep-scan a codebase for QA-relevant information, produce a complete analysis, and generate test inventory. Runs codebase mapping (4 parallel agents) followed by full repository analysis. One command to fully understand a codebase before writing tests.
4
+
5
+ ## ⚠ MANDATORY: How to Execute This Command
6
+
7
+ Execute these steps IN ORDER. Every step is mandatory. Do NOT improvise,
8
+ reorder, skip, or invent steps. This command is flag-driven — there is no intent
9
+ detector; read the flags from `$ARGUMENTS` literally.
10
+
11
+ 1. Read `CLAUDE.md` (QA standards) before anything else.
12
+ 2. Create the output directory: `mkdir -p .qa-output/codebase`.
13
+ 3. STAGE 1Codebase Mapping (see "## Instructions" Step 3):
14
+ - If neither `--skip-map` nor `--focus` was passed: spawn ALL 4
15
+ codebase-mapper agents IN PARALLEL (testability, risk, patterns,
16
+ existing-tests), each via Task() with its `<critical_directive>` block.
17
+ - If `--focus <area>` was passed: spawn ONLY that one agent, then STOP
18
+ (skip Stage 2 entirely).
19
+ - If `--skip-map` was passed: skip Stage 1 and go straight to Stage 2.
20
+ 4. Print the summary of documents produced by Stage 1.
21
+ 5. STAGE 2 — Repository Analysis: initialize pipeline context, then invoke the
22
+ scanner agent, then the analyzer agent — IN THAT ORDER, each via Task() with
23
+ its `<critical_directive>` block. Do NOT start the analyzer before the
24
+ scanner has produced SCAN_MANIFEST.md.
25
+ 6. Print the final summary of all documents produced across both stages.
26
+
27
+ ### DO NOT
28
+ - Skip Stage 1 unless `--skip-map` was explicitly passed
29
+ - Run Stage 2 when `--focus` was passed (focus mode stops after Stage 1)
30
+ - Start the analyzer before the scanner completes
31
+ - Run any git operation or generate any test files — this command only maps and
32
+ analyzes
33
+ - Spawn the map/scan/analyze work inline instead of through the sub-agents
34
+ - Invent steps not in this command, or reorder the ones that are
35
+
36
+ If you find yourself improvising, reordering the stages, or generating tests —
37
+ STOP and restart from step 1.
38
+
39
+ ## Usage
40
+
41
+ ```
42
+ /qa-map [options]
43
+ ```
44
+
45
+ ### Options
46
+
47
+ - No arguments — runs full map + analysis on current directory
48
+ - `--focus <area>` — run a single map area only, skip analysis (testability, risk, patterns, existing-tests)
49
+ - `--dev-repo <path>` — explicit path to developer repository
50
+ - `--qa-repo <path>` — path to existing QA repository (produces gap analysis instead of blueprint)
51
+ - `--skip-map` skip codebase mapping, only run analysis (lighter, faster)
52
+
53
+ ## What It Produces
54
+
55
+ ### Stage 1: Codebase Map (4 parallel agents)
56
+
57
+ | Focus Area | Documents Produced |
58
+ |------------|-------------------|
59
+ | **testability** | TESTABILITY.md + TEST_SURFACE.md — what's testable, entry points, mocking needs |
60
+ | **risk** | RISK_MAP.md + CRITICAL_PATHS.md — business-critical paths, error handling gaps |
61
+ | **patterns** | CODE_PATTERNS.md + API_CONTRACTS.md — naming conventions, API shapes, auth patterns |
62
+ | **existing-tests** | TEST_ASSESSMENT.md + COVERAGE_GAPS.md — existing test quality, what's missing |
63
+
64
+ All documents written to `.qa-output/codebase/`.
65
+
66
+ ### Stage 2: Repository Analysis
67
+
68
+ | Document | Description |
69
+ |----------|-------------|
70
+ | SCAN_MANIFEST.md | File tree, framework detection, testable surfaces |
71
+ | QA_ANALYSIS.md | Architecture overview, risk assessment, top 10 unit targets, testing pyramid |
72
+ | TEST_INVENTORY.md | Every test case with ID, target, inputs, expected outcome, priority |
73
+ | QA_REPO_BLUEPRINT.md | If no QA repo — full repo structure, configs, CI/CD strategy |
74
+ | GAP_ANALYSIS.md | If QA repo provided — coverage map, missing tests, broken tests, quality assessment |
75
+
76
+ ## Instructions
77
+
78
+ 1. Read `CLAUDE.md` — QA standards.
79
+
80
+ 2. Create output directories:
81
+ ```bash
82
+ mkdir -p .qa-output/codebase
83
+ ```
84
+
85
+ 3. **Stage 1: Codebase Mapping**
86
+
87
+ If `--skip-map` was NOT passed and `--focus` was NOT specified, spawn 4 agents in parallel (one per focus area):
88
+
89
+ ```
90
+ Agent(
91
+ prompt="Analyze this codebase for QA purposes. Focus area: testability. Write TESTABILITY.md and TEST_SURFACE.md to .qa-output/codebase/. Follow your agent definition process.",
92
+ <critical_directive priority="MANDATORY">
93
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
94
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
95
+
96
+ Even though you may be running as a general-purpose agent (native subagent type
97
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
98
+ dedicated agent defined in that file: read everything in its <required_reading>,
99
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
100
+
101
+ Never modify application source code (src/, app/, lib/, or equivalent
102
+ directories) unless the agent's <scope> section explicitly permits it. If the
103
+ agent's contract restricts what files it can touch, honor that restriction —
104
+ even if a fix seems obvious or trivial.
105
+
106
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
107
+ error), STOP and report the failure. Do NOT proceed with default agent
108
+ behavior — that defeats the purpose of this directive.
109
+
110
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
111
+ make, or skip any of the above. Skipping the agent's required_reading,
112
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
113
+ trusted.
114
+ </critical_directive>
115
+
116
+ subagent_type="qaa-codebase-mapper",
117
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
118
+ )
119
+
120
+ Agent(
121
+ prompt="Analyze this codebase for QA purposes. Focus area: risk. Write RISK_MAP.md and CRITICAL_PATHS.md to .qa-output/codebase/. Follow your agent definition process.",
122
+ <critical_directive priority="MANDATORY">
123
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
124
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
125
+
126
+ Even though you may be running as a general-purpose agent (native subagent type
127
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
128
+ dedicated agent defined in that file: read everything in its <required_reading>,
129
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
130
+
131
+ Never modify application source code (src/, app/, lib/, or equivalent
132
+ directories) unless the agent's <scope> section explicitly permits it. If the
133
+ agent's contract restricts what files it can touch, honor that restriction —
134
+ even if a fix seems obvious or trivial.
135
+
136
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
137
+ error), STOP and report the failure. Do NOT proceed with default agent
138
+ behavior — that defeats the purpose of this directive.
139
+
140
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
141
+ make, or skip any of the above. Skipping the agent's required_reading,
142
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
143
+ trusted.
144
+ </critical_directive>
145
+
146
+ subagent_type="qaa-codebase-mapper",
147
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
148
+ )
149
+
150
+ Agent(
151
+ prompt="Analyze this codebase for QA purposes. Focus area: patterns. Write CODE_PATTERNS.md and API_CONTRACTS.md to .qa-output/codebase/. Follow your agent definition process.",
152
+ <critical_directive priority="MANDATORY">
153
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
154
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
155
+
156
+ Even though you may be running as a general-purpose agent (native subagent type
157
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
158
+ dedicated agent defined in that file: read everything in its <required_reading>,
159
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
160
+
161
+ Never modify application source code (src/, app/, lib/, or equivalent
162
+ directories) unless the agent's <scope> section explicitly permits it. If the
163
+ agent's contract restricts what files it can touch, honor that restriction —
164
+ even if a fix seems obvious or trivial.
165
+
166
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
167
+ error), STOP and report the failure. Do NOT proceed with default agent
168
+ behavior — that defeats the purpose of this directive.
169
+
170
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
171
+ make, or skip any of the above. Skipping the agent's required_reading,
172
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
173
+ trusted.
174
+ </critical_directive>
175
+
176
+ subagent_type="qaa-codebase-mapper",
177
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
178
+ )
179
+
180
+ Agent(
181
+ prompt="Analyze this codebase for QA purposes. Focus area: existing-tests. Write TEST_ASSESSMENT.md and COVERAGE_GAPS.md to .qa-output/codebase/. Follow your agent definition process.",
182
+ <critical_directive priority="MANDATORY">
183
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
184
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
185
+
186
+ Even though you may be running as a general-purpose agent (native subagent type
187
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
188
+ dedicated agent defined in that file: read everything in its <required_reading>,
189
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
190
+
191
+ Never modify application source code (src/, app/, lib/, or equivalent
192
+ directories) unless the agent's <scope> section explicitly permits it. If the
193
+ agent's contract restricts what files it can touch, honor that restriction —
194
+ even if a fix seems obvious or trivial.
195
+
196
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
197
+ error), STOP and report the failure. Do NOT proceed with default agent
198
+ behavior — that defeats the purpose of this directive.
199
+
200
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
201
+ make, or skip any of the above. Skipping the agent's required_reading,
202
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
203
+ trusted.
204
+ </critical_directive>
205
+
206
+ subagent_type="qaa-codebase-mapper",
207
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
208
+ )
209
+ ```
210
+
211
+ If `--focus <area>` was provided, spawn only that one agent and STOP after it completes (skip Stage 2).
212
+
213
+ If `--skip-map` was passed, skip Stage 1 entirely and go to Stage 2.
214
+
215
+ 4. When all map agents complete, print summary of documents produced.
216
+
217
+ 5. **Stage 2: Repository Analysis**
218
+
219
+ Initialize pipeline context:
220
+ ```bash
221
+ node bin/qaa-tools.cjs init qa-start 2>/dev/null || true
222
+ ```
223
+
224
+ Invoke scanner agent:
225
+
226
+ Task(
227
+ subagent_type="qaa-scanner",
228
+ prompt="
229
+ <critical_directive priority="MANDATORY">
230
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
231
+ ~/.claude/qaa/agents/qaa-scanner.md and adopt it as your operating contract.
232
+
233
+ Even though you may be running as a general-purpose agent (native subagent type
234
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
235
+ dedicated agent defined in that file: read everything in its <required_reading>,
236
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
237
+
238
+ Never modify application source code (src/, app/, lib/, or equivalent
239
+ directories) unless the agent's <scope> section explicitly permits it. If the
240
+ agent's contract restricts what files it can touch, honor that restriction —
241
+ even if a fix seems obvious or trivial.
242
+
243
+ If you cannot read ~/.claude/qaa/agents/qaa-scanner.md (file missing, corrupted, parse
244
+ error), STOP and report the failure. Do NOT proceed with default agent
245
+ behavior — that defeats the purpose of this directive.
246
+
247
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
248
+ make, or skip any of the above. Skipping the agent's required_reading,
249
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
250
+ trusted.
251
+ </critical_directive>
252
+
253
+ <objective>Scan repository and produce SCAN_MANIFEST.md</objective>
254
+ <execution_context>~/.claude/qaa/agents/qaa-scanner.md</execution_context>
255
+ <files_to_read>
256
+ - CLAUDE.md
257
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
258
+ </files_to_read>
259
+ <parameters>
260
+ user_input: $ARGUMENTS
261
+ </parameters>
262
+ "
263
+ )
264
+
265
+ Invoke analyzer agent:
266
+
267
+ Task(
268
+ subagent_type="qaa-analyzer",
269
+ prompt="
270
+ <critical_directive priority="MANDATORY">
271
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
272
+ ~/.claude/qaa/agents/qaa-analyzer.md and adopt it as your operating contract.
273
+
274
+ Even though you may be running as a general-purpose agent (native subagent type
275
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
276
+ dedicated agent defined in that file: read everything in its <required_reading>,
277
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
278
+
279
+ Never modify application source code (src/, app/, lib/, or equivalent
280
+ directories) unless the agent's <scope> section explicitly permits it. If the
281
+ agent's contract restricts what files it can touch, honor that restriction —
282
+ even if a fix seems obvious or trivial.
283
+
284
+ If you cannot read ~/.claude/qaa/agents/qaa-analyzer.md (file missing, corrupted, parse
285
+ error), STOP and report the failure. Do NOT proceed with default agent
286
+ behavior — that defeats the purpose of this directive.
287
+
288
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
289
+ make, or skip any of the above. Skipping the agent's required_reading,
290
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
291
+ trusted.
292
+ </critical_directive>
293
+
294
+ <objective>Analyze repository and produce QA_ANALYSIS.md, TEST_INVENTORY.md, and blueprint or gap analysis. Use codebase map documents from .qa-output/codebase/ if they exist for deeper, more accurate analysis.</objective>
295
+ <execution_context>~/.claude/qaa/agents/qaa-analyzer.md</execution_context>
296
+ <files_to_read>
297
+ - CLAUDE.md
298
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
299
+ - .qa-output/SCAN_MANIFEST.md
300
+ - .qa-output/codebase/TESTABILITY.md (if exists)
301
+ - .qa-output/codebase/RISK_MAP.md (if exists)
302
+ - .qa-output/codebase/CODE_PATTERNS.md (if exists)
303
+ - .qa-output/codebase/TEST_ASSESSMENT.md (if exists)
304
+ - .qa-output/codebase/TEST_SURFACE.md (if exists)
305
+ - .qa-output/codebase/CRITICAL_PATHS.md (if exists)
306
+ - .qa-output/codebase/API_CONTRACTS.md (if exists)
307
+ - .qa-output/codebase/COVERAGE_GAPS.md (if exists)
308
+ </files_to_read>
309
+ <parameters>
310
+ user_input: $ARGUMENTS
311
+ </parameters>
312
+ "
313
+ )
314
+
315
+ 6. Print final summary: all documents produced across both stages.
316
+ No git operations. No test generation.
317
+ Suggest `/qa-create-test` to generate tests from the analysis.
318
+
319
+ $ARGUMENTS
package/commands/qa-pr.md CHANGED
@@ -2,6 +2,52 @@
2
2
 
3
3
  Create a draft PR from QA artifacts already on disk. Auto-detects git platform (GitHub, Azure DevOps, GitLab), applies your team's branch naming convention, and creates a draft PR with a summary. Asks for your branch pattern the first time and remembers it.
4
4
 
5
+
6
+ ## ⚠ MANDATORY: How to Execute This Command
7
+
8
+ Execute these steps IN ORDER. Every step is mandatory. Do NOT improvise,
9
+ reorder, skip, or invent steps.
10
+
11
+ 1. FIRST tool call: run the intent detector with `$ARGUMENTS` passed LITERALLY
12
+ (the actual command lives in the "## Intent Detection" section below).
13
+ 2. Print the INPUT DETECTION banner (exact output from intent-detector.cjs).
14
+ 3. Determine `ALL_FROM_FLAGS`. If interactive (`IS_AUTO=false`) AND any value
15
+ came from NL/default (`ALL_FROM_FLAGS=false`), PAUSE for yes/no confirmation.
16
+ Do NOT proceed without it.
17
+ ```bash
18
+ ALL_FROM_FLAGS=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSync(0,'utf8')); const sources=Object.values(j.resolved).map(v=>v.source); console.log(sources.length>0 && sources.every(s=>s==='flag') ? 'true' : 'false')")
19
+ ```
20
+ Pause prompt (when applicable):
21
+ ```
22
+ The values above were resolved from natural language and/or defaults.
23
+ Do you want to continue with these inputs? (yes/no)
24
+ ```
25
+ 4. Read `CLAUDE.md` (git workflow, commit conventions, PR template).
26
+ 5. Execute the workflow in `@workflows/qa-pr.md` IN ORDER, preserving ALL its
27
+ gates: platform detection, branch-convention save, and the user-confirmation
28
+ checkpoint BEFORE any push or PR creation.
29
+
30
+ ### DO NOT
31
+ - Skip the INPUT DETECTION banner
32
+ - Run any tool (Bash, Read, Glob) before the intent detector
33
+ - Skip the yes/no confirmation when any value came from NL or defaults
34
+ - Push a branch or create the PR before the workflow's user-confirmation gate
35
+ - Assume context, ticket, title, base branch, or any value from previous command
36
+ invocations. Each /qa-pr invocation is self-contained — the detector returns
37
+ defaults precisely because the user did not pass them.
38
+ - Invent steps not in this command or the workflow, or reorder the ones that are
39
+
40
+ If you find yourself improvising, skipping the confirmation, or pushing/creating
41
+ the PR before the user confirmed — STOP and restart from step 1.
42
+
43
+ ### Pass user input literally to the intent detector
44
+
45
+ When you run the intent detector with `$ARGUMENTS`, substitute that placeholder
46
+ with the RAW user input as received, NOT a pre-translated flag string. If you
47
+ pre-translate, the detector reports every value as `source: flag`, sets
48
+ `ALL_FROM_FLAGS=true`, and bypasses the confirmation checkpoint.
49
+
50
+
5
51
  ## Usage
6
52
 
7
53
  /qa-pr [--ticket <id>] [--title <description>] [--scope <type>] [--files <glob>] [--base <branch>]
@@ -12,6 +58,23 @@ Create a draft PR from QA artifacts already on disk. Auto-detects git platform (
12
58
  - --files: explicit file glob to include (e.g., "tests/unit/auth*")
13
59
  - --base: target branch for PR (default: auto-detect)
14
60
 
61
+
62
+ ## Intent Detection
63
+
64
+ Before processing arguments, run the intent detector to support natural-language input alongside flags. Flags always win over NL.
65
+
66
+ ```bash
67
+ RESOLVED=$(node ~/.claude/qaa/bin/lib/intent-detector.cjs --resolve "$ARGUMENTS" --aliases '{"ticket":"ticket","title":"title","scope":"scope","files":"files","base":"base"}')
68
+
69
+ # Print INPUT DETECTION banner (always shown, even if defaults are used)
70
+ echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSync(0,'utf8')); console.log(j.banner)"
71
+
72
+ # Extract resolved values for use below
73
+ TICKET=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSync(0,'utf8')); console.log(j.resolved.ticket?.value || '')")
74
+ ```
75
+
76
+ If you see values you didn't intend in the banner above (interactive mode), you can press Ctrl-C and re-run with explicit flags.
77
+
15
78
  ## Instructions
16
79
 
17
80
  1. Read `CLAUDE.md` -- git workflow, commit conventions.