ghost-qa 1.3.1 → 1.3.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.
- package/README.md +11 -8
- package/SKILL.md +6 -4
- package/dist/bin/ghost-qa.d.ts +3 -3
- package/dist/bin/ghost-qa.d.ts.map +1 -1
- package/dist/bin/ghost-qa.js +408 -405
- package/dist/bin/ghost-qa.js.map +1 -1
- package/dist/src/engine/audit-runner.d.ts +1 -1
- package/dist/src/engine/audit-runner.js +1 -1
- package/dist/src/mcp/server.d.ts +2 -2
- package/dist/src/mcp/server.js +2 -2
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/reporter/agent-diagnostic.js +1 -1
- package/dist/src/reporter/agent-diagnostic.js.map +1 -1
- package/dist/src/reporter/html-report.js +1 -1
- package/dist/src/reporter/html-report.js.map +1 -1
- package/package.json +91 -91
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/avivgerz-hue/ghost-qa/actions/workflows/ci.yml)
|
|
6
6
|
[](https://www.npmjs.com/package/ghost-qa)
|
|
7
|
+
[](https://www.npmjs.com/package/ghost-qa)
|
|
7
8
|
[](./LICENSE)
|
|
8
9
|
[](https://nodejs.org)
|
|
9
10
|
[](https://playwright.dev)
|
|
@@ -15,11 +16,13 @@ Coding agents (Claude Code, Codex, Cursor, Windsurf) write code **blind** — th
|
|
|
15
16
|
`ghost-qa` fixes that. One command launches a headless browser against your running app, crawls the live DOM, safely pokes every button, traps runtime/network/layout failures, and hands the agent a structured **Self-Healing Bug Report** so it fixes its own bugs *before* telling you it's done.
|
|
16
17
|
|
|
17
18
|
```bash
|
|
18
|
-
npx
|
|
19
|
+
npx -y ghost-qa test http://localhost:3000
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
No test scripts. No config. No mercy for "it works on my machine".
|
|
22
23
|
|
|
24
|
+
> Prefer running straight from GitHub instead of npm? `npx -y github:avivgerz-hue/ghost-qa test http://localhost:3000` works identically — every command in this README accepts either package source (`ghost-qa mcp`, `ghost-qa init`, …).
|
|
25
|
+
|
|
23
26
|
---
|
|
24
27
|
|
|
25
28
|
## ⚡ Quickstart
|
|
@@ -30,10 +33,10 @@ npm run dev # → http://localhost:3000
|
|
|
30
33
|
|
|
31
34
|
# 2. Verify it in a real browser (one-time: downloads Chromium)
|
|
32
35
|
npx playwright install chromium
|
|
33
|
-
npx
|
|
36
|
+
npx -y ghost-qa test http://localhost:3000
|
|
34
37
|
|
|
35
38
|
# 3. Teach your coding agent to do this automatically, forever
|
|
36
|
-
npx
|
|
39
|
+
npx -y ghost-qa init
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
`ghost-qa init` installs `.claude/skills/ghost-qa/SKILL.md` and appends the strict **"Verify in Browser Before Done"** protocol to `CLAUDE.md`, `AGENTS.md`, and `.cursorrules`. From then on, your agent runs ghost-qa itself, fixes what it finds, and only reports completion on a PASS.
|
|
@@ -121,7 +124,7 @@ Plus a **safety-first Interaction Runner**: it fills forms with inert data (`gho
|
|
|
121
124
|
ghost-qa ships a zero-dependency **Model Context Protocol** server (JSON-RPC 2.0 over stdio), so MCP hosts can invoke browser verification as a native tool instead of shelling out:
|
|
122
125
|
|
|
123
126
|
```bash
|
|
124
|
-
npx
|
|
127
|
+
npx -y ghost-qa mcp
|
|
125
128
|
```
|
|
126
129
|
|
|
127
130
|
| MCP tool | What it does |
|
|
@@ -129,10 +132,10 @@ npx github:avivgerz-hue/ghost-qa mcp
|
|
|
129
132
|
| `ghost_qa_audit_url` | Runs the full crawl + 5-trap suite against a running URL and returns the Self-Healing Bug Report (text + structured content) |
|
|
130
133
|
| `ghost_qa_doctor` | Verifies Node, Chromium availability, and runs a live browser smoke test |
|
|
131
134
|
|
|
132
|
-
`npx
|
|
135
|
+
`npx -y ghost-qa init` writes the ready-to-use `.mcp.json` entry for you (merging with any servers you already have):
|
|
133
136
|
|
|
134
137
|
```json
|
|
135
|
-
{ "mcpServers": { "ghost-qa": { "command": "npx", "args": ["-y", "
|
|
138
|
+
{ "mcpServers": { "ghost-qa": { "command": "npx", "args": ["-y", "ghost-qa", "mcp"] } } }
|
|
136
139
|
```
|
|
137
140
|
|
|
138
141
|
Works with Claude Code, Claude Desktop, Cursor, Codex — any MCP host.
|
|
@@ -151,7 +154,7 @@ docker run -i ghost-qa # MCP JSON-RPC over stdin/stdout
|
|
|
151
154
|
Don't even start the dev server yourself — ghost-qa will spawn it, wait for the URL to respond, audit, and terminate the whole process tree afterward:
|
|
152
155
|
|
|
153
156
|
```bash
|
|
154
|
-
npx
|
|
157
|
+
npx -y ghost-qa test http://localhost:3000 --server-cmd "npm run dev"
|
|
155
158
|
```
|
|
156
159
|
|
|
157
160
|
Pair it with `--html ghost-qa-report.html` for a self-contained, dark-mode **visual evidence dashboard** (routes, interactions, every trap finding per viewport) you can attach to CI artifacts or PRs.
|
|
@@ -224,7 +227,7 @@ Works with any stack that serves HTML on localhost — Next.js, Vite, Remix, Ast
|
|
|
224
227
|
|
|
225
228
|
## 🤖 The Agent Skill
|
|
226
229
|
|
|
227
|
-
`SKILL.md` (repo root) is the master skill. `npx
|
|
230
|
+
`SKILL.md` (repo root) is the master skill. `npx -y ghost-qa init` installs it for:
|
|
228
231
|
|
|
229
232
|
- **Claude Code** → `.claude/skills/ghost-qa/SKILL.md` + protocol in `CLAUDE.md`
|
|
230
233
|
- **Codex / generic agents** → protocol in `AGENTS.md`
|
package/SKILL.md
CHANGED
|
@@ -26,13 +26,15 @@ Unit tests, type-checking, linting and code review do **not** satisfy this rule.
|
|
|
26
26
|
|
|
27
27
|
| Situation | Command |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
| Dev server already running | `npx
|
|
30
|
-
| Server not running (most common) | `npx
|
|
29
|
+
| Dev server already running | `npx -y ghost-qa test <url>` |
|
|
30
|
+
| Server not running (most common) | `npx -y ghost-qa test <url> --server-cmd "npm run dev"` — ghost-qa spawns it, waits for it, audits, and kills the process tree afterward |
|
|
31
31
|
| Your host exposes MCP tools | Call **`ghost_qa_audit_url`** with the URL (call `ghost_qa_doctor` first if it errors) — identical engine, identical report |
|
|
32
32
|
| Mobile-only bug hunt | add `--viewport mobile` |
|
|
33
33
|
| Large app | add `--max-depth 3 --max-routes 50` |
|
|
34
34
|
| Evidence for a PR/CI | add `--report ghost-qa-report.md --html ghost-qa-report.html` |
|
|
35
35
|
|
|
36
|
+
> All commands use the published npm package (`npx -y ghost-qa …`). If npm is unavailable, `npx -y github:avivgerz-hue/ghost-qa …` runs the identical CLI straight from GitHub.
|
|
37
|
+
|
|
36
38
|
Common local URLs: Next.js / CRA `http://localhost:3000`, Vite `http://localhost:5173`, Astro `http://localhost:4321`, Angular `http://localhost:4200`. If unsure, check the dev server output or `package.json` scripts — never guess silently; state the URL you verified in your completion message.
|
|
37
39
|
|
|
38
40
|
## The Self-Healing Loop
|
|
@@ -82,7 +84,7 @@ ghost-qa never clicks destructive controls (delete, checkout, pay, logout, publi
|
|
|
82
84
|
|
|
83
85
|
| Symptom | Do this |
|
|
84
86
|
| --- | --- |
|
|
85
|
-
| "could not launch Chromium" | `npx playwright install chromium` (one-time), then `npx
|
|
87
|
+
| "could not launch Chromium" | `npx playwright install chromium` (one-time), then `npx -y ghost-qa doctor` |
|
|
86
88
|
| `navigation-failed` on every route | Server isn't on that URL/port — start it, or re-run with `--server-cmd "npm run dev"` |
|
|
87
89
|
| Everything 404s | Wrong port or base path — confirm the URL in a browser/`curl` yourself first |
|
|
88
90
|
| Audit seems to test a login page | The app requires auth for those routes; report that limitation instead of claiming full verification |
|
|
@@ -93,7 +95,7 @@ ghost-qa never clicks destructive controls (delete, checkout, pay, logout, publi
|
|
|
93
95
|
|
|
94
96
|
When the final run passes, report completion like this:
|
|
95
97
|
|
|
96
|
-
> ✅ Done. Verified in a real browser with ghost-qa: `npx
|
|
98
|
+
> ✅ Done. Verified in a real browser with ghost-qa: `npx -y ghost-qa test <url>` → **GHOST-QA PASS**
|
|
97
99
|
> Routes crawled: N · Interactions tested: N · Issues fixed this session: (list `#id`s, or "none found")
|
|
98
100
|
> Stack: desktop 1440×900 + mobile 390×844, 5 traps (console, network, layout, accessibility, performance)
|
|
99
101
|
|
package/dist/bin/ghost-qa.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { type GhostQAOptions } from '../src/types.js';
|
|
3
|
-
export declare const VERSION = "1.3.
|
|
4
|
-
export declare const AGENT_PROTOCOL = "<!-- ghost-qa:start -->\n## \uD83D\uDC7B ghost-qa \u2014 Browser Verification Protocol (MANDATORY)\n\nBefore reporting any task that touches frontend code as complete, you MUST verify it in a real browser:\n\n1. Ensure the app is running locally (e.g. `npm run dev`).\n2. Run: `npx
|
|
3
|
+
export declare const VERSION = "1.3.1";
|
|
4
|
+
export declare const AGENT_PROTOCOL = "<!-- ghost-qa:start -->\n## \uD83D\uDC7B ghost-qa \u2014 Browser Verification Protocol (MANDATORY)\n\nBefore reporting any task that touches frontend code as complete, you MUST verify it in a real browser:\n\n1. Ensure the app is running locally (e.g. `npm run dev`).\n2. Run: `npx -y ghost-qa test <local-url>` (e.g. `npx -y ghost-qa test http://localhost:3000`) \u2014 or call the `ghost_qa_audit_url` MCP tool if your host exposes it. Add `--server-cmd \"npm run dev\"` to let ghost-qa manage the dev server itself.\n3. If ghost-qa reports ANY critical or major issue (hydration errors, console errors, 4xx/5xx responses, mobile overflow, accessibility or performance failures, broken interactions), fix the root cause in source and re-run.\n4. Repeat until ghost-qa prints **PASS**. Only then may you tell the user the task is done.\n\nNever declare a UI task finished based only on code review, type-checking, or unit tests. The browser is the source of truth.\n<!-- ghost-qa:end -->";
|
|
5
5
|
export interface ParsedTestArgs {
|
|
6
6
|
target: string;
|
|
7
7
|
options: GhostQAOptions;
|
|
@@ -20,7 +20,7 @@ export declare function installSkill(targetDir: string, force?: boolean): Promis
|
|
|
20
20
|
/**
|
|
21
21
|
* Writes (or merges into) `.mcp.json`, preserving any MCP servers the
|
|
22
22
|
* project already configured. The ghost-qa entry is always refreshed so
|
|
23
|
-
* hosts invoke the published CLI: `npx -y
|
|
23
|
+
* hosts invoke the published CLI: `npx -y ghost-qa mcp`.
|
|
24
24
|
*/
|
|
25
25
|
export declare function installMcpConfig(mcpJsonPath: string, force?: boolean): Promise<string>;
|
|
26
26
|
export declare function main(argv?: string[]): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ghost-qa.d.ts","sourceRoot":"","sources":["../../bin/ghost-qa.ts"],"names":[],"mappings":";AAWA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEvE,eAAO,MAAM,OAAO,UAAmB,CAAC;AAKxC,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"ghost-qa.d.ts","sourceRoot":"","sources":["../../bin/ghost-qa.ts"],"names":[],"mappings":";AAWA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEvE,eAAO,MAAM,OAAO,UAAmB,CAAC;AAKxC,eAAO,MAAM,cAAc,i+BAWX,CAAC;AA4EjB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,cAAc,CA+E5D;AAyDD,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,KAAK,UAAQ,GACZ,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAqBlD;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,EACnB,KAAK,UAAQ,GACZ,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAuCD,wBAAsB,IAAI,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoDxE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,SAAS,GAAE,MAAwB,GAClC,OAAO,CAOT"}
|