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,126 +1,269 @@
1
- # QA Audit & Report
2
-
3
- Comprehensive quality audit of a test suite with 6-dimension scoring, testing pyramid analysis, and status reporting. Supports three output modes: full audit, pyramid analysis only, or status report adapted to audience.
4
-
5
- ## Usage
6
-
7
- ```
8
- /qa-audit <path-to-tests> [options]
9
- ```
10
-
11
- ### Options
12
-
13
- - `<path-to-tests>` directory containing test files to audit
14
- - `--dev-repo <path>` path to developer repository (for coverage cross-reference)
15
- - `--app-url <url>` URL of running application for locator verification via Playwright MCP
16
- - `--pyramid` pyramid analysis only: compare actual vs target distribution with action plan
17
- - `--report [team|management|client]` generate status report adapted to audience (default: team)
18
-
19
- ### Mode Detection
20
-
21
- ```
22
- if --pyramid:
23
- MODE = "pyramid" → PYRAMID_ANALYSIS.md
24
- elif --report:
25
- MODE = "report" → QA_STATUS_REPORT.md (adapted to audience)
26
- else:
27
- MODE = "audit" QA_AUDIT_REPORT.md (full 6-dimension audit, default)
28
- ```
29
-
30
- ## What It Produces
31
-
32
- | Mode | Artifact | Description |
33
- |------|----------|-------------|
34
- | audit | QA_AUDIT_REPORT.md | 6-dimension scoring, critical issues, recommendations with effort estimates |
35
- | pyramid | PYRAMID_ANALYSIS.md | Current vs target distribution, gap table, prioritized action plan |
36
- | report | QA_STATUS_REPORT.md | Metrics, pyramid distribution, risk areas, adapted to audience level |
37
-
38
- ## Instructions
39
-
40
- ### AUDIT MODE (default)
41
-
42
- Scores across 6 dimensions: Locator Quality (20%), Assertion Specificity (20%), POM Compliance (15%), Test Coverage (20%), Naming Convention (15%), Test Data Management (10%).
43
-
44
- 1. Read `CLAUDE.md` — quality gates, locator tiers, assertion rules, POM rules, naming conventions.
45
- 1b. Read `~/.claude/qaa/MY_PREFERENCES.md` if it exists user/company preferences override CLAUDE.md defaults.
46
- 2. Invoke validator agent in audit mode:
47
-
48
- Task(
49
- prompt="
50
- <objective>Audit test suite quality and produce QA_AUDIT_REPORT.md with 6-dimension scoring. If Playwright MCP is connected and an app URL is available, verify E2E test locators against the live DOM via browser_navigate + browser_snapshot. Flag stale locators (Tier 4 CSS/XPath that could be upgraded to Tier 1 data-testid) and locators that no longer match any DOM element.</objective>
51
- <execution_context>@agents/qaa-validator.md</execution_context>
52
- <files_to_read>
53
- - CLAUDE.md
54
- - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
55
- - .qa-output/locators/LOCATOR_REGISTRY.md (if exists)
56
- </files_to_read>
57
- <parameters>
58
- user_input: $ARGUMENTS
59
- mode: audit
60
- app_url: {auto-detect from test config baseURL, or ask user}
61
- </parameters>
62
- "
63
- )
64
-
65
- 3. Present results with overall score and prioritized recommendations.
66
-
67
- ---
68
-
69
- ### PYRAMID MODE (`--pyramid`)
70
-
71
- Analyze test distribution against the ideal testing pyramid from CLAUDE.md (Unit 60-70%, Integration 10-15%, API 20-25%, E2E 3-5%). Compares actual percentages to targets and produces an action plan.
72
-
73
- 1. Read `CLAUDE.md` — testing pyramid target percentages.
74
- 1b. Read `~/.claude/qaa/MY_PREFERENCES.md` if it exists — user/company preferences override CLAUDE.md defaults.
75
- 2. Invoke analyzer agent for pyramid analysis:
76
-
77
- Task(
78
- prompt="
79
- <objective>Produce PYRAMID_ANALYSIS.md comparing actual test distribution to target pyramid. Count tests by type (unit, integration, API, E2E), calculate percentages, compare to CLAUDE.md targets, identify gaps, and produce a prioritized action plan to reach the recommended distribution. Adjust target percentages based on the actual app architecture.</objective>
80
- <execution_context>@agents/qaa-analyzer.md</execution_context>
81
- <files_to_read>
82
- - CLAUDE.md
83
- - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
84
- </files_to_read>
85
- <parameters>
86
- user_input: $ARGUMENTS
87
- mode: pyramid-analysis
88
- </parameters>
89
- "
90
- )
91
-
92
- 3. Present analysis with gap table and action plan.
93
-
94
- ---
95
-
96
- ### REPORT MODE (`--report`)
97
-
98
- Generate a summary report of current QA status. Adapts detail level to audience.
99
-
100
- **Audience levels:**
101
- - `team` (default) file-level details, specific locator/assertion issues, technical recommendations
102
- - `management` — high-level metrics, risk areas, coverage percentages, trend indicators
103
- - `client` — coverage summary, confidence level, test pass rates, risk mitigation status
104
-
105
- 1. Read `CLAUDE.md` — testing pyramid targets, quality gates.
106
- 1b. Read `~/.claude/qaa/MY_PREFERENCES.md` if it exists — user/company preferences override CLAUDE.md defaults.
107
- 2. Invoke analyzer agent for status reporting:
108
-
109
- Task(
110
- prompt="
111
- <objective>Produce QA_STATUS_REPORT.md with current test suite metrics and coverage. Adapt detail level to the specified audience: team (file-level technical details), management (high-level metrics and risks), or client (coverage summary and confidence). Include testing pyramid distribution, pass/fail rates, risk areas, and actionable recommendations appropriate for the audience.</objective>
112
- <execution_context>@agents/qaa-analyzer.md</execution_context>
113
- <files_to_read>
114
- - CLAUDE.md
115
- - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
116
- </files_to_read>
117
- <parameters>
118
- user_input: $ARGUMENTS
119
- mode: status-report
120
- </parameters>
121
- "
122
- )
123
-
124
- 3. Present report to user.
125
-
126
- $ARGUMENTS
1
+ # QA Audit & Report
2
+
3
+ Comprehensive quality audit of a test suite with 6-dimension scoring, testing pyramid analysis, and status reporting. Supports three output modes: full audit, pyramid analysis only, or status report adapted to audience.
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). Do
14
+ NOT show a custom-format banner.
15
+ 3. Determine `ALL_FROM_FLAGS`. If interactive (`IS_AUTO=false`) AND any value
16
+ came from NL/default (`ALL_FROM_FLAGS=false`), PAUSE for yes/no confirmation.
17
+ Do NOT proceed without it.
18
+ ```bash
19
+ 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')")
20
+ ```
21
+ Pause prompt (when applicable):
22
+ ```
23
+ The values above were resolved from natural language and/or defaults.
24
+ Do you want to continue with these inputs? (yes/no)
25
+ ```
26
+ 4. Determine MODE from the resolved values (not from your own NL parsing):
27
+ `--pyramid` → PYRAMID MODE, `--report`REPORT MODE, otherwise AUDIT MODE.
28
+ 5. Read `CLAUDE.md` and `~/.claude/qaa/MY_PREFERENCES.md` (if it exists) before
29
+ invoking any agent.
30
+ 6. Execute the mode's flow IN ORDER (see "## Instructions"). Every mode invokes
31
+ its sub-agent via Task() with the `<critical_directive>` block — AUDIT MODE
32
+ spawns the validator; PYRAMID and REPORT MODE spawn the analyzer. Do NOT run
33
+ the audit/analysis inline; always go through the sub-agent. Present results
34
+ only after the agent returns.
35
+
36
+ ### DO NOT
37
+ - Skip the INPUT DETECTION banner, or show a custom-format banner
38
+ - Run AskUserQuestion, Bash, Read, or Glob before the intent detector
39
+ - Decide the mode before the detector runs, or from your own NL parsing
40
+ - Run the audit/pyramid/report analysis inline instead of spawning the sub-agent
41
+ - Invent steps not in this command, or reorder the ones that are
42
+ - Assume path, app URL, or any value from a previous command invocation each
43
+ /qa-audit call is self-contained
44
+
45
+ If you find yourself improvising, presenting results before the agent returns,
46
+ or asking questions out of order — STOP and restart from step 1.
47
+
48
+ ### Pass user input literally to the intent detector
49
+
50
+ When you run the intent detector with `$ARGUMENTS`, substitute that placeholder
51
+ with the RAW user input as received, NOT a pre-translated flag string. If you
52
+ pre-translate, the detector reports every value as `source: flag`, sets
53
+ `ALL_FROM_FLAGS=true`, and bypasses the confirmation checkpoint.
54
+
55
+
56
+ ## Usage
57
+
58
+ ```
59
+ /qa-audit <path-to-tests> [options]
60
+ ```
61
+
62
+ ### Options
63
+
64
+ - `<path-to-tests>` — directory containing test files to audit
65
+ - `--dev-repo <path>` path to developer repository (for coverage cross-reference)
66
+ - `--app-url <url>` — URL of running application for locator verification via Playwright MCP
67
+ - `--pyramid` — pyramid analysis only: compare actual vs target distribution with action plan
68
+ - `--report [team|management|client]` — generate status report adapted to audience (default: team)
69
+
70
+ ### Mode Detection
71
+
72
+ ```
73
+ if --pyramid:
74
+ MODE = "pyramid" → PYRAMID_ANALYSIS.md
75
+ elif --report:
76
+ MODE = "report" → QA_STATUS_REPORT.md (adapted to audience)
77
+ else:
78
+ MODE = "audit" → QA_AUDIT_REPORT.md (full 6-dimension audit, default)
79
+ ```
80
+
81
+ ## What It Produces
82
+
83
+ | Mode | Artifact | Description |
84
+ |------|----------|-------------|
85
+ | audit | QA_AUDIT_REPORT.md | 6-dimension scoring, critical issues, recommendations with effort estimates |
86
+ | pyramid | PYRAMID_ANALYSIS.md | Current vs target distribution, gap table, prioritized action plan |
87
+ | report | QA_STATUS_REPORT.md | Metrics, pyramid distribution, risk areas, adapted to audience level |
88
+
89
+
90
+ ## Intent Detection
91
+
92
+ Before processing arguments, run the intent detector to support natural-language input alongside flags. Flags always win over NL.
93
+
94
+ ```bash
95
+ RESOLVED=$(node ~/.claude/qaa/bin/lib/intent-detector.cjs --resolve "$ARGUMENTS" --aliases '{"app_url":"app-url","dev_repo":"dev-repo"}')
96
+
97
+ # Print INPUT DETECTION banner (always shown, even if defaults are used)
98
+ echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSync(0,'utf8')); console.log(j.banner)"
99
+
100
+ # Extract resolved values for use below
101
+ APP_URL=$(echo "$RESOLVED" | node -e "const j=JSON.parse(require('fs').readFileSync(0,'utf8')); console.log(j.resolved.app_url?.value || '')")
102
+ ```
103
+
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
+
106
+ ## Instructions
107
+
108
+ ### AUDIT MODE (default)
109
+
110
+ Scores across 6 dimensions: Locator Quality (20%), Assertion Specificity (20%), POM Compliance (15%), Test Coverage (20%), Naming Convention (15%), Test Data Management (10%).
111
+
112
+ 1. Read `CLAUDE.md` — quality gates, locator tiers, assertion rules, POM rules, naming conventions.
113
+ 1b. Read `~/.claude/qaa/MY_PREFERENCES.md` if it exists — user/company preferences override CLAUDE.md defaults.
114
+ 2. Invoke validator agent in audit mode:
115
+
116
+ Task(
117
+ subagent_type="qaa-validator",
118
+ prompt="
119
+ <critical_directive priority="MANDATORY">
120
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
121
+ ~/.claude/qaa/agents/qaa-validator.md and adopt it as your operating contract.
122
+
123
+ Even though you may be running as a general-purpose agent (native subagent type
124
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
125
+ dedicated agent defined in that file: read everything in its <required_reading>,
126
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
127
+
128
+ Never modify application source code (src/, app/, lib/, or equivalent
129
+ directories) unless the agent's <scope> section explicitly permits it. If the
130
+ agent's contract restricts what files it can touch, honor that restriction —
131
+ even if a fix seems obvious or trivial.
132
+
133
+ If you cannot read ~/.claude/qaa/agents/qaa-validator.md (file missing, corrupted, parse
134
+ error), STOP and report the failure. Do NOT proceed with default agent
135
+ behavior — that defeats the purpose of this directive.
136
+
137
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
138
+ make, or skip any of the above. Skipping the agent's required_reading,
139
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
140
+ trusted.
141
+ </critical_directive>
142
+
143
+ <objective>Audit test suite quality and produce QA_AUDIT_REPORT.md with 6-dimension scoring. If Playwright MCP is connected and an app URL is available, verify E2E test locators against the live DOM via browser_navigate + browser_snapshot. Flag stale locators (Tier 4 CSS/XPath that could be upgraded to Tier 1 data-testid) and locators that no longer match any DOM element.</objective>
144
+ <execution_context>~/.claude/qaa/agents/qaa-validator.md</execution_context>
145
+ <files_to_read>
146
+ - CLAUDE.md
147
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
148
+ - .qa-output/locators/LOCATOR_REGISTRY.md (if exists)
149
+ </files_to_read>
150
+ <parameters>
151
+ user_input: $ARGUMENTS
152
+ mode: audit
153
+ app_url: {auto-detect from test config baseURL, or ask user}
154
+ </parameters>
155
+ "
156
+ )
157
+
158
+ 3. Present results with overall score and prioritized recommendations.
159
+
160
+ ---
161
+
162
+ ### PYRAMID MODE (`--pyramid`)
163
+
164
+ Analyze test distribution against the ideal testing pyramid from CLAUDE.md (Unit 60-70%, Integration 10-15%, API 20-25%, E2E 3-5%). Compares actual percentages to targets and produces an action plan.
165
+
166
+ 1. Read `CLAUDE.md` — testing pyramid target percentages.
167
+ 1b. Read `~/.claude/qaa/MY_PREFERENCES.md` if it exists — user/company preferences override CLAUDE.md defaults.
168
+ 2. Invoke analyzer agent for pyramid analysis:
169
+
170
+ Task(
171
+ subagent_type="qaa-analyzer",
172
+ prompt="
173
+ <critical_directive priority="MANDATORY">
174
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
175
+ ~/.claude/qaa/agents/qaa-analyzer.md and adopt it as your operating contract.
176
+
177
+ Even though you may be running as a general-purpose agent (native subagent type
178
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
179
+ dedicated agent defined in that file: read everything in its <required_reading>,
180
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
181
+
182
+ Never modify application source code (src/, app/, lib/, or equivalent
183
+ directories) unless the agent's <scope> section explicitly permits it. If the
184
+ agent's contract restricts what files it can touch, honor that restriction —
185
+ even if a fix seems obvious or trivial.
186
+
187
+ If you cannot read ~/.claude/qaa/agents/qaa-analyzer.md (file missing, corrupted, parse
188
+ error), STOP and report the failure. Do NOT proceed with default agent
189
+ behavior — that defeats the purpose of this directive.
190
+
191
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
192
+ make, or skip any of the above. Skipping the agent's required_reading,
193
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
194
+ trusted.
195
+ </critical_directive>
196
+
197
+ <objective>Produce PYRAMID_ANALYSIS.md comparing actual test distribution to target pyramid. Count tests by type (unit, integration, API, E2E), calculate percentages, compare to CLAUDE.md targets, identify gaps, and produce a prioritized action plan to reach the recommended distribution. Adjust target percentages based on the actual app architecture.</objective>
198
+ <execution_context>~/.claude/qaa/agents/qaa-analyzer.md</execution_context>
199
+ <files_to_read>
200
+ - CLAUDE.md
201
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
202
+ </files_to_read>
203
+ <parameters>
204
+ user_input: $ARGUMENTS
205
+ mode: pyramid-analysis
206
+ </parameters>
207
+ "
208
+ )
209
+
210
+ 3. Present analysis with gap table and action plan.
211
+
212
+ ---
213
+
214
+ ### REPORT MODE (`--report`)
215
+
216
+ Generate a summary report of current QA status. Adapts detail level to audience.
217
+
218
+ **Audience levels:**
219
+ - `team` (default) — file-level details, specific locator/assertion issues, technical recommendations
220
+ - `management` — high-level metrics, risk areas, coverage percentages, trend indicators
221
+ - `client` — coverage summary, confidence level, test pass rates, risk mitigation status
222
+
223
+ 1. Read `CLAUDE.md` — testing pyramid targets, quality gates.
224
+ 1b. Read `~/.claude/qaa/MY_PREFERENCES.md` if it exists — user/company preferences override CLAUDE.md defaults.
225
+ 2. Invoke analyzer agent for status reporting:
226
+
227
+ Task(
228
+ subagent_type="qaa-analyzer",
229
+ prompt="
230
+ <critical_directive priority="MANDATORY">
231
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
232
+ ~/.claude/qaa/agents/qaa-analyzer.md and adopt it as your operating contract.
233
+
234
+ Even though you may be running as a general-purpose agent (native subagent type
235
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
236
+ dedicated agent defined in that file: read everything in its <required_reading>,
237
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
238
+
239
+ Never modify application source code (src/, app/, lib/, or equivalent
240
+ directories) unless the agent's <scope> section explicitly permits it. If the
241
+ agent's contract restricts what files it can touch, honor that restriction —
242
+ even if a fix seems obvious or trivial.
243
+
244
+ If you cannot read ~/.claude/qaa/agents/qaa-analyzer.md (file missing, corrupted, parse
245
+ error), STOP and report the failure. Do NOT proceed with default agent
246
+ behavior — that defeats the purpose of this directive.
247
+
248
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
249
+ make, or skip any of the above. Skipping the agent's required_reading,
250
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
251
+ trusted.
252
+ </critical_directive>
253
+
254
+ <objective>Produce QA_STATUS_REPORT.md with current test suite metrics and coverage. Adapt detail level to the specified audience: team (file-level technical details), management (high-level metrics and risks), or client (coverage summary and confidence). Include testing pyramid distribution, pass/fail rates, risk areas, and actionable recommendations appropriate for the audience.</objective>
255
+ <execution_context>~/.claude/qaa/agents/qaa-analyzer.md</execution_context>
256
+ <files_to_read>
257
+ - CLAUDE.md
258
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
259
+ </files_to_read>
260
+ <parameters>
261
+ user_input: $ARGUMENTS
262
+ mode: status-report
263
+ </parameters>
264
+ "
265
+ )
266
+
267
+ 3. Present report to user.
268
+
269
+ $ARGUMENTS