@qa-gentic/agents 1.1.2

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 (52) hide show
  1. package/README.md +203 -0
  2. package/bin/postinstall.js +75 -0
  3. package/bin/qa-stlc.js +76 -0
  4. package/package.json +48 -0
  5. package/skills/qa-stlc/AGENT-BEHAVIOR.md +373 -0
  6. package/skills/qa-stlc/deduplication-protocol.md +303 -0
  7. package/skills/qa-stlc/generate-gherkin.md +550 -0
  8. package/skills/qa-stlc/generate-playwright-code.md +439 -0
  9. package/skills/qa-stlc/generate-test-cases.md +176 -0
  10. package/skills/qa-stlc/write-helix-files.md +349 -0
  11. package/src/cmd-init.js +84 -0
  12. package/src/cmd-mcp-config.js +177 -0
  13. package/src/cmd-skills.js +124 -0
  14. package/src/cmd-verify.js +129 -0
  15. package/src/qa_stlc_agents/__init__.py +0 -0
  16. package/src/qa_stlc_agents/__pycache__/__init__.cpython-310.pyc +0 -0
  17. package/src/qa_stlc_agents/agent_gherkin_generator/__init__.py +0 -0
  18. package/src/qa_stlc_agents/agent_gherkin_generator/__pycache__/__init__.cpython-310.pyc +0 -0
  19. package/src/qa_stlc_agents/agent_gherkin_generator/__pycache__/server.cpython-310.pyc +0 -0
  20. package/src/qa_stlc_agents/agent_gherkin_generator/server.py +502 -0
  21. package/src/qa_stlc_agents/agent_gherkin_generator/tools/__init__.py +0 -0
  22. package/src/qa_stlc_agents/agent_gherkin_generator/tools/__pycache__/__init__.cpython-310.pyc +0 -0
  23. package/src/qa_stlc_agents/agent_gherkin_generator/tools/__pycache__/ado_gherkin.cpython-310.pyc +0 -0
  24. package/src/qa_stlc_agents/agent_gherkin_generator/tools/ado_gherkin.py +854 -0
  25. package/src/qa_stlc_agents/agent_helix_writer/__init__.py +0 -0
  26. package/src/qa_stlc_agents/agent_helix_writer/__pycache__/__init__.cpython-310.pyc +0 -0
  27. package/src/qa_stlc_agents/agent_helix_writer/__pycache__/server.cpython-310.pyc +0 -0
  28. package/src/qa_stlc_agents/agent_helix_writer/server.py +529 -0
  29. package/src/qa_stlc_agents/agent_helix_writer/tools/__init__.py +0 -0
  30. package/src/qa_stlc_agents/agent_helix_writer/tools/__pycache__/__init__.cpython-310.pyc +0 -0
  31. package/src/qa_stlc_agents/agent_helix_writer/tools/__pycache__/helix_write.cpython-310.pyc +0 -0
  32. package/src/qa_stlc_agents/agent_helix_writer/tools/helix_write.py +622 -0
  33. package/src/qa_stlc_agents/agent_playwright_generator/__init__.py +0 -0
  34. package/src/qa_stlc_agents/agent_playwright_generator/__pycache__/__init__.cpython-310.pyc +0 -0
  35. package/src/qa_stlc_agents/agent_playwright_generator/__pycache__/server.cpython-310.pyc +0 -0
  36. package/src/qa_stlc_agents/agent_playwright_generator/server.py +2771 -0
  37. package/src/qa_stlc_agents/agent_playwright_generator/tools/__init__.py +0 -0
  38. package/src/qa_stlc_agents/agent_playwright_generator/tools/__pycache__/__init__.cpython-310.pyc +0 -0
  39. package/src/qa_stlc_agents/agent_playwright_generator/tools/__pycache__/ado_attach.cpython-310.pyc +0 -0
  40. package/src/qa_stlc_agents/agent_playwright_generator/tools/ado_attach.py +62 -0
  41. package/src/qa_stlc_agents/agent_test_case_manager/__init__.py +0 -0
  42. package/src/qa_stlc_agents/agent_test_case_manager/__pycache__/__init__.cpython-310.pyc +0 -0
  43. package/src/qa_stlc_agents/agent_test_case_manager/__pycache__/server.cpython-310.pyc +0 -0
  44. package/src/qa_stlc_agents/agent_test_case_manager/server.py +483 -0
  45. package/src/qa_stlc_agents/agent_test_case_manager/tools/__init__.py +0 -0
  46. package/src/qa_stlc_agents/agent_test_case_manager/tools/__pycache__/__init__.cpython-310.pyc +0 -0
  47. package/src/qa_stlc_agents/agent_test_case_manager/tools/__pycache__/ado_workitem.cpython-310.pyc +0 -0
  48. package/src/qa_stlc_agents/agent_test_case_manager/tools/ado_workitem.py +302 -0
  49. package/src/qa_stlc_agents/shared/__init__.py +0 -0
  50. package/src/qa_stlc_agents/shared/__pycache__/__init__.cpython-310.pyc +0 -0
  51. package/src/qa_stlc_agents/shared/__pycache__/auth.cpython-310.pyc +0 -0
  52. package/src/qa_stlc_agents/shared/auth.py +119 -0
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # @qa-gentic/agents
2
+
3
+ > AI-powered QA STLC automation — from Azure DevOps work item to self-healing Playwright TypeScript in a Helix-QA project.
4
+
5
+ Works with **GitHub Copilot** (VS Code Agent mode), **Claude Code**, **Cursor**, and **Windsurf**.
6
+
7
+ ---
8
+
9
+ ## What It Does
10
+
11
+ Four Python MCP servers cover the full QA Software Test Life Cycle:
12
+
13
+ | Agent | Input | Output |
14
+ |---|---|---|
15
+ | `qa-test-case-manager` | ADO PBI / Bug / Feature ID | Manual test cases created & linked via TestedBy-Forward |
16
+ | `qa-gherkin-generator` | ADO Epic / Feature / PBI / Bug ID | `.feature` file attached to the ADO work item |
17
+ | `qa-playwright-generator` | Gherkin + live browser | `locators.ts` + page objects + step defs attached to ADO |
18
+ | `qa-helix-writer` | Generated `.ts` files + `helix_root` | Files written to Helix-QA directory layout on disk |
19
+
20
+ A fifth server — **Playwright MCP** (`http://localhost:8931/mcp`) — drives a real browser during code generation, replacing hand-authored locators with accessibility-tree-derived, zero-hallucination selectors.
21
+
22
+ ---
23
+
24
+ ## Install
25
+
26
+ ```bash
27
+ npm install -g @qa-gentic/agents
28
+ qa-stlc init --vscode
29
+ ```
30
+
31
+ `qa-stlc init` does three things:
32
+ 1. `pip install qa-gentic-agents` — installs the four Python MCP servers
33
+ 2. Copies skill files to `.github/copilot-instructions/` (and `.claude/` if not `--vscode`)
34
+ 3. Writes `.vscode/mcp.json` with all five servers configured
35
+
36
+ ---
37
+
38
+ ## Requirements
39
+
40
+ - Node.js ≥ 18
41
+ - Python ≥ 3.10
42
+ - Azure DevOps organisation with a `.env` containing:
43
+
44
+ ```
45
+ ADO_ORGANIZATION_URL=https://dev.azure.com/qa-gentic
46
+ ADO_PROJECT_NAME=YourProject
47
+ ADO_PAT=your-personal-access-token
48
+ APP_BASE_URL=your-app-base-url
49
+ APP_EMAIL=your-test-email@example.com
50
+ APP_PASSWORD=your-test-password
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Commands
56
+
57
+ ```bash
58
+ qa-stlc init [--vscode] [--python <path>]
59
+ # Full bootstrap: pip install + skills + MCP config
60
+
61
+ qa-stlc skills [--target claude|vscode|cursor|windsurf|both|print]
62
+ # Copy skill files to the correct AI coding agent directory
63
+
64
+ qa-stlc mcp-config [--vscode] [--print] [--python <path>] [--playwright-port <n>]
65
+ # Write .vscode/mcp.json (--vscode) or .mcp.json (Claude Code)
66
+
67
+ qa-stlc verify
68
+ # Check that all five MCP servers are reachable
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Tool Reference
74
+
75
+ ### qa-test-case-manager
76
+
77
+ | Tool | Description |
78
+ |---|---|
79
+ | `fetch_work_item` | Fetch a PBI, Bug, or Feature with acceptance criteria, linked test cases, and coverage hints. Returns `epic_not_supported` for Epics. Returns `confirmation_required: true` for Features. |
80
+ | `get_linked_test_cases` | List all test cases already linked to a work item. Call before generating to power the deduplication diff. |
81
+ | `create_and_link_test_cases` | Create structured manual test cases in ADO and link them via TestedBy-Forward. |
82
+
83
+ ### qa-gherkin-generator
84
+
85
+ | Tool | Description |
86
+ |---|---|
87
+ | `fetch_epic_hierarchy` | Fetch an Epic and all child Features, PBIs, Bugs, and existing test cases. Use when user provides an Epic ID. |
88
+ | `fetch_feature_hierarchy` | Fetch a Feature and all child PBIs/Bugs with acceptance criteria and existing attachments. Use when user provides a Feature ID. |
89
+ | `fetch_work_item_for_gherkin` | Fetch a PBI or Bug with parent Feature context, suggested file name, and linked test case steps. Use when user provides a PBI or Bug ID. |
90
+ | `attach_gherkin_to_feature` | Validate and attach a `.feature` file to a Feature work item. |
91
+ | `attach_gherkin_to_work_item` | Validate and attach a `.feature` file to a PBI or Bug work item. |
92
+ | `validate_gherkin_content` | Structural validation — tags, scenario count, navigation steps. Returns `valid: bool` + `errors` + `warnings`. |
93
+
94
+ ### qa-playwright-generator
95
+
96
+ | Tool | Description |
97
+ |---|---|
98
+ | `generate_playwright_code` | Generate `locators.ts`, `*Page.ts`, `*.steps.ts`, and `cucumber-profile.js` from validated Gherkin + live AX-tree `context_map`. Hard-blocks if `context_map` is absent to prevent hallucinated locators. |
99
+ | `scaffold_locator_repository` | Generate the six Helix-QA healing infrastructure files: `LocatorHealer.ts`, `LocatorRepository.ts`, `TimingHealer.ts`, `VisualIntentChecker.ts`, `DevToolsHealer.ts`, `HealingDashboard.ts`. |
100
+ | `validate_gherkin_steps` | Check for duplicate step strings and missing `When` steps. Prevents `Ambiguous step definition` runtime errors. |
101
+ | `attach_code_to_work_item` | Attach delta Playwright TypeScript files to an ADO work item. Pass only net-new delta files. |
102
+
103
+ ### qa-helix-writer
104
+
105
+ | Tool | Description |
106
+ |---|---|
107
+ | `inspect_helix_project` | Inspect a Helix-QA project root. Returns `framework_state` (`present` / `partial` / `absent`) and `recommendation` (`tests_only` / `scaffold_and_tests`). |
108
+ | `list_helix_tree` | List the full directory tree of a Helix-QA project. |
109
+ | `read_helix_file` | Read an existing file from the Helix-QA project for overlap detection. |
110
+ | `write_helix_files` | Write generated files to the correct Helix-QA paths. Handles routing, deduplication, and interface adaptation automatically. |
111
+
112
+ ### playwright (external)
113
+
114
+ | Tool | Description |
115
+ |---|---|
116
+ | `browser_navigate` | Navigate to a URL in the live browser. |
117
+ | `browser_snapshot` | Capture the full AX tree — source for zero-hallucination locators. |
118
+ | `browser_fill_form` | Fill multiple form fields by ref. |
119
+ | `browser_click` | Click an element by ref. |
120
+ | `browser_file_upload` | Upload a file to a file input by ref. |
121
+
122
+ ---
123
+
124
+ ## MCP Config
125
+
126
+ ### VS Code / GitHub Copilot (`.vscode/mcp.json`)
127
+
128
+ ```json
129
+ {
130
+ "servers": {
131
+ "qa-test-case-manager": { "command": "/path/to/.venv/bin/qa-test-case-manager" },
132
+ "qa-gherkin-generator": { "command": "/path/to/.venv/bin/qa-gherkin-generator" },
133
+ "qa-playwright-generator": { "command": "/path/to/.venv/bin/qa-playwright-generator" },
134
+ "qa-helix-writer": { "command": "/path/to/.venv/bin/qa-helix-writer" },
135
+ "playwright": { "type": "http", "url": "http://localhost:8931/mcp" }
136
+ }
137
+ }
138
+ ```
139
+
140
+ ### Claude Code (`.mcp.json`)
141
+
142
+ ```json
143
+ {
144
+ "mcpServers": {
145
+ "qa-test-case-manager": { "command": "/path/to/.venv/bin/qa-test-case-manager" },
146
+ "qa-gherkin-generator": { "command": "/path/to/.venv/bin/qa-gherkin-generator" },
147
+ "qa-playwright-generator": { "command": "/path/to/.venv/bin/qa-playwright-generator" },
148
+ "qa-helix-writer": { "command": "/path/to/.venv/bin/qa-helix-writer" },
149
+ "playwright": { "type": "url", "url": "ws://localhost:8931" }
150
+ }
151
+ }
152
+ ```
153
+
154
+ > VS Code requires `http://localhost:8931/mcp` (with `/mcp` suffix).
155
+ > Claude Code requires `ws://localhost:8931` (WebSocket, no `/mcp`).
156
+ > `qa-stlc mcp-config` writes the correct format automatically.
157
+
158
+ ---
159
+
160
+ ## Skills Installed
161
+
162
+ | Skill | Purpose |
163
+ |---|---|
164
+ | `AGENT-BEHAVIOR.md` | Zero-inference contract. Read first. Always. |
165
+ | `generate-test-cases.md` | PBI / Bug / Feature → ADO manual test cases |
166
+ | `generate-gherkin.md` | Epic / Feature / PBI / Bug → validated `.feature` + ADO attach |
167
+ | `generate-playwright-code.md` | Gherkin + live browser → three-layer self-healing Playwright TypeScript |
168
+ | `write-helix-files.md` | Generated files → Helix-QA disk layout, scaffold or merge |
169
+ | `deduplication-protocol.md` | READ → DIFF → CREATE mandatory pre-flight gate |
170
+
171
+ ---
172
+
173
+ ## Three-Layer Self-Healing Architecture
174
+
175
+ | Layer | Class | What it heals |
176
+ |---|---|---|
177
+ | 1 — Locator | `LocatorHealer` | primary selector → role → label → text → AI Vision → CDPSession AX tree |
178
+ | 2 — Timing | `TimingHealer` | network-trace drift → auto-adjusted timeouts → HealingDashboard |
179
+ | 3 — Visual | `VisualIntentChecker` | element screenshot diff at assertions → HealingDashboard |
180
+
181
+ Healed selectors persist in `LocatorRepository`. HealingDashboard: `http://localhost:7890`.
182
+
183
+ ---
184
+
185
+ ## Run Tests
186
+
187
+ ```bash
188
+ ENABLE_SELF_HEALING=true \
189
+ HEALING_DASHBOARD_PORT=7890 \
190
+ APP_BASE_URL=<your-app-base-url> \
191
+ APP_EMAIL=<email> \
192
+ APP_PASSWORD=<password> \
193
+ cucumber-js --config=config/cucumber.js -p <feature_profile>
194
+
195
+ # Smoke only
196
+ cucumber-js --config=config/cucumber.js -p <feature_profile> --tags "@smoke"
197
+ ```
198
+
199
+ ---
200
+
201
+ ## License
202
+
203
+ MIT
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall.js — Auto-install Python MCP servers after npm install -g.
4
+ */
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("child_process");
8
+ const pkg = require("../package.json");
9
+
10
+ const C = {
11
+ reset: "\x1b[0m",
12
+ bold: "\x1b[1m",
13
+ green: "\x1b[32m",
14
+ cyan: "\x1b[36m",
15
+ yellow: "\x1b[33m",
16
+ red: "\x1b[31m",
17
+ dim: "\x1b[2m",
18
+ };
19
+
20
+ const b = (s) => `${C.bold}${s}${C.reset}`;
21
+ const ok = (s) => console.log(`${C.green}✓${C.reset} ${s}`);
22
+ const info = (s) => console.log(`${C.cyan}→${C.reset} ${s}`);
23
+ const warn = (s) => console.log(`${C.yellow}⚠${C.reset} ${s}`);
24
+ const y = (s) => `${C.yellow}${s}${C.reset}`;
25
+ const d = (s) => `${C.dim}${s}${C.reset}`;
26
+
27
+ console.log(`\n${b("QA STLC Agents")} — post-install\n`);
28
+
29
+ // ── 1. Find python ────────────────────────────────────────────────────────────
30
+ const pythonCandidates = ["python3", "python"];
31
+ let python = null;
32
+ for (const candidate of pythonCandidates) {
33
+ const r = spawnSync(candidate, ["--version"], { encoding: "utf8" });
34
+ if (r.status === 0) { python = candidate; break; }
35
+ }
36
+
37
+ if (!python) {
38
+ warn("Python not found — skipping pip install.");
39
+ warn("Run manually after installing Python 3.10+:");
40
+ warn(" pip install qa-gentic-agents");
41
+ } else {
42
+ // ── 2. pip install qa-gentic-agents ──────────────────────────────────────────
43
+ info("Installing qa-gentic-agents via pip…");
44
+ const pip = spawnSync(python, ["-m", "pip", "install", "qa-gentic-agents", "--upgrade", "--quiet"], {
45
+ stdio: "inherit",
46
+ encoding: "utf8",
47
+ });
48
+
49
+ if (pip.status === 0) {
50
+ ok("qa-gentic-agents installed.");
51
+ } else {
52
+ warn("pip install failed. Run manually: pip install qa-gentic-agents");
53
+ }
54
+ }
55
+
56
+ // ── 3. Next steps ─────────────────────────────────────────────────────────────
57
+ console.log(`
58
+ ${b("Next steps")} (run in your project root):
59
+
60
+ Start Playwright MCP ${d("(required for live locator generation)")}
61
+ ${C.cyan}npx @playwright/mcp@latest --port 8931${C.reset}
62
+
63
+ Install skills + write MCP config
64
+ ${C.cyan}qa-stlc init --vscode${C.reset} ${d("# GitHub Copilot / VS Code")}
65
+ ${C.cyan}qa-stlc init${C.reset} ${d("# Claude Code")}
66
+
67
+ ${b("Agents:")}
68
+ ${y("qa-test-case-manager")} ADO work item → test cases in ADO
69
+ ${y("qa-gherkin-generator")} ADO Epic/Feature/PBI/Bug → BDD .feature attached to ADO
70
+ ${y("qa-playwright-generator")} Gherkin → self-healing Playwright TypeScript
71
+ ${y("qa-helix-writer")} Generated files → Helix-QA paths on disk
72
+ ${y("playwright")} (MCP) Live browser snapshots for verified locators
73
+
74
+ ${d("Docs: https://github.com/qa-gentic/qa-gentic-agents")}
75
+ `);
package/bin/qa-stlc.js ADDED
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * qa-stlc — CLI for QA STLC Agents
4
+ *
5
+ * Usage:
6
+ * qa-stlc init # Bootstrap MCP config + skills for current project
7
+ * qa-stlc skills [--target] # Install skills into a coding agent
8
+ * qa-stlc mcp-config [--vscode] # Write MCP server config
9
+ * qa-stlc verify # Check Python agents + Playwright MCP are reachable
10
+ * qa-stlc help # Show full help
11
+ */
12
+
13
+ "use strict";
14
+
15
+ const { program } = require("commander");
16
+ const path = require("path");
17
+ const pkg = require("../package.json");
18
+
19
+ // Sub-commands
20
+ const cmdInit = require("../src/cmd-init");
21
+ const cmdSkills = require("../src/cmd-skills");
22
+ const cmdMcpConfig = require("../src/cmd-mcp-config");
23
+ const cmdVerify = require("../src/cmd-verify");
24
+
25
+ program
26
+ .name("qa-stlc")
27
+ .description(
28
+ "QA STLC Agents — MCP servers + skills for AI-powered test case, Gherkin, and Playwright generation."
29
+ )
30
+ .version(pkg.version);
31
+
32
+ // ── init ─────────────────────────────────────────────────────────────────────
33
+ program
34
+ .command("init")
35
+ .description(
36
+ "Bootstrap the current project: install Python MCP agents, copy skills, and write MCP config.\n" +
37
+ "Equivalent to running: pip install qa-gentic-agents && qa-stlc skills && qa-stlc mcp-config"
38
+ )
39
+ .option("--vscode", "Also write .vscode/mcp.json for GitHub Copilot")
40
+ .option("--python <path>", "Path to Python 3.10+ binary", "python3")
41
+ .action(cmdInit);
42
+
43
+ // ── skills ────────────────────────────────────────────────────────────────────
44
+ program
45
+ .command("skills")
46
+ .description("Install agent skill files into the current project for your coding agent to read.")
47
+ .option(
48
+ "--target <target>",
49
+ "Where to install: claude (default), vscode, cursor, windsurf, print",
50
+ "claude"
51
+ )
52
+ .action(cmdSkills);
53
+
54
+ // ── mcp-config ────────────────────────────────────────────────────────────────
55
+ program
56
+ .command("mcp-config")
57
+ .description("Generate MCP server configuration for Claude Code (.mcp.json) or VS Code (.vscode/mcp.json).")
58
+ .option("--vscode", "Write .vscode/mcp.json instead of .mcp.json")
59
+ .option("--print", "Print config to stdout without writing any file")
60
+ .option("--python <path>", "Path to Python 3.10+ binary or venv", "python3")
61
+ .option("--playwright-port <port>", "Port Playwright MCP is running on", "8931")
62
+ .action(cmdMcpConfig);
63
+
64
+ // ── verify ────────────────────────────────────────────────────────────────────
65
+ program
66
+ .command("verify")
67
+ .description("Check that Python MCP agents are installed and Playwright MCP is reachable.")
68
+ .option("--playwright-port <port>", "Port Playwright MCP is running on", "8931")
69
+ .action(cmdVerify);
70
+
71
+ program.parse(process.argv);
72
+
73
+ // Show help if no command given
74
+ if (!process.argv.slice(2).length) {
75
+ program.outputHelp();
76
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@qa-gentic/agents",
3
+ "version": "1.1.2",
4
+ "description": "QA STLC Agents — MCP servers + skills for AI-powered test case, Gherkin, and Playwright generation against Azure DevOps. Works with Claude Code, GitHub Copilot, Cursor, Windsurf.",
5
+ "keywords": [
6
+ "playwright",
7
+ "mcp",
8
+ "azure-devops",
9
+ "gherkin",
10
+ "bdd",
11
+ "qa",
12
+ "test-automation",
13
+ "claude",
14
+ "copilot",
15
+ "claude-code",
16
+ "mcp-server",
17
+ "self-healing"
18
+ ],
19
+ "homepage": "https://github.com/qa-gentic/qa-gentic-agents#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/qa-gentic/qa-gentic-agents/issues"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/qa-gentic/qa-gentic-agents.git"
26
+ },
27
+ "license": "MIT",
28
+ "bin": {
29
+ "qa-stlc": "bin/qa-stlc.js"
30
+ },
31
+ "files": [
32
+ "bin/",
33
+ "src/",
34
+ "skills/",
35
+ ".claude-plugin/",
36
+ "README.md"
37
+ ],
38
+ "scripts": {
39
+ "postinstall": "node ./bin/postinstall.js"
40
+ },
41
+ "dependencies": {
42
+ "commander": "^12.0.0",
43
+ "which": "^4.0.0"
44
+ },
45
+ "engines": {
46
+ "node": ">=18.0.0"
47
+ }
48
+ }