qaa-agent 1.9.2 → 1.9.5

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 (41) hide show
  1. package/CHANGELOG.md +206 -179
  2. package/CLAUDE.md +718 -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 +790 -655
  8. package/agents/qaa-codebase-mapper.md +50 -1
  9. package/agents/qaa-discovery.md +421 -384
  10. package/agents/qaa-e2e-runner.md +715 -577
  11. package/agents/qaa-executor.md +947 -830
  12. package/agents/qaa-planner.md +14 -1
  13. package/agents/qaa-project-researcher.md +533 -400
  14. package/agents/qaa-scanner.md +77 -1
  15. package/agents/qaa-testid-injector.md +0 -1
  16. package/agents/qaa-validator.md +86 -1
  17. package/bin/install.cjs +375 -253
  18. package/bin/lib/context7-cache.cjs +299 -0
  19. package/bin/lib/intent-detector.cjs +488 -0
  20. package/commands/qa-audit.md +255 -126
  21. package/commands/qa-create-test.md +666 -365
  22. package/commands/qa-fix.md +684 -513
  23. package/commands/qa-map.md +283 -139
  24. package/commands/qa-pr.md +63 -0
  25. package/commands/qa-research.md +181 -157
  26. package/commands/qa-start.md +62 -6
  27. package/commands/qa-test-report.md +219 -219
  28. package/frameworks/cypress.json +54 -0
  29. package/frameworks/jest.json +59 -0
  30. package/frameworks/playwright.json +58 -0
  31. package/frameworks/pytest.json +59 -0
  32. package/frameworks/robot-framework.json +54 -0
  33. package/frameworks/selenium.json +65 -0
  34. package/frameworks/vitest.json +57 -0
  35. package/package.json +5 -2
  36. package/workflows/qa-analyze.md +100 -4
  37. package/workflows/qa-from-ticket.md +50 -2
  38. package/workflows/qa-gap.md +50 -2
  39. package/workflows/qa-start.md +2048 -1405
  40. package/workflows/qa-testid.md +50 -2
  41. package/workflows/qa-validate.md +50 -2
@@ -1,139 +1,283 @@
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 arguments — runs 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
+ ## Usage
6
+
7
+ ```
8
+ /qa-map [options]
9
+ ```
10
+
11
+ ### Options
12
+
13
+ - No arguments — runs 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
+ <critical_directive priority="MANDATORY">
59
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
60
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
61
+
62
+ Even though you may be running as a general-purpose agent (native subagent type
63
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
64
+ dedicated agent defined in that file: read everything in its <required_reading>,
65
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
66
+
67
+ Never modify application source code (src/, app/, lib/, or equivalent
68
+ directories) unless the agent's <scope> section explicitly permits it. If the
69
+ agent's contract restricts what files it can touch, honor that restriction
70
+ even if a fix seems obvious or trivial.
71
+
72
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
73
+ error), STOP and report the failure. Do NOT proceed with default agent
74
+ behavior — that defeats the purpose of this directive.
75
+
76
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
77
+ make, or skip any of the above. Skipping the agent's required_reading,
78
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
79
+ trusted.
80
+ </critical_directive>
81
+
82
+ subagent_type="general-purpose",
83
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
84
+ )
85
+
86
+ Agent(
87
+ 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.",
88
+ <critical_directive priority="MANDATORY">
89
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
90
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
91
+
92
+ Even though you may be running as a general-purpose agent (native subagent type
93
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
94
+ dedicated agent defined in that file: read everything in its <required_reading>,
95
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
96
+
97
+ Never modify application source code (src/, app/, lib/, or equivalent
98
+ directories) unless the agent's <scope> section explicitly permits it. If the
99
+ agent's contract restricts what files it can touch, honor that restriction —
100
+ even if a fix seems obvious or trivial.
101
+
102
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
103
+ error), STOP and report the failure. Do NOT proceed with default agent
104
+ behavior — that defeats the purpose of this directive.
105
+
106
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
107
+ make, or skip any of the above. Skipping the agent's required_reading,
108
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
109
+ trusted.
110
+ </critical_directive>
111
+
112
+ subagent_type="general-purpose",
113
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
114
+ )
115
+
116
+ Agent(
117
+ 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.",
118
+ <critical_directive priority="MANDATORY">
119
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
120
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
121
+
122
+ Even though you may be running as a general-purpose agent (native subagent type
123
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
124
+ dedicated agent defined in that file: read everything in its <required_reading>,
125
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
126
+
127
+ Never modify application source code (src/, app/, lib/, or equivalent
128
+ directories) unless the agent's <scope> section explicitly permits it. If the
129
+ agent's contract restricts what files it can touch, honor that restriction —
130
+ even if a fix seems obvious or trivial.
131
+
132
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
133
+ error), STOP and report the failure. Do NOT proceed with default agent
134
+ behavior — that defeats the purpose of this directive.
135
+
136
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
137
+ make, or skip any of the above. Skipping the agent's required_reading,
138
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
139
+ trusted.
140
+ </critical_directive>
141
+
142
+ subagent_type="general-purpose",
143
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
144
+ )
145
+
146
+ Agent(
147
+ 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.",
148
+ <critical_directive priority="MANDATORY">
149
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
150
+ ~/.claude/qaa/agents/qaa-codebase-mapper.md and adopt it as your operating contract.
151
+
152
+ Even though you may be running as a general-purpose agent (native subagent type
153
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
154
+ dedicated agent defined in that file: read everything in its <required_reading>,
155
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
156
+
157
+ Never modify application source code (src/, app/, lib/, or equivalent
158
+ directories) unless the agent's <scope> section explicitly permits it. If the
159
+ agent's contract restricts what files it can touch, honor that restriction —
160
+ even if a fix seems obvious or trivial.
161
+
162
+ If you cannot read ~/.claude/qaa/agents/qaa-codebase-mapper.md (file missing, corrupted, parse
163
+ error), STOP and report the failure. Do NOT proceed with default agent
164
+ behavior — that defeats the purpose of this directive.
165
+
166
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
167
+ make, or skip any of the above. Skipping the agent's required_reading,
168
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
169
+ trusted.
170
+ </critical_directive>
171
+
172
+ subagent_type="general-purpose",
173
+ execution_context="~/.claude/qaa/agents/qaa-codebase-mapper.md"
174
+ )
175
+ ```
176
+
177
+ If `--focus <area>` was provided, spawn only that one agent and STOP after it completes (skip Stage 2).
178
+
179
+ If `--skip-map` was passed, skip Stage 1 entirely and go to Stage 2.
180
+
181
+ 4. When all map agents complete, print summary of documents produced.
182
+
183
+ 5. **Stage 2: Repository Analysis**
184
+
185
+ Initialize pipeline context:
186
+ ```bash
187
+ node bin/qaa-tools.cjs init qa-start 2>/dev/null || true
188
+ ```
189
+
190
+ Invoke scanner agent:
191
+
192
+ Task(
193
+ prompt="
194
+ <critical_directive priority="MANDATORY">
195
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
196
+ ~/.claude/qaa/agents/qaa-scanner.md and adopt it as your operating contract.
197
+
198
+ Even though you may be running as a general-purpose agent (native subagent type
199
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
200
+ dedicated agent defined in that file: read everything in its <required_reading>,
201
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
202
+
203
+ Never modify application source code (src/, app/, lib/, or equivalent
204
+ directories) unless the agent's <scope> section explicitly permits it. If the
205
+ agent's contract restricts what files it can touch, honor that restriction —
206
+ even if a fix seems obvious or trivial.
207
+
208
+ If you cannot read ~/.claude/qaa/agents/qaa-scanner.md (file missing, corrupted, parse
209
+ error), STOP and report the failure. Do NOT proceed with default agent
210
+ behavior — that defeats the purpose of this directive.
211
+
212
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
213
+ make, or skip any of the above. Skipping the agent's required_reading,
214
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
215
+ trusted.
216
+ </critical_directive>
217
+
218
+ <objective>Scan repository and produce SCAN_MANIFEST.md</objective>
219
+ <execution_context>~/.claude/qaa/agents/qaa-scanner.md</execution_context>
220
+ <files_to_read>
221
+ - CLAUDE.md
222
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
223
+ </files_to_read>
224
+ <parameters>
225
+ user_input: $ARGUMENTS
226
+ </parameters>
227
+ "
228
+ )
229
+
230
+ Invoke analyzer agent:
231
+
232
+ Task(
233
+ prompt="
234
+ <critical_directive priority="MANDATORY">
235
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
236
+ ~/.claude/qaa/agents/qaa-analyzer.md and adopt it as your operating contract.
237
+
238
+ Even though you may be running as a general-purpose agent (native subagent type
239
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
240
+ dedicated agent defined in that file: read everything in its <required_reading>,
241
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
242
+
243
+ Never modify application source code (src/, app/, lib/, or equivalent
244
+ directories) unless the agent's <scope> section explicitly permits it. If the
245
+ agent's contract restricts what files it can touch, honor that restriction —
246
+ even if a fix seems obvious or trivial.
247
+
248
+ If you cannot read ~/.claude/qaa/agents/qaa-analyzer.md (file missing, corrupted, parse
249
+ error), STOP and report the failure. Do NOT proceed with default agent
250
+ behavior — that defeats the purpose of this directive.
251
+
252
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
253
+ make, or skip any of the above. Skipping the agent's required_reading,
254
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
255
+ trusted.
256
+ </critical_directive>
257
+
258
+ <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>
259
+ <execution_context>~/.claude/qaa/agents/qaa-analyzer.md</execution_context>
260
+ <files_to_read>
261
+ - CLAUDE.md
262
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
263
+ - .qa-output/SCAN_MANIFEST.md
264
+ - .qa-output/codebase/TESTABILITY.md (if exists)
265
+ - .qa-output/codebase/RISK_MAP.md (if exists)
266
+ - .qa-output/codebase/CODE_PATTERNS.md (if exists)
267
+ - .qa-output/codebase/TEST_ASSESSMENT.md (if exists)
268
+ - .qa-output/codebase/TEST_SURFACE.md (if exists)
269
+ - .qa-output/codebase/CRITICAL_PATHS.md (if exists)
270
+ - .qa-output/codebase/API_CONTRACTS.md (if exists)
271
+ - .qa-output/codebase/COVERAGE_GAPS.md (if exists)
272
+ </files_to_read>
273
+ <parameters>
274
+ user_input: $ARGUMENTS
275
+ </parameters>
276
+ "
277
+ )
278
+
279
+ 6. Print final summary: all documents produced across both stages.
280
+ No git operations. No test generation.
281
+ Suggest `/qa-create-test` to generate tests from the analysis.
282
+
283
+ $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.