qaa-agent 1.9.6 → 1.9.7

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
 
4
4
  All notable changes to QAA (QA Automation Agent) are documented here.
5
5
 
6
+ ## [1.9.7] - 2026-07-29
7
+
8
+ ### Added
9
+
10
+ - **Pre-flight checks with UX-friendly error messages across all 10 commands** — every slash command now runs guard checks before its main flow and, on failure, prints a clear, actionable error: a one-line title, a short explanation, two or three concrete options, and a `Try:` command. Coverage includes invalid `--dev-repo`/source paths, missing required MCP servers (Playwright for `/qa-audit`, `/qa-testid`, `/qa-create-test` from-aut and `/qa-fix --run`; Context7 for `/qa-research`; Azure DevOps for `/qa-create-test-ado` and `/qa-test-report`), undetectable frameworks, non-git repositories, and a missing/unauthenticated GitHub CLI. Required-dependency failures STOP; optional-enhancement failures (e.g. live DOM verification) WARN and continue in degraded mode. Every suggested flag is validated against what the command actually accepts.
11
+
12
+ ### Fixed
13
+
14
+ - **Installer now syncs `workflows/` to the live location** — `install.cjs` Step 4 mirrors `workflows/qa-*.md` into `<claudeDir>/workflows/` alongside commands and agents, using the same scope-aware sync. Commands reference workflows via `@workflows/qa-*.md`; syncing them makes that resolution direct instead of a fallback runtime search, on every install (global or local).
15
+
16
+ ### Documentation
17
+
18
+ - **QAA_SYSTEM_OVERVIEW.md refreshed for the current system state** — the Installation section now documents the four installer steps, including the live sync of commands, agents, workflows, and CLAUDE.md to the locations Claude Code loads from.
19
+
6
20
  ## [1.9.6] - 2026-07-14
7
21
 
8
22
  ### Added
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.9.6
1
+ 1.9.7
package/bin/install.cjs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  /**
4
4
  * QAA Agent Installer
@@ -320,8 +320,10 @@ async function main() {
320
320
  //
321
321
  // Claude Code loads slash commands from <claudeDir>/commands, sub-agents from
322
322
  // <claudeDir>/agents, and global standards from <claudeDir>/CLAUDE.md — NOT
323
- // from the qaa/ install dir. Mirror QAA files there so new versions activate.
324
- // Only QAA-owned files (qa*.md / qaa-*.md) are touched.
323
+ // from the qaa/ install dir. Commands also reference workflows via
324
+ // @workflows/qa-*.md; mirroring workflows to <claudeDir>/workflows makes that
325
+ // resolution direct instead of a fragile runtime search. Mirror QAA files
326
+ // there so new versions activate. Only QAA-owned files (qa*.md) are touched.
325
327
 
326
328
  console.log('');
327
329
 
@@ -344,6 +346,14 @@ async function main() {
344
346
  success(`${tag}Live agents → ${path.join(claudeDir, 'agents')} (${agentSync.copied.length} synced${agentSync.pruned.length ? `, ${agentSync.pruned.length} pruned` : ''})`);
345
347
  if (agentSync.pruned.length) log(`${tag}Pruned: ${agentSync.pruned.join(', ')}`);
346
348
 
349
+ const workflowSync = syncLive(
350
+ path.join(installDir, 'workflows'),
351
+ path.join(claudeDir, 'workflows'),
352
+ qaMatch, dryRun
353
+ );
354
+ success(`${tag}Live workflows → ${path.join(claudeDir, 'workflows')} (${workflowSync.copied.length} synced${workflowSync.pruned.length ? `, ${workflowSync.pruned.length} pruned` : ''})`);
355
+ if (workflowSync.pruned.length) log(`${tag}Pruned: ${workflowSync.pruned.join(', ')}`);
356
+
347
357
  const cmd = syncClaudeMd(installDir, claudeDir, dryRun, pkgVersion);
348
358
  if (cmd.action === 'created') success(`${tag}CLAUDE.md created (QAA markers) → ${path.join(claudeDir, 'CLAUDE.md')}`);
349
359
  else if (cmd.action === 'updated-section') success(`${tag}CLAUDE.md QAA section updated → ${path.join(claudeDir, 'CLAUDE.md')}`);
@@ -359,7 +369,7 @@ async function main() {
359
369
  console.log('');
360
370
  if (dryRun) log('Dry-run complete — nothing was written.');
361
371
  log(`${totalFiles} files installed to ${installDir}`);
362
- log(`Live commands & agents synced to ${claudeDir}`);
372
+ log(`Live commands, agents & workflows synced to ${claudeDir}`);
363
373
  log('MCP servers: playwright, context7');
364
374
  log('');
365
375
  log('Restart Claude Code, then run any QAA command:');
@@ -103,6 +103,43 @@ APP_URL=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileS
103
103
 
104
104
  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.
105
105
 
106
+ ## Pre-flight checks
107
+
108
+ Run these BEFORE the main flow. A **[STOP]** check that fails: print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP. A **[WARN]** check that fails: print the notice and continue in degraded mode.
109
+
110
+ ### Dev-repo path does not exist — --dev-repo given [STOP]
111
+ If `--dev-repo` was passed (coverage cross-reference) but the path does not exist:
112
+ ```
113
+ ❌ Dev-repo path not found: {path}
114
+
115
+ You passed --dev-repo for coverage cross-reference, but that path does not exist
116
+ (or is not a directory).
117
+
118
+ Options:
119
+ 1. Re-run with a correct path: /qa-audit <tests> --dev-repo <path>
120
+ 2. Drop --dev-repo to audit the test suite without coverage cross-reference
121
+ 3. Check for a typo or an unexpanded ~ in the path
122
+
123
+ Try: ls {path}
124
+ ```
125
+
126
+ ### Playwright MCP not connected — --app-url given [WARN]
127
+ If `--app-url` was passed (live locator verification) but Playwright MCP is unavailable:
128
+ ```
129
+ ❌ Playwright MCP is not connected — live locator verification will be skipped.
130
+
131
+ You passed --app-url so /qa-audit can check test locators against the real DOM
132
+ via Playwright MCP. It isn't available, so that check can't run — the rest of
133
+ the audit still proceeds.
134
+
135
+ Options:
136
+ 1. Connect Playwright MCP (ships with QAA — check ~/.claude.json), then re-run for full verification
137
+ 2. Reinstall to re-register the MCP servers: npx qaa-agent
138
+ 3. Continue now with static scoring only (no live DOM verification)
139
+
140
+ Try: /mcp
141
+ ```
142
+
106
143
  ## Instructions
107
144
 
108
145
  ### AUDIT MODE (default)
@@ -64,6 +64,53 @@ links, or passing XML steps — STOP and restart from step 1.
64
64
 
65
65
  ---
66
66
 
67
+ ## Pre-flight checks
68
+
69
+ Run these BEFORE the main flow. If a **[STOP]** check fails, print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP.
70
+
71
+ ### Azure DevOps MCP not connected [STOP]
72
+ If the ADO MCP tools (`wit_get_work_item`, `testplan_create_test_case`) are unavailable:
73
+ ```
74
+ ❌ Azure DevOps MCP is not connected — this command can't reach ADO.
75
+
76
+ /qa-create-test-ado reads a work item and creates Test Cases directly in Azure
77
+ DevOps via the ADO MCP tools. They aren't available in this session.
78
+
79
+ Options:
80
+ 1. Connect the Azure DevOps MCP server, then re-run
81
+ 2. Verify it's configured in your Claude Code MCP settings
82
+ 3. If you only need local test files (not ADO Test Cases), use /qa-create-test instead
83
+
84
+ Try: /mcp (to see connected MCP servers)
85
+ ```
86
+
87
+ ### Work item ID missing or not found [STOP]
88
+ - If NO work item ID was provided, print:
89
+ ```
90
+ ❌ No work item ID provided.
91
+
92
+ /qa-create-test-ado needs an Azure DevOps work item ID (Bug, User Story, or
93
+ Ticket) to read from.
94
+
95
+ Options:
96
+ 1. Pass one: /qa-create-test-ado <work-item-id>
97
+ 2. Copy the numeric ID from the work item's ADO URL
98
+ 3. If you only need local test files (not ADO Test Cases), use /qa-create-test instead
99
+
100
+ Try: /qa-create-test-ado 85508 (example)
101
+ ```
102
+ - If an ID WAS provided but `wit_get_work_item` returns nothing for it, print:
103
+ ```
104
+ ❌ Work item not found: {id}
105
+
106
+ The ID you gave doesn't resolve to a work item you can access.
107
+
108
+ Options:
109
+ 1. Double-check the numeric ID from the work item's ADO URL
110
+ 2. Confirm you have access to that work item's project
111
+ 3. Re-run with the correct ID: /qa-create-test-ado <work-item-id>
112
+ ```
113
+
67
114
  ## Process
68
115
 
69
116
  ### Phase 1: Read Pipeline Context
@@ -165,6 +165,58 @@ SUGGESTED_MODE=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').re
165
165
 
166
166
  The detector resolves the mode automatically when possible (from-ticket, from-aut, ado, etc.) and surfaces it in `SUGGESTED_MODE`. The mode detection logic in Step 1 below uses these resolved values.
167
167
 
168
+ ## Pre-flight checks
169
+
170
+ Run these BEFORE the main flow. A **[STOP]** check that fails: print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP. A **[WARN]** check that fails: print the notice and continue in degraded mode.
171
+
172
+ ### Dev-repo path does not exist [STOP]
173
+ If the resolved `--dev-repo` path is not an existing directory:
174
+ ```
175
+ ❌ Dev-repo path not found: {path}
176
+
177
+ The --dev-repo path you gave does not exist (or is not a directory), so there's
178
+ nothing to read the code from.
179
+
180
+ Options:
181
+ 1. Re-run with a correct path: /qa-create-test <feature> --dev-repo <path>
182
+ 2. Run from inside the repo with no --dev-repo (defaults to the current directory)
183
+ 3. Check for a typo or an unexpanded ~ in the path
184
+
185
+ Try: ls {path}
186
+ ```
187
+
188
+ ### Playwright MCP not connected — from-aut mode [STOP]
189
+ If MODE is from-aut and the Playwright MCP tools are unavailable:
190
+ ```
191
+ ❌ Playwright MCP is not connected — from-aut mode needs it to explore the app.
192
+
193
+ from-aut generates tests by driving the live app with Playwright MCP. Without
194
+ it, there's no way to discover real elements and locators.
195
+
196
+ Options:
197
+ 1. Connect Playwright MCP (it ships with QAA — check ~/.claude.json), then re-run
198
+ 2. Reinstall to re-register the MCP servers: npx qaa-agent
199
+ 3. Generate from the code instead (no live app needed): /qa-create-test <feature>
200
+
201
+ Try: /mcp (to see connected MCP servers)
202
+ ```
203
+
204
+ ### Framework not detectable — from-code mode [STOP]
205
+ If MODE is from-code and no framework can be detected:
206
+ ```
207
+ ❌ Could not detect a test framework in {dev-repo}.
208
+
209
+ from-code needs to know which framework to generate for. No config files or
210
+ manifest entries pointed to one.
211
+
212
+ Options:
213
+ 1. Pass it explicitly: /qa-create-test <feature> --framework <playwright|cypress|jest|vitest|pytest|selenium|robot-framework>
214
+ 2. Run /qa-map first to build the codebase map, then re-run
215
+ 3. Add a framework to the repo (e.g. `npm i -D cypress`) and re-run
216
+
217
+ Try: /qa-map (to scan and detect the stack first)
218
+ ```
219
+
168
220
  ## Instructions
169
221
 
170
222
  ### Step 1: Detect Mode
@@ -115,6 +115,69 @@ TICKET=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSy
115
115
 
116
116
  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.
117
117
 
118
+ ## Pre-flight checks
119
+
120
+ Run these BEFORE the main flow. If a **[STOP]** check fails, print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP.
121
+
122
+ ### Test files not found [STOP]
123
+ - If a path/directory WAS passed but does not exist, print:
124
+ ```
125
+ ❌ Test path not found: {path}
126
+
127
+ The path you passed to /qa-fix doesn't exist.
128
+
129
+ Options:
130
+ 1. Point at an existing file or directory: /qa-fix <path/to/tests>
131
+ 2. Run from your QA repo root and pass no path (it auto-detects the suite)
132
+ 3. Check for a typo or an unexpanded ~ in the path
133
+
134
+ Try: ls {path}
135
+ ```
136
+ - If NO path was passed and auto-detection found no test files, print (no `Try:` line — there's no path to show):
137
+ ```
138
+ ❌ No test files found to fix.
139
+
140
+ /qa-fix auto-detected from the current directory but found no test files.
141
+
142
+ Options:
143
+ 1. Point at your tests explicitly: /qa-fix <path/to/tests>
144
+ 2. Run from your QA repo root so auto-detection can find the suite
145
+ 3. If you haven't generated tests yet, create them first: /qa-create-test <feature>
146
+ ```
147
+
148
+ ### Test runner can't execute [STOP]
149
+ If the test runner binary is missing or fails to launch (an infra failure, not a test failure):
150
+ ```
151
+ ❌ The test runner could not start.
152
+
153
+ The framework's runner (npx playwright / cypress / jest / vitest / pytest) is
154
+ missing, misconfigured, or its dependencies aren't installed — so tests never
155
+ ran. This is an ENVIRONMENT ISSUE, not a test failure.
156
+
157
+ Options:
158
+ 1. Install dependencies in the repo first: npm install (or the project's equivalent)
159
+ 2. Verify the runner works on its own before re-running /qa-fix
160
+ 3. Run static validation only (no execution): /qa-fix --validate-only
161
+
162
+ Try: npx {runner} --version (to confirm the runner is installed)
163
+ ```
164
+
165
+ ### Playwright MCP not connected — E2E run requested [STOP]
166
+ If `--run` / `--app-url` was passed (E2E reproduction against the live app) but Playwright MCP is unavailable:
167
+ ```
168
+ ❌ Playwright MCP is not connected — E2E reproduction against the app needs it.
169
+
170
+ You asked to run E2E tests against the live app (--run / --app-url), which uses
171
+ Playwright MCP to reproduce failures in the browser. It isn't available.
172
+
173
+ Options:
174
+ 1. Connect Playwright MCP (ships with QAA — check ~/.claude.json), then re-run
175
+ 2. Reinstall to re-register the MCP servers: npx qaa-agent
176
+ 3. Skip execution and only classify or validate: /qa-fix --classify (or --validate-only)
177
+
178
+ Try: /mcp
179
+ ```
180
+
118
181
  ## Instructions
119
182
 
120
183
  ### Step 1: Detect Mode and Test Directory
@@ -73,6 +73,42 @@ All documents written to `.qa-output/codebase/`.
73
73
  | QA_REPO_BLUEPRINT.md | If no QA repo — full repo structure, configs, CI/CD strategy |
74
74
  | GAP_ANALYSIS.md | If QA repo provided — coverage map, missing tests, broken tests, quality assessment |
75
75
 
76
+ ## Pre-flight checks
77
+
78
+ Run these BEFORE the main flow. If a **[STOP]** check fails, print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP.
79
+
80
+ ### Dev-repo path does not exist [STOP]
81
+ If the resolved `--dev-repo` path is not an existing directory:
82
+ ```
83
+ ❌ Dev-repo path not found: {path}
84
+
85
+ /qa-map scans a repository; the --dev-repo path you gave does not exist (or is
86
+ not a directory).
87
+
88
+ Options:
89
+ 1. Re-run with a correct path: /qa-map --dev-repo <path>
90
+ 2. Run from inside the repo with no --dev-repo (defaults to the current directory)
91
+ 3. Check for a typo or an unexpanded ~ in the path
92
+
93
+ Try: ls {path}
94
+ ```
95
+
96
+ ### No framework or testable surfaces detected [STOP]
97
+ If the scan finds no framework and no source it can classify as a testable surface:
98
+ ```
99
+ ❌ Nothing testable detected in {dev-repo}.
100
+
101
+ The scan found no test framework and no source it can classify as a testable
102
+ surface, so there's nothing to map or analyze.
103
+
104
+ Options:
105
+ 1. Point at the app sub-directory if this is a monorepo: /qa-map --dev-repo <path/to/app>
106
+ 2. Add a framework config to the repo first (playwright/cypress/jest/vitest/pytest), then re-run
107
+ 3. To analyze an existing test suite, pass a QA repo: /qa-map --qa-repo <path>
108
+
109
+ Try: ls {dev-repo} (to confirm you're pointing at the right directory)
110
+ ```
111
+
76
112
  ## Instructions
77
113
 
78
114
  1. Read `CLAUDE.md` — QA standards.
package/commands/qa-pr.md CHANGED
@@ -75,6 +75,42 @@ TICKET=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSy
75
75
 
76
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
77
 
78
+ ## Pre-flight checks
79
+
80
+ Run these BEFORE the main flow. If a **[STOP]** check fails, print the error EXACTLY as shown and STOP.
81
+
82
+ ### Not a git repository [STOP]
83
+ If the current directory is not inside a git repository:
84
+ ```
85
+ ❌ Not a git repository.
86
+
87
+ /qa-pr creates a branch, commits QA artifacts, and opens a pull request — all of
88
+ which need a git repo. The current directory isn't one.
89
+
90
+ Options:
91
+ 1. Run from inside your QA repo (or the repo where the artifacts live)
92
+ 2. Initialize git if this is a new repo: git init && git remote add origin <url>
93
+ 3. If you just want the files locally, skip /qa-pr — the artifacts are already in .qa-output/
94
+
95
+ Try: git status (to confirm you're in a repo)
96
+ ```
97
+
98
+ ### GitHub CLI not available or not signed in [STOP]
99
+ If `gh` is not installed or `gh auth status` fails:
100
+ ```
101
+ ❌ GitHub CLI (gh) is not available or not signed in.
102
+
103
+ /qa-pr uses `gh` to open the draft pull request. It's either not installed or
104
+ not authenticated, so the PR step can't run.
105
+
106
+ Options:
107
+ 1. Authenticate: gh auth login
108
+ 2. Install the GitHub CLI first (https://cli.github.com), then re-run
109
+ 3. Create the branch and commits locally, then open the PR by hand in your git host
110
+
111
+ Try: gh auth status
112
+ ```
113
+
78
114
  ## Instructions
79
115
 
80
116
  1. Read `CLAUDE.md` -- git workflow, commit conventions.
@@ -80,6 +80,42 @@ These files are consumed by downstream agents:
80
80
  | `API_TESTING_STRATEGY.md` | Planner (API test case design), Executor (implementation patterns) |
81
81
  | `E2E_STRATEGY.md` | Planner (E2E scope decisions), Executor (POM and selector patterns) |
82
82
 
83
+ ## Pre-flight checks
84
+
85
+ Run these BEFORE the main flow. If a **[STOP]** check fails, print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP.
86
+
87
+ ### Context7 MCP not connected [STOP]
88
+ If the Context7 MCP tools are unavailable:
89
+ ```
90
+ ❌ Context7 MCP is not connected — research needs it as the primary source.
91
+
92
+ /qa-research relies on Context7 to fetch current framework and library docs.
93
+ Without it, findings would fall back to training data and could be stale or wrong.
94
+
95
+ Options:
96
+ 1. Connect Context7 (it ships with QAA — check that it registered in ~/.claude.json)
97
+ 2. Reinstall to re-register the MCP servers: npx qaa-agent
98
+ 3. Skip research for now — downstream agents fall back to cache/training data if no research docs exist
99
+
100
+ Try: /mcp (to see connected MCP servers)
101
+ ```
102
+
103
+ ### Dev-repo path does not exist [STOP]
104
+ If `--dev-repo` was passed but the path does not exist (default is the current directory):
105
+ ```
106
+ ❌ Dev-repo path not found: {path}
107
+
108
+ /qa-research reads the project's stack to focus its research. The --dev-repo path
109
+ you gave does not exist (or is not a directory).
110
+
111
+ Options:
112
+ 1. Re-run with a correct path: /qa-research --dev-repo <path>
113
+ 2. Run from inside the repo with no --dev-repo (defaults to the current directory)
114
+ 3. Check for a typo or an unexpanded ~ in the path
115
+
116
+ Try: ls {path}
117
+ ```
118
+
83
119
  ## Instructions
84
120
 
85
121
  ### Step 1: Initialize
@@ -67,6 +67,43 @@ When the workflow's Step 1 invokes the intent detector with `$ARGUMENTS`, you mu
67
67
 
68
68
  If you pre-translate, the detector sees only flags and reports every value as `source: flag`, which causes `ALL_FROM_FLAGS=true` and bypasses the confirmation checkpoint — defeating its purpose. Always pass raw input.
69
69
 
70
+ ## Pre-flight checks
71
+
72
+ Run these BEFORE spawning any agent. A **[STOP]** check that fails: print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP. A **[WARN]** check that fails: print the notice and continue in degraded mode.
73
+
74
+ ### Dev-repo path does not exist [STOP]
75
+ If the resolved `--dev-repo` path is not an existing directory:
76
+ ```
77
+ ❌ Dev-repo path not found: {path}
78
+
79
+ /qa-start needs a real directory to scan. The path resolved from your input
80
+ does not exist (or is not a directory).
81
+
82
+ Options:
83
+ 1. Re-run with a correct path: /qa-start --dev-repo <path-to-your-repo>
84
+ 2. Run from inside the repo with no path (defaults to the current directory)
85
+ 3. Double-check the path — a typo or a ~ that did not expand is the usual cause
86
+
87
+ Try: ls {path}
88
+ ```
89
+
90
+ ### Framework not detectable [STOP]
91
+ If the scanner finds no test framework and no language/config it can map to one:
92
+ ```
93
+ ❌ Could not detect a test framework in {dev-repo}.
94
+
95
+ QAA looks for a framework via config files (playwright.config, cypress.config,
96
+ jest/vitest config, pytest.ini, etc.) and package manifests. None were found,
97
+ so it can't decide how to write tests.
98
+
99
+ Options:
100
+ 1. Pass it explicitly: /qa-start --framework <playwright|cypress|jest|vitest|pytest|selenium|robot-framework>
101
+ 2. Point at the app sub-directory if this is a monorepo: /qa-start --dev-repo <path/to/app>
102
+ 3. Add a framework to the repo first (e.g. `npm i -D @playwright/test`), then re-run
103
+
104
+ Try: /qa-research (to investigate the stack before generating tests)
105
+ ```
106
+
70
107
  ## Instructions
71
108
 
72
109
  1. Read `CLAUDE.md` — all QA standards that govern the pipeline.
@@ -57,6 +57,53 @@ modifying test cases — STOP and restart from step 1.
57
57
 
58
58
  ---
59
59
 
60
+ ## Pre-flight checks
61
+
62
+ Run these BEFORE the main flow. If a **[STOP]** check fails, print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP.
63
+
64
+ ### Azure DevOps MCP not connected [STOP]
65
+ If the ADO MCP tools are unavailable:
66
+ ```
67
+ ❌ Azure DevOps MCP is not connected — this command reads from ADO.
68
+
69
+ /qa-test-report pulls test-case execution status from Azure DevOps via the ADO
70
+ MCP tools and REST API. They aren't available in this session.
71
+
72
+ Options:
73
+ 1. Connect the Azure DevOps MCP server, then re-run
74
+ 2. Verify it's configured in your Claude Code MCP settings
75
+ 3. Confirm ADO_MCP_AUTH_TOKEN is set if you also need the REST fallback for run outcomes
76
+
77
+ Try: /mcp (to see connected MCP servers)
78
+ ```
79
+
80
+ ### Work item ID missing or not found [STOP]
81
+ - If NO work item ID was provided, print:
82
+ ```
83
+ ❌ No work item ID provided.
84
+
85
+ /qa-test-report needs an Azure DevOps work item ID to build the report from its
86
+ linked test cases.
87
+
88
+ Options:
89
+ 1. Pass one: /qa-test-report <work-item-id>
90
+ 2. Copy the numeric ID from the work item's ADO URL
91
+ 3. Confirm you have access to that work item's project
92
+
93
+ Try: /qa-test-report 85508 (example)
94
+ ```
95
+ - If an ID WAS provided but `wit_get_work_item` returns nothing for it, print:
96
+ ```
97
+ ❌ Work item not found: {id}
98
+
99
+ The ID you gave doesn't resolve to a work item you can access.
100
+
101
+ Options:
102
+ 1. Double-check the numeric ID from the work item's ADO URL
103
+ 2. Confirm you have access to that work item's project
104
+ 3. Re-run with the correct ID: /qa-test-report <work-item-id>
105
+ ```
106
+
60
107
  ## Process
61
108
 
62
109
  ### Phase 1 — Resolve the Work Item
@@ -39,6 +39,60 @@ the framework-detection gate — STOP and restart from step 1.
39
39
 
40
40
  - source-directory: path to frontend source (auto-detects if omitted)
41
41
 
42
+ ## Pre-flight checks
43
+
44
+ Run these BEFORE the main flow. A **[STOP]** check that fails: print the error EXACTLY as shown (fill in the `{...}` placeholders) and STOP. A **[WARN]** check that fails: print the notice and continue in degraded mode.
45
+
46
+ ### Source directory not found [STOP]
47
+ If a source directory argument was given but does not exist:
48
+ ```
49
+ ❌ Source directory not found: {path}
50
+
51
+ /qa-testid scans frontend components at the given path. That directory does not
52
+ exist.
53
+
54
+ Options:
55
+ 1. Pass a valid path: /qa-testid <path-to-frontend-src>
56
+ 2. Run with no path to auto-detect (looks for src/, app/, components/, pages/, ...)
57
+ 3. Check for a typo or an unexpanded ~ in the path
58
+
59
+ Try: ls {path}
60
+ ```
61
+
62
+ ### No frontend framework detected [STOP]
63
+ If auto-detection finds no React / Vue / Angular / Svelte / HTML:
64
+ ```
65
+ ❌ No frontend framework detected.
66
+
67
+ /qa-testid injects data-testid into UI components, but no React (.jsx/.tsx), Vue
68
+ (.vue), Angular (.component.ts), Svelte (.svelte), or HTML files were found in
69
+ the scanned directory.
70
+
71
+ Options:
72
+ 1. Point at the frontend source explicitly: /qa-testid <path-to-components>
73
+ 2. If this is a monorepo, target the frontend package: /qa-testid <path/to/web-app>
74
+ 3. This command only applies to frontend repos — there's nothing to inject on a backend/API-only project
75
+
76
+ Try: ls {source-dir} (to confirm it holds component files)
77
+ ```
78
+
79
+ ### Playwright MCP not connected [WARN]
80
+ If the Playwright MCP tools are unavailable (used to browser-verify injected attributes):
81
+ ```
82
+ ❌ Playwright MCP is not connected — DOM verification will be skipped.
83
+
84
+ /qa-testid uses Playwright MCP to confirm injected data-testid attributes render
85
+ in the live DOM. Without it, injection and the audit report still run — only the
86
+ browser-verify step is skipped.
87
+
88
+ Options:
89
+ 1. Connect Playwright MCP (ships with QAA — check ~/.claude.json) for full verification
90
+ 2. Reinstall to re-register the MCP servers: npx qaa-agent
91
+ 3. Continue now with static validation only (no live DOM check)
92
+
93
+ Try: /mcp
94
+ ```
95
+
42
96
  ## Instructions
43
97
 
44
98
  1. Read `CLAUDE.md` -- data-testid Convention section.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qaa-agent",
3
- "version": "1.9.6",
3
+ "version": "1.9.7",
4
4
  "description": "QA Automation Agent for Claude Code — multi-agent pipeline that analyzes repos, generates tests, validates, and creates PRs",
5
5
  "bin": {
6
6
  "qaa-agent": "./bin/install.cjs"