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,157 +1,181 @@
1
- # QA Research
2
-
3
- Research the testing ecosystem for the current project. Investigates framework capabilities, best practices, selector syntax, and testing patterns using Context7 MCP and official documentation. Produces research files consumed by all downstream QA agents (analyzer, planner, executor, validator).
4
-
5
- ## Usage
6
-
7
- ```
8
- /qa-research [options]
9
- ```
10
-
11
- ### Options
12
-
13
- - `--focus <mode>` — research mode (default: `stack-testing`)
14
- - `stack-testing` — full stack analysis: test runner, assertions, mocking, E2E framework, CI/CD patterns
15
- - `framework-deep-dive` — deep dive into the detected/specified framework: full API, patterns, pitfalls, selector syntax
16
- - `api-testing` — API testing strategy: endpoint patterns, contract testing, auth testing, error testing
17
- - `e2e-strategy` — E2E strategy: framework comparison, POM patterns, selector strategies, visual testing
18
- - `--dev-repo <path>` — path to developer repository (default: current directory)
19
-
20
- ### Mode Detection
21
-
22
- ```
23
- if --focus framework-deep-dive:
24
- MODE = "framework-deep-dive"
25
- elif --focus api-testing:
26
- MODE = "api-testing"
27
- elif --focus e2e-strategy:
28
- MODE = "e2e-strategy"
29
- else:
30
- MODE = "stack-testing"
31
- ```
32
-
33
- ## What It Produces
34
-
35
- All output files are written to `.qa-output/research/`.
36
-
37
- | Mode | Output |
38
- |------|--------|
39
- | stack-testing | `TESTING_STACK.md` (+ `API_TESTING_STRATEGY.md` and `E2E_STRATEGY.md` if project has APIs and frontend) |
40
- | framework-deep-dive | `FRAMEWORK_CAPABILITIES.md` |
41
- | api-testing | `API_TESTING_STRATEGY.md` |
42
- | e2e-strategy | `E2E_STRATEGY.md` |
43
-
44
- These files are consumed by downstream agents:
45
-
46
- | File | Consumed By |
47
- |------|-------------|
48
- | `TESTING_STACK.md` | Analyzer (framework selection), Planner (dependency setup) |
49
- | `FRAMEWORK_CAPABILITIES.md` | Executor (idiomatic test writing), Validator (pattern checking), E2E Runner (correct syntax) |
50
- | `API_TESTING_STRATEGY.md` | Planner (API test case design), Executor (implementation patterns) |
51
- | `E2E_STRATEGY.md` | Planner (E2E scope decisions), Executor (POM and selector patterns) |
52
-
53
- ## Instructions
54
-
55
- ### Step 1: Initialize
56
-
57
- Parse `$ARGUMENTS` for flags.
58
-
59
- ```bash
60
- MODE="stack-testing"
61
- DEV_REPO=""
62
-
63
- if echo "$ARGUMENTS" | grep -qE '\-\-focus'; then
64
- MODE=$(echo "$ARGUMENTS" | grep -oE '\-\-focus\s+[^\s]+' | awk '{print $2}')
65
- fi
66
-
67
- if echo "$ARGUMENTS" | grep -qE '\-\-dev-repo'; then
68
- DEV_REPO=$(echo "$ARGUMENTS" | grep -oE '\-\-dev-repo\s+[^\s]+' | awk '{print $2}')
69
- fi
70
-
71
- if [ -z "$DEV_REPO" ]; then
72
- DEV_REPO=$(pwd)
73
- fi
74
-
75
- mkdir -p .qa-output/research
76
- ```
77
-
78
- Print banner:
79
- ```
80
- === QA Research ===
81
- Mode: {MODE}
82
- Dev Repo: {DEV_REPO}
83
- Output: .qa-output/research/
84
- ====================
85
- ```
86
-
87
- ### Step 2: Read Existing Context (if available)
88
-
89
- Read these files if they exist — they provide context to the researcher:
90
-
91
- - `.qa-output/SCAN_MANIFEST.md` — detected project stack from scanner
92
- - `CLAUDE.md` — QA standards that the research must align with
93
- - `~/.claude/qaa/MY_PREFERENCES.md` — user preferences (framework choices, conventions)
94
-
95
- ### Step 3: Spawn Researcher Agent
96
-
97
- Task(
98
- prompt="
99
- <objective>Research the testing ecosystem for this project. Mode: {MODE}. Use Context7 MCP as the primary source for all framework and library questions. Verify everything against current documentation — do not rely on training data alone.</objective>
100
- <execution_context>@agents/qaa-project-researcher.md</execution_context>
101
- <files_to_read>
102
- - CLAUDE.md
103
- - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
104
- - .qa-output/SCAN_MANIFEST.md (if exists)
105
- </files_to_read>
106
- <parameters>
107
- mode: {MODE}
108
- dev_repo_path: {DEV_REPO}
109
- output_dir: .qa-output/research
110
- </parameters>
111
- "
112
- )
113
-
114
- ### Step 4: Present Results
115
-
116
- After the researcher completes, summarize what was found:
117
-
118
- ```
119
- === Research Complete ===
120
- Mode: {MODE}
121
- Files produced: {list of files in .qa-output/research/}
122
- Framework detected: {name + version}
123
- Key findings:
124
- - {finding 1}
125
- - {finding 2}
126
- - {finding 3}
127
-
128
- These files will be automatically consumed by downstream agents
129
- when you run /qa-create-test, /qa-fix, or /qa-start.
130
- =========================
131
- ```
132
-
133
- $ARGUMENTS
134
-
135
- ## MANDATORY verification — run ALL commands below, no exceptions, no skipping
136
-
137
- Before returning control, copy-paste and run this ENTIRE block. Do NOT decide which commands "apply" — run all of them every time. The output confirms what happened; you do not get to assume the answer.
138
-
139
- ```bash
140
- echo "=== QA-RESEARCH CHECKLIST START ==="
141
- echo "1. Research output files:"
142
- ls .qa-output/research/ 2>/dev/null || echo "NO_RESEARCH_FILES"
143
- echo "2. TESTING_STACK.md content check:"
144
- head -20 .qa-output/research/TESTING_STACK.md 2>/dev/null || echo "NO_TESTING_STACK"
145
- echo "3. FRAMEWORK_CAPABILITIES.md content check:"
146
- head -20 .qa-output/research/FRAMEWORK_CAPABILITIES.md 2>/dev/null || echo "NO_FRAMEWORK_CAPABILITIES"
147
- echo "4. Context7 was used (check for confidence levels):"
148
- grep -c "HIGH\|MEDIUM\|LOW" .qa-output/research/*.md 2>/dev/null || echo "NO_CONFIDENCE_LEVELS"
149
- echo "5. Version information present:"
150
- grep -i "version" .qa-output/research/*.md 2>/dev/null | head -5 || echo "NO_VERSION_INFO"
151
- echo "=== QA-RESEARCH CHECKLIST END ==="
152
- ```
153
-
154
- **Rules:**
155
- - Run the block AS-IS. Do not modify it. Do not split it. Do not skip lines.
156
- - If any output shows a problem (NO_RESEARCH_FILES after research completed), fix it before returning.
157
- - Do NOT mark this task as complete until the block has been executed and you have read every line of output.
1
+ # QA Research
2
+
3
+ Research the testing ecosystem for the current project. Investigates framework capabilities, best practices, selector syntax, and testing patterns using Context7 MCP and official documentation. Produces research files consumed by all downstream QA agents (analyzer, planner, executor, validator).
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /qa-research [options]
9
+ ```
10
+
11
+ ### Options
12
+
13
+ - `--focus <mode>` — research mode (default: `stack-testing`)
14
+ - `stack-testing` — full stack analysis: test runner, assertions, mocking, E2E framework, CI/CD patterns
15
+ - `framework-deep-dive` — deep dive into the detected/specified framework: full API, patterns, pitfalls, selector syntax
16
+ - `api-testing` — API testing strategy: endpoint patterns, contract testing, auth testing, error testing
17
+ - `e2e-strategy` — E2E strategy: framework comparison, POM patterns, selector strategies, visual testing
18
+ - `--dev-repo <path>` — path to developer repository (default: current directory)
19
+
20
+ ### Mode Detection
21
+
22
+ ```
23
+ if --focus framework-deep-dive:
24
+ MODE = "framework-deep-dive"
25
+ elif --focus api-testing:
26
+ MODE = "api-testing"
27
+ elif --focus e2e-strategy:
28
+ MODE = "e2e-strategy"
29
+ else:
30
+ MODE = "stack-testing"
31
+ ```
32
+
33
+ ## What It Produces
34
+
35
+ All output files are written to `.qa-output/research/`.
36
+
37
+ | Mode | Output |
38
+ |------|--------|
39
+ | stack-testing | `TESTING_STACK.md` (+ `API_TESTING_STRATEGY.md` and `E2E_STRATEGY.md` if project has APIs and frontend) |
40
+ | framework-deep-dive | `FRAMEWORK_CAPABILITIES.md` |
41
+ | api-testing | `API_TESTING_STRATEGY.md` |
42
+ | e2e-strategy | `E2E_STRATEGY.md` |
43
+
44
+ These files are consumed by downstream agents:
45
+
46
+ | File | Consumed By |
47
+ |------|-------------|
48
+ | `TESTING_STACK.md` | Analyzer (framework selection), Planner (dependency setup) |
49
+ | `FRAMEWORK_CAPABILITIES.md` | Executor (idiomatic test writing), Validator (pattern checking), E2E Runner (correct syntax) |
50
+ | `API_TESTING_STRATEGY.md` | Planner (API test case design), Executor (implementation patterns) |
51
+ | `E2E_STRATEGY.md` | Planner (E2E scope decisions), Executor (POM and selector patterns) |
52
+
53
+ ## Instructions
54
+
55
+ ### Step 1: Initialize
56
+
57
+ Parse `$ARGUMENTS` for flags.
58
+
59
+ ```bash
60
+ MODE="stack-testing"
61
+ DEV_REPO=""
62
+
63
+ if echo "$ARGUMENTS" | grep -qE '\-\-focus'; then
64
+ MODE=$(echo "$ARGUMENTS" | grep -oE '\-\-focus\s+[^\s]+' | awk '{print $2}')
65
+ fi
66
+
67
+ if echo "$ARGUMENTS" | grep -qE '\-\-dev-repo'; then
68
+ DEV_REPO=$(echo "$ARGUMENTS" | grep -oE '\-\-dev-repo\s+[^\s]+' | awk '{print $2}')
69
+ fi
70
+
71
+ if [ -z "$DEV_REPO" ]; then
72
+ DEV_REPO=$(pwd)
73
+ fi
74
+
75
+ mkdir -p .qa-output/research
76
+ ```
77
+
78
+ Print banner:
79
+ ```
80
+ === QA Research ===
81
+ Mode: {MODE}
82
+ Dev Repo: {DEV_REPO}
83
+ Output: .qa-output/research/
84
+ ====================
85
+ ```
86
+
87
+ ### Step 2: Read Existing Context (if available)
88
+
89
+ Read these files if they exist — they provide context to the researcher:
90
+
91
+ - `.qa-output/SCAN_MANIFEST.md` — detected project stack from scanner
92
+ - `CLAUDE.md` — QA standards that the research must align with
93
+ - `~/.claude/qaa/MY_PREFERENCES.md` — user preferences (framework choices, conventions)
94
+
95
+ ### Step 3: Spawn Researcher Agent
96
+
97
+ Task(
98
+ prompt="
99
+ <critical_directive priority="MANDATORY">
100
+ You are executing as a QAA pipeline agent. Your FIRST action MUST be to read
101
+ ~/.claude/qaa/agents/qaa-project-researcher.md and adopt it as your operating contract.
102
+
103
+ Even though you may be running as a general-purpose agent (native subagent type
104
+ routing for QAA agents is not yet enabled), you MUST behave exactly as the
105
+ dedicated agent defined in that file: read everything in its <required_reading>,
106
+ obey its <quality_gate>, and run its mandatory bash checklist before returning.
107
+
108
+ Never modify application source code (src/, app/, lib/, or equivalent
109
+ directories) unless the agent's <scope> section explicitly permits it. If the
110
+ agent's contract restricts what files it can touch, honor that restriction —
111
+ even if a fix seems obvious or trivial.
112
+
113
+ If you cannot read ~/.claude/qaa/agents/qaa-project-researcher.md (file missing, corrupted, parse
114
+ error), STOP and report the failure. Do NOT proceed with default agent
115
+ behavior — that defeats the purpose of this directive.
116
+
117
+ Do NOT improvise, substitute steps, apply changes the agent isn't allowed to
118
+ make, or skip any of the above. Skipping the agent's required_reading,
119
+ quality_gate, or bash checklist makes the run INVALID — its output cannot be
120
+ trusted.
121
+ </critical_directive>
122
+
123
+ <objective>Research the testing ecosystem for this project. Mode: {MODE}. Use Context7 MCP as the primary source for all framework and library questions. Verify everything against current documentation — do not rely on training data alone.</objective>
124
+ <execution_context>~/.claude/qaa/agents/qaa-project-researcher.md</execution_context>
125
+ <files_to_read>
126
+ - CLAUDE.md
127
+ - ~/.claude/qaa/MY_PREFERENCES.md (if exists)
128
+ - .qa-output/SCAN_MANIFEST.md (if exists)
129
+ </files_to_read>
130
+ <parameters>
131
+ mode: {MODE}
132
+ dev_repo_path: {DEV_REPO}
133
+ output_dir: .qa-output/research
134
+ </parameters>
135
+ "
136
+ )
137
+
138
+ ### Step 4: Present Results
139
+
140
+ After the researcher completes, summarize what was found:
141
+
142
+ ```
143
+ === Research Complete ===
144
+ Mode: {MODE}
145
+ Files produced: {list of files in .qa-output/research/}
146
+ Framework detected: {name + version}
147
+ Key findings:
148
+ - {finding 1}
149
+ - {finding 2}
150
+ - {finding 3}
151
+
152
+ These files will be automatically consumed by downstream agents
153
+ when you run /qa-create-test, /qa-fix, or /qa-start.
154
+ =========================
155
+ ```
156
+
157
+ $ARGUMENTS
158
+
159
+ ## MANDATORY verification — run ALL commands below, no exceptions, no skipping
160
+
161
+ Before returning control, copy-paste and run this ENTIRE block. Do NOT decide which commands "apply" — run all of them every time. The output confirms what happened; you do not get to assume the answer.
162
+
163
+ ```bash
164
+ echo "=== QA-RESEARCH CHECKLIST START ==="
165
+ echo "1. Research output files:"
166
+ ls .qa-output/research/ 2>/dev/null || echo "NO_RESEARCH_FILES"
167
+ echo "2. TESTING_STACK.md content check:"
168
+ head -20 .qa-output/research/TESTING_STACK.md 2>/dev/null || echo "NO_TESTING_STACK"
169
+ echo "3. FRAMEWORK_CAPABILITIES.md content check:"
170
+ head -20 .qa-output/research/FRAMEWORK_CAPABILITIES.md 2>/dev/null || echo "NO_FRAMEWORK_CAPABILITIES"
171
+ echo "4. Context7 was used (check for confidence levels):"
172
+ grep -c "HIGH\|MEDIUM\|LOW" .qa-output/research/*.md 2>/dev/null || echo "NO_CONFIDENCE_LEVELS"
173
+ echo "5. Version information present:"
174
+ grep -i "version" .qa-output/research/*.md 2>/dev/null | head -5 || echo "NO_VERSION_INFO"
175
+ echo "=== QA-RESEARCH CHECKLIST END ==="
176
+ ```
177
+
178
+ **Rules:**
179
+ - Run the block AS-IS. Do not modify it. Do not split it. Do not skip lines.
180
+ - If any output shows a problem (NO_RESEARCH_FILES after research completed), fix it before returning.
181
+ - Do NOT mark this task as complete until the block has been executed and you have read every line of output.
@@ -4,16 +4,72 @@ Run the complete QA automation pipeline. Analyzes a repository, generates a stan
4
4
 
5
5
  ## Usage
6
6
 
7
- /qa-start [--dev-repo <path>] [--qa-repo <path>] [--auto]
7
+ ```
8
+ /qa-start [--dev-repo <path>] [--qa-repo <path>] [--app-url <url>] [--framework <name>] [--auto]
9
+ ```
8
10
 
9
- - No arguments: uses current directory as dev repo (Option 1)
10
- - --dev-repo: explicit path to developer repository
11
- - --qa-repo: path to existing QA repository (triggers Option 2 or 3)
12
- - --auto: enable auto-advance mode (no pauses at safe checkpoints)
11
+ - **No arguments**: uses current directory as dev repo (Option 1)
12
+ - **`--dev-repo <path>`**: explicit path to developer repository
13
+ - **`--qa-repo <path>`**: path to existing QA repository (triggers Option 2 or 3)
14
+ - **`--app-url <url>`**: URL of the running application (used by E2E runner, validator Layer 5, testid-injector verification, bug-detective reproduction). Assumes a repo is also provided (this flag is metadata, not a mode switch)
15
+ - **`--framework <name>`**: override framework auto-detection (playwright, cypress, jest, vitest, pytest, selenium, robot-framework)
16
+ - **`--auto`**: enable auto-advance mode (no pauses at safe checkpoints)
17
+
18
+ ## Natural language fallback
19
+
20
+ This command also accepts natural language. The intent detector will extract URLs, paths (with or without quotes, with or without spaces), framework hints, and ticket URLs from your prompt. If you don't pass a flag explicitly but mention the value in NL, the system will detect it and show you the resolved interpretation in the **INPUT DETECTION** banner before starting the pipeline. Flags always win over NL.
21
+
22
+ Examples:
23
+
24
+ ```
25
+ # All flags explicit
26
+ /qa-start --dev-repo ./myproject --app-url https://staging.example.com --auto
27
+
28
+ # Natural language equivalent
29
+ /qa-start use playwright on my project at ./myproject and test against https://staging.example.com
30
+
31
+ # Mixed (flags win where present, NL fills gaps)
32
+ /qa-start --dev-repo ./myproject test against https://staging.example.com using playwright
33
+ ```
34
+
35
+
36
+ ## ⚠ MANDATORY: How to Execute This Command
37
+
38
+ When invoked, you **MUST** follow `@workflows/qa-start.md` literally — every step, in order, as written. The workflow file contains an explicit `<critical_directive>` block at the top with mandatory execution rules. Read and obey those rules before doing anything else.
39
+
40
+ ### DO NOT
41
+
42
+ - Analyze the target repo before running the workflow's Step 1
43
+ - Decide that "the standard pipeline doesn't apply" because the repo is empty / has a URL / uses a different framework
44
+ - Scaffold files directly without going through the pipeline stages
45
+ - Skip the intent detector (Step 1) regardless of what arguments you received
46
+ - Generate any test files (.spec.ts, .robot, .py, etc.) before reaching the `<step name="generate">` stage
47
+
48
+ ### DO
49
+
50
+ - Run the workflow's Step 1 (intent detector via `node ~/.claude/qaa/bin/lib/intent-detector.cjs --resolve ...`) as your **FIRST** tool call
51
+ - Show the INPUT DETECTION banner before any other action
52
+ - Run the 5 input validations
53
+ - Pause at the confirmation checkpoint if applicable (interactive mode + any value from NL or default)
54
+ - Let each step's verification gates determine success/failure
55
+ - Report errors as pipeline failures, not as opportunities to adapt
56
+
57
+ If you find yourself improvising or scaffolding files before Step 1 has run, **STOP, return to the workflow, and start over from Step 1**.
58
+
59
+
60
+ ### Pass user input literally to the intent detector
61
+
62
+ When the workflow's Step 1 invokes the intent detector with `$ARGUMENTS`, you must substitute that placeholder with the **raw user input as received in the slash command**, NOT with a pre-translated flag-formatted string.
63
+
64
+ **WRONG:** mentally parsing the user's NL and constructing `--app-url https://x --dev-repo C:\y` before calling the detector.
65
+
66
+ **RIGHT:** passing the literal text the user typed (e.g., `"from URL https://x to C:\y using playwright"`) and letting the detector handle the parsing.
67
+
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.
13
69
 
14
70
  ## Instructions
15
71
 
16
- 1. Read `CLAUDE.md` -- all QA standards that govern the pipeline.
72
+ 1. Read `CLAUDE.md` all QA standards that govern the pipeline.
17
73
  2. Execute the workflow:
18
74
 
19
75
  Follow the workflow defined in `@workflows/qa-start.md` end-to-end.