qaa-agent 1.7.1 → 1.7.4

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
@@ -19,7 +19,7 @@ All notable changes to QAA (QA Automation Agent) are documented here.
19
19
  - **E2E runner max fix loops: 3 → 5** -- more attempts to fix locator/assertion mismatches before giving up
20
20
  - **Installer**: updated paths for new package structure (commands/ and skills/ at root level), updated command list to reflect 7 consolidated commands
21
21
  - **Package structure**: commands and skills now live at package root instead of `.claude/` subdirectory
22
- - **Repository**: moved to `capmation/qaa-testing`
22
+ - **Repository**: moved to new GitHub organization
23
23
 
24
24
  ### Consolidated
25
25
  - 7 slash commands: `/qa-start`, `/qa-create-test`, `/qa-map`, `/qa-testid`, `/qa-pr`, `/qa-audit`, `/qa-fix`
package/README.md ADDED
@@ -0,0 +1,373 @@
1
+ # QAA - QA Automation Agent
2
+
3
+ [![npm version](https://img.shields.io/npm/v/qaa-agent.svg)](https://www.npmjs.com/package/qaa-agent)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Multi-agent QA pipeline for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). Analyzes any codebase, generates a complete test suite following industry standards, validates everything, and delivers the result as a draft pull request.
7
+
8
+ ```
9
+ scan → map → analyze → plan → generate → validate → deliver
10
+ ```
11
+
12
+ ---
13
+
14
+ ## The Problem
15
+
16
+ - **Starting from zero is painful** — a new project with no tests means weeks of setup
17
+ - **Coverage gaps are invisible** — without analysis, teams don't know what's missing until production breaks
18
+ - **Standards drift** — different team members write tests differently: inconsistent locators, vague assertions, mixed naming
19
+ - **QA is always behind dev** — features ship faster than tests get written
20
+
21
+ ## The Solution
22
+
23
+ QAA runs a pipeline of 12 specialized AI agents, each responsible for one stage:
24
+
25
+ | Stage | What happens | Output |
26
+ |-------|-------------|--------|
27
+ | **Scan** | Detects framework, language, testable surfaces | `SCAN_MANIFEST.md` |
28
+ | **Map** | Deep-scans codebase with 4 parallel agents (testability, risk, patterns, existing tests) | 8 codebase documents |
29
+ | **Analyze** | Produces risk assessment, test inventory, testing pyramid | `QA_ANALYSIS.md`, `TEST_INVENTORY.md` |
30
+ | **Plan** | Groups test cases by feature, assigns to files, resolves dependencies | `GENERATION_PLAN.md` |
31
+ | **Generate** | Writes test files, POMs, fixtures, configs following project standards | Test suite on disk |
32
+ | **Validate** | 4-layer validation (syntax, structure, dependencies, logic) with auto-fix | `VALIDATION_REPORT.md` |
33
+ | **Deliver** | Creates branch, commits per stage, opens draft PR | Pull request URL |
34
+
35
+ ---
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ npx qaa-agent
41
+ ```
42
+
43
+ The interactive installer:
44
+
45
+ 1. Copies agents, commands, skills, templates, and workflows into your runtime directory
46
+ 2. Configures the [Playwright MCP](https://github.com/anthropics/mcp-playwright) server in your user-scope config (`~/.claude.json`) so it's available in **all projects**
47
+ 3. Merges required permissions into `settings.json`
48
+
49
+ **Supported runtimes:** Claude Code, OpenCode
50
+
51
+ **Install scope:** Global (`~/.claude/`, available in all projects) or Local (`./.claude/`, this project only)
52
+
53
+ ### Requirements
54
+
55
+ - [Node.js](https://nodejs.org/) 18+
56
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
57
+
58
+ ### Playwright MCP (required for E2E)
59
+
60
+ QAA uses [`@playwright/mcp`](https://www.npmjs.com/package/@playwright/mcp) to open a real browser, extract locators from live pages, run E2E tests, and auto-fix locator mismatches.
61
+
62
+ **You need to install the Playwright MCP server manually in your environment:**
63
+
64
+ <details>
65
+ <summary><strong>VS Code (Claude Code extension)</strong></summary>
66
+
67
+ 1. Open VS Code Settings (`Ctrl+Shift+P` > `Preferences: Open User Settings (JSON)`)
68
+ 2. Add the MCP server config:
69
+
70
+ ```json
71
+ {
72
+ "claude-code.mcpServers": {
73
+ "playwright": {
74
+ "command": "npx",
75
+ "args": ["@playwright/mcp@latest"]
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ Or add it to your project's `.vscode/mcp.json`:
82
+
83
+ ```json
84
+ {
85
+ "servers": {
86
+ "playwright": {
87
+ "command": "npx",
88
+ "args": ["@playwright/mcp@latest"]
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ </details>
95
+
96
+ <details>
97
+ <summary><strong>Claude Code CLI</strong></summary>
98
+
99
+ Add to `~/.claude.json` (user-scope, all projects):
100
+
101
+ ```json
102
+ {
103
+ "mcpServers": {
104
+ "playwright": {
105
+ "command": "npx",
106
+ "args": ["@playwright/mcp@latest"]
107
+ }
108
+ }
109
+ }
110
+ ```
111
+
112
+ Or add a `.mcp.json` file in your project root for project-scope only.
113
+
114
+ </details>
115
+
116
+ Once configured, Playwright MCP enables QAA to:
117
+ - Open a real browser and navigate your running app
118
+ - Extract actual locators (`data-testid`, ARIA roles, labels) from live pages
119
+ - Run E2E tests, capture failures, and auto-fix locator mismatches
120
+ - Build a persistent **Locator Registry** (`.qa-output/locators/`) that caches real locators across features
121
+
122
+ ---
123
+
124
+ ## Quick Start
125
+
126
+ ### New project, no tests
127
+
128
+ ```
129
+ /qa-start --dev-repo ./myproject --auto
130
+ ```
131
+
132
+ Runs the full pipeline end-to-end: scan, map, analyze, plan, generate, validate, and deliver as a draft PR.
133
+
134
+ ### Mature project, new feature
135
+
136
+ ```
137
+ /qa-map # build the "brain" (once)
138
+ /qa-create-test "password reset" # generate tests using codebase knowledge
139
+ /qa-pr --ticket PROJ-123 "password reset tests" # ship as draft PR
140
+ ```
141
+
142
+ ### From a Jira ticket
143
+
144
+ ```
145
+ /qa-from-ticket https://company.atlassian.net/browse/PROJ-456
146
+ /qa-pr --ticket PROJ-456 "login flow tests"
147
+ ```
148
+
149
+ ### Fix broken tests after a deploy
150
+
151
+ ```
152
+ /qa-fix ./tests/e2e/checkout*
153
+ /qa-pr --ticket PROJ-789 "fix checkout tests"
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Commands
159
+
160
+ | Command | Purpose |
161
+ |---------|---------|
162
+ | `/qa-start` | Full pipeline end-to-end (scan through PR) |
163
+ | `/qa-map` | Deep codebase analysis with 4 parallel agents |
164
+ | `/qa-create-test <feature>` | Generate tests for a specific feature |
165
+ | `/qa-fix [path]` | Diagnose and fix broken tests |
166
+ | `/qa-audit [path]` | 6-dimension quality audit with scoring |
167
+ | `/qa-pr` | Create a draft pull request from QA artifacts |
168
+ | `/qa-testid [path]` | Inject `data-testid` attributes into components |
169
+
170
+ ### Additional Commands
171
+
172
+ | Command | Purpose |
173
+ |---------|---------|
174
+ | `/qa-from-ticket <url>` | Generate tests from a Jira/Linear/GitHub Issue |
175
+ | `/qa-analyze` | Analyze a repo without generating tests |
176
+ | `/qa-validate [path]` | Validate test files against standards |
177
+ | `/qa-gap` | Find coverage gaps between dev and QA repos |
178
+ | `/qa-report` | Generate a QA status report |
179
+ | `/qa-audit` | Full quality audit with weighted scoring |
180
+ | `/qa-blueprint` | Generate QA repo structure from scratch |
181
+ | `/qa-research` | Research best testing stack for a project |
182
+ | `/qa-pom` | Generate Page Object Models |
183
+ | `/update-test` | Improve existing tests incrementally |
184
+
185
+ Run any command in Claude Code to see full usage and available flags.
186
+
187
+ ---
188
+
189
+ ## Three Workflows
190
+
191
+ QAA adapts to the project's QA maturity:
192
+
193
+ **Option 1: No QA repo yet** — Full pipeline from scratch. Produces a complete test suite, repo blueprint, and draft PR.
194
+
195
+ ```
196
+ /qa-start --dev-repo ./myproject
197
+ ```
198
+
199
+ **Option 2: Immature QA repo** — Scans both repos, fixes broken tests, fills coverage gaps, standardizes existing tests.
200
+
201
+ ```
202
+ /qa-start --dev-repo ./myproject --qa-repo ./tests
203
+ ```
204
+
205
+ **Option 3: Mature QA repo** — Surgical additions only. Finds thin coverage areas and adds targeted tests without touching working code.
206
+
207
+ ```
208
+ /qa-start --dev-repo ./myproject --qa-repo ./tests
209
+ ```
210
+
211
+ ---
212
+
213
+ ## The "Brain" — Codebase Map
214
+
215
+ Before generating anything, QAA maps the codebase with 4 parallel agents producing 8 documents:
216
+
217
+ | Focus | Documents |
218
+ |-------|-----------|
219
+ | **Testability** | `TESTABILITY.md`, `TEST_SURFACE.md` — what's testable, entry points, mock boundaries |
220
+ | **Risk** | `RISK_MAP.md`, `CRITICAL_PATHS.md` — business-critical paths, security-sensitive areas |
221
+ | **Patterns** | `CODE_PATTERNS.md`, `API_CONTRACTS.md` — naming conventions, API shapes, import style |
222
+ | **Existing tests** | `TEST_ASSESSMENT.md`, `COVERAGE_GAPS.md` — current quality, frameworks, gaps |
223
+
224
+ Every downstream agent reads these documents. The result: generated tests feel native to the codebase, not generic boilerplate.
225
+
226
+ ---
227
+
228
+ ## Standards Enforced
229
+
230
+ Every generated artifact follows strict rules:
231
+
232
+ ### Testing Pyramid
233
+
234
+ ```
235
+ / E2E \ 3-5% (critical path smoke only)
236
+ / API \ 20-25% (endpoints + contracts)
237
+ / Integration\ 10-15% (component interactions)
238
+ / Unit \ 60-70% (business logic, pure functions)
239
+ ```
240
+
241
+ ### Locator Hierarchy
242
+
243
+ 1. **Tier 1 (Best):** `data-testid`, ARIA roles with accessible names
244
+ 2. **Tier 2 (Good):** Form labels, placeholders, visible text
245
+ 3. **Tier 3 (Acceptable):** Alt text, title attributes
246
+ 4. **Tier 4 (Last Resort):** CSS selectors, XPath — always with a `// TODO` comment
247
+
248
+ ### Page Object Model
249
+
250
+ - One class per page, no god objects
251
+ - No assertions in POMs — assertions belong in test specs
252
+ - Locators as readonly properties
253
+ - Every POM extends a shared `BasePage`
254
+
255
+ ### Assertion Quality
256
+
257
+ ```typescript
258
+ // Good — concrete values
259
+ expect(response.status).toBe(200);
260
+ expect(data.name).toBe('Test User');
261
+
262
+ // Bad — never do this
263
+ expect(response.status).toBeTruthy();
264
+ expect(data).toBeDefined();
265
+ ```
266
+
267
+ ### Test Case IDs
268
+
269
+ Every test case has a unique ID following the pattern:
270
+ - `UT-MODULE-001` — unit tests
271
+ - `INT-MODULE-001` — integration tests
272
+ - `API-RESOURCE-001` — API tests
273
+ - `E2E-FLOW-001` — E2E tests
274
+
275
+ ---
276
+
277
+ ## Validation
278
+
279
+ Generated tests pass through a 4-layer validation with auto-fix (up to 3 loops):
280
+
281
+ 1. **Syntax** — does it parse? Are imports correct?
282
+ 2. **Structure** — POM rules, file organization, naming conventions
283
+ 3. **Dependencies** — all imports resolve, mocks set up correctly
284
+ 4. **Logic** — assertions are concrete, locators follow tier hierarchy
285
+
286
+ If issues remain, the **Bug Detective** classifies each failure:
287
+
288
+ | Classification | Action |
289
+ |----------------|--------|
290
+ | `APPLICATION BUG` | Flagged for developer — not auto-fixed |
291
+ | `TEST CODE ERROR` | Auto-fixed at HIGH confidence |
292
+ | `ENVIRONMENT ISSUE` | Documented with setup instructions |
293
+ | `INCONCLUSIVE` | Flagged with evidence for manual review |
294
+
295
+ ---
296
+
297
+ ## Framework Support
298
+
299
+ QAA auto-detects the project's existing stack and matches it:
300
+
301
+ **Languages:** JavaScript/TypeScript, Python, Java, .NET/C#, Go, Ruby, PHP, Rust
302
+
303
+ **Test Frameworks:** Playwright, Cypress, Jest, Vitest, pytest, Selenium, and more
304
+
305
+ **Build Tools:** Vite, Next.js, Nuxt, Angular, Vue, Webpack, SvelteKit
306
+
307
+ **Git Platforms:** GitHub, Azure DevOps, GitLab
308
+
309
+ ---
310
+
311
+ ## Learning System
312
+
313
+ QAA remembers your preferences across sessions. When you correct it — "use Playwright, not Cypress" or "our branches start with `feature/`" — it saves the rule permanently to `MY_PREFERENCES.md`. Every agent reads your preferences before generating output.
314
+
315
+ Your team's conventions always win over defaults.
316
+
317
+ ---
318
+
319
+ ## Architecture
320
+
321
+ ```
322
+ qaa-agent/
323
+ agents/ # 12 specialized QA agents
324
+ commands/ # 7 slash commands (user-facing entry points)
325
+ skills/ # 6 reusable skills
326
+ templates/ # 10 artifact templates (output format contracts)
327
+ workflows/ # 7 workflow orchestration specs
328
+ bin/ # Installer and CLI tools
329
+ docs/ # User documentation
330
+ CLAUDE.md # QA standards (read by every agent)
331
+ .mcp.json # Playwright MCP server config
332
+ settings.json # Claude Code permissions
333
+ ```
334
+
335
+ ### Agents
336
+
337
+ | Agent | Responsibility |
338
+ |-------|---------------|
339
+ | `qa-scanner` | Framework detection, file tree scanning |
340
+ | `qa-codebase-mapper` | 4-parallel-agent deep analysis |
341
+ | `qa-analyzer` | Risk assessment, test inventory, pyramid |
342
+ | `qa-planner` | Test case grouping, file assignment |
343
+ | `qa-executor` | Test file, POM, fixture generation |
344
+ | `qa-validator` | 4-layer validation with auto-fix |
345
+ | `qa-e2e-runner` | Browser-based test execution via Playwright MCP |
346
+ | `qa-bug-detective` | Failure classification with evidence |
347
+ | `qa-testid-injector` | `data-testid` attribute injection |
348
+ | `qa-project-researcher` | Testing stack research |
349
+ | `qa-discovery` | Project discovery |
350
+ | `qa-pipeline-orchestrator` | Pipeline coordination |
351
+
352
+ ---
353
+
354
+ ## Git Workflow
355
+
356
+ QAA follows strict git conventions:
357
+
358
+ - **Branch:** `qa/auto-{project}-{date}` (e.g., `qa/auto-shopflow-2026-03-18`)
359
+ - **Commits:** One per agent stage — `qa(scanner): produce SCAN_MANIFEST.md for shopflow`
360
+ - **PR:** Draft PR with analysis summary, test counts, coverage metrics, validation status
361
+
362
+ ---
363
+
364
+ ## Documentation
365
+
366
+ All documentation is included in the installed package under `docs/`, `templates/`, and `CLAUDE.md`.
367
+
368
+ ---
369
+
370
+ ## License
371
+
372
+ MIT
373
+
package/bin/install.cjs CHANGED
@@ -143,22 +143,24 @@ async function main() {
143
143
  copyFile(path.join(ROOT, 'CLAUDE.md'), path.join(qaaDir, 'CLAUDE.md'));
144
144
  ok('Installed QA standards (CLAUDE.md)');
145
145
 
146
- // Install .mcp.json (Playwright MCP server config) -- both to qaaDir AND global baseDir
146
+ // Install .mcp.json (Playwright MCP server config)
147
147
  const mcpSrc = path.join(ROOT, '.mcp.json');
148
148
  if (fs.existsSync(mcpSrc)) {
149
149
  // Copy to qaa dir for reference
150
150
  copyFile(mcpSrc, path.join(qaaDir, '.mcp.json'));
151
- // Merge into global ~/.claude/.mcp.json so Playwright MCP is available in ALL projects
152
- const globalMcpPath = path.join(baseDir, '.mcp.json');
153
- let globalMcp = { mcpServers: {} };
154
- if (fs.existsSync(globalMcpPath)) {
155
- try { globalMcp = JSON.parse(fs.readFileSync(globalMcpPath, 'utf8')); } catch {}
156
- globalMcp.mcpServers = globalMcp.mcpServers || {};
151
+
152
+ // Merge MCP servers into ~/.claude.json (user-scope) so they're available in ALL projects
153
+ // Note: ~/.claude/.mcp.json is project-scope for ~/.claude/ only — NOT global
154
+ const userConfigPath = path.join(HOME, '.claude.json');
155
+ let userConfig = {};
156
+ if (fs.existsSync(userConfigPath)) {
157
+ try { userConfig = JSON.parse(fs.readFileSync(userConfigPath, 'utf8')); } catch {}
157
158
  }
159
+ userConfig.mcpServers = userConfig.mcpServers || {};
158
160
  const qaaMcp = JSON.parse(fs.readFileSync(mcpSrc, 'utf8'));
159
- Object.assign(globalMcp.mcpServers, qaaMcp.mcpServers);
160
- fs.writeFileSync(globalMcpPath, JSON.stringify(globalMcp, null, 2));
161
- ok('Installed Playwright MCP server config (global — available in all projects)');
161
+ Object.assign(userConfig.mcpServers, qaaMcp.mcpServers);
162
+ fs.writeFileSync(userConfigPath, JSON.stringify(userConfig, null, 2));
163
+ ok('Installed Playwright MCP server config (user-scope — available in all projects)');
162
164
  }
163
165
 
164
166
  // Write version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qaa-agent",
3
- "version": "1.7.1",
3
+ "version": "1.7.4",
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"
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "repository": {
19
19
  "type": "git",
20
- "url": "https://github.com/capmation/qaa-testing.git"
20
+ "url": "https://github.com/Backhaus7997/qaa-testing.git"
21
21
  },
22
22
  "author": "Backhaus7997",
23
23
  "license": "MIT",