argusqa-os 9.6.6 → 9.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/README.md CHANGED
@@ -1,384 +1,394 @@
1
- <div align="center">
2
-
3
- # Argus — AI-Powered Automated QA
4
-
5
- [![npm](https://img.shields.io/npm/v/argusqa-os?color=7C3AED)](https://www.npmjs.com/package/argusqa-os)
6
- [![MCP Server](https://glama.ai/mcp/servers/ironclawdevs27/Argus/badges/card.svg)](https://glama.ai/mcp/servers/ironclawdevs27/Argus)
7
- [![Harness](https://img.shields.io/badge/harness-641%2F644-4ADE80)](test-harness/)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
9
-
10
- **Argus catches the bugs your test suite misses — visual regressions, API loops, CSS drift, console noise, accessibility failures, and more — and delivers rich reports to Slack (or a local HTML dashboard).**
11
-
12
- [Quick Start](#quick-start) · [Features](#what-argus-catches) · [Setup](#full-setup) · [MCP Tools](#mcp-tools) · [CLI Commands](#cli-commands) · [Troubleshooting](#troubleshooting) · [Full Reference](REFERENCE.md)
13
-
14
- </div>
15
-
16
- ---
17
-
18
- ## Quick Start
19
-
20
- > **No install required.** `npx` auto-downloads Argus on first run.
21
-
22
- **Step 1 — Add to `.mcp.json`** in your project root:
23
-
24
- ```json
25
- {
26
- "mcpServers": {
27
- "chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest"] },
28
- "argus": { "command": "npx", "args": ["-y", "argusqa-os"] }
29
- }
30
- }
31
- ```
32
-
33
- Or via Claude Code CLI:
34
-
35
- ```bash
36
- claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
37
- claude mcp add argus -- npx -y argusqa-os
38
- ```
39
-
40
- **Step 2 — Start Chrome with remote debugging:**
41
-
42
- ```bash
43
- # macOS
44
- open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
45
-
46
- # Windows (PowerShell)
47
- & "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --headless=new --no-sandbox --disable-gpu --user-data-dir="$env:TEMP\chrome-argus"
48
-
49
- # Linux
50
- google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
51
- ```
52
-
53
- **Step 3 — Run an audit:**
54
-
55
- ```
56
- Run argus_audit on http://localhost:3000
57
- ```
58
-
59
- Argus scans your app and either posts findings to Slack or opens a local `report.html`. That's it.
60
-
61
- ---
62
-
63
- ## What Argus Catches
64
-
65
- 31 analysis engines, 138 distinct issue types, zero test-file maintenance:
66
-
67
- | Category | What it detects |
68
- |---|---|
69
- | **JavaScript** | Uncaught exceptions, unhandled promise rejections, `console.error` on critical routes |
70
- | **Network & API** | HTTP 5xx, 401/403 auth failures, duplicate API calls (infinite loops), 4xx errors, broken links |
71
- | **Performance** | LCP > 2500ms, CLS > 0.1, TTFB > 800ms, slow APIs > 1s/3s, payloads > 500KB/2MB, JS bundles > 500KB |
72
- | **Accessibility** | axe-core (80+ WCAG rules), color-blind simulation, missing ARIA, keyboard focus, heading hierarchy |
73
- | **SEO** | Missing meta description, OG tags, canonical, viewport, h1 |
74
- | **Security** | Auth tokens in localStorage/URL, `eval()`, missing CSP/X-Frame-Options, CSP violations |
75
- | **CSS** | Cascade overrides, component style leaks, unused rules, React inline style conflicts |
76
- | **Content** | `null`/`undefined` as visible text, lorem ipsum, broken images, empty data lists |
77
- | **Responsive** | Horizontal overflow at 375px/768px, touch targets < 44×44px |
78
- | **Memory** | Detached DOM nodes via V8 heap snapshot, heap growth across navigation |
79
- | **Visual** | Pixel-level screenshot regression via pixelmatch (≥0.1% warning, ≥5% critical) |
80
- | **Figma** | Design-to-implementation fidelity — 13 property types (color, spacing, typography, shadows, etc.) |
81
- | **Forms** | Missing `required`, `autocomplete`, `aria-describedby`; unlabelled inputs |
82
- | **Fonts** | FOIT, FOUT, missing fallbacks, slow loads > 1s, suboptimal formats |
83
- | **Motion** | `prefers-reduced-motion` violations, `autoplay` without pause controls |
84
- | **Network baseline** | New requests, missing requests, status-code regressions vs saved HAR baseline |
85
- | **Environment diff** | Dev vs staging — screenshot diff, DOM changes, console/network regressions |
86
-
87
- > All findings are classified as `critical` / `warning` / `info` and routed to the right Slack channel — or surfaced in the local HTML report. For per-finding severity tables and detection methods, see [REFERENCE.md](REFERENCE.md).
88
-
89
- ---
90
-
91
- ## MCP Tools
92
-
93
- Ask Claude (or any MCP client) — no terminal required:
94
-
95
- | Tool | Description |
96
- |---|---|
97
- | `argus_audit` | Fast pass — JS, network, accessibility, SEO, security, CSS, content |
98
- | `argus_audit_full` | Deep pass — adds Lighthouse, responsive checks, memory leak detection, hover-state bugs |
99
- | `argus_compare` | Diff dev vs staging — screenshots, findings delta, environment regressions |
100
- | `argus_get_context` | Capture everything broken on the open tab for Claude to diagnose |
101
- | `argus_watch_snapshot` | Snapshot the open tab without navigating (preserves auth/form state) |
102
- | `argus_last_report` | Return last JSON report without re-running |
103
- | `argus_design_audit` | Figma URL → 13 design-token finding types (color, spacing, typography, shadows, etc.) |
104
- | `argus_visual_diff` | Screenshot baseline comparison. Pass `updateBaseline: true` to reset. |
105
- | `argus_pr_validate` | Fetch GitHub PR diff map changed files to affected routes → targeted audit → `{ blocked, findings }` |
106
-
107
- **Example prompts:**
108
-
109
- ```
110
- Run argus_audit on http://localhost:3000/checkout
111
- Run argus_audit_full on http://localhost:3000/dashboard
112
- Run argus_compare
113
- Run argus_get_context
114
- ```
115
-
116
- ---
117
-
118
- ## Full Setup
119
-
120
- ### Prerequisites
121
-
122
- | Requirement | Version |
123
- |---|---|
124
- | Node.js | v20.19+ |
125
- | Chrome | Stable (desktop or headless) |
126
- | Claude Code | Latest (`npm install -g @anthropic-ai/claude-code`) |
127
- | Slack workspace | **Optional** — omit for local `report.html` mode |
128
-
129
- ---
130
-
131
- ### Option A MCP Server *(recommended for Claude Code users)*
132
-
133
- No local install needed. Use the [Quick Start](#quick-start) above, then add your target URL:
134
-
135
- ```env
136
- # .env in your project root
137
- TARGET_DEV_URL=http://localhost:3000
138
- TARGET_STAGING_URL=https://staging.example.com # optionalenables argus_compare
139
- ```
140
-
141
- **Optional — Slack notifications:**
142
-
143
- 1. [api.slack.com/apps](https://api.slack.com/apps) Create New App → name it **BugBot**
144
- 2. OAuth & Permissions → Bot Token Scopes: `chat:write`, `files:write`, `files:read`
145
- 3. Install to workspace → copy the `xoxb-...` token
146
- 4. Create channels `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` and run `/invite @BugBot` in each
147
-
148
- ```env
149
- SLACK_BOT_TOKEN=xoxb-...
150
- SLACK_CHANNEL_CRITICAL=C0000000000
151
- SLACK_CHANNEL_WARNINGS=C0000000001
152
- SLACK_CHANNEL_DIGEST=C0000000002
153
- ```
154
-
155
- > Without Slack: Argus auto-generates `reports/report.html` and opens it in your browser — zero extra config.
156
-
157
- ---
158
-
159
- ### Option B — npm Package (CI / dev dependency)
160
-
161
- ```bash
162
- npm install --save-dev argusqa-os
163
- npx argus init # interactive wizard — detects framework, discovers routes, writes .env
164
- npm run crawl # run after Chrome is started
165
- ```
166
-
167
- ---
168
-
169
- ### Option C — Clone the Repository (contributors / full source)
170
-
171
- ```bash
172
- git clone https://github.com/ironclawdevs27/Argus.git
173
- cd Argus
174
- npm install
175
- npm run init # interactive setup wizard
176
- ```
177
-
178
- **Manual setup (skip the wizard):**
179
-
180
- ```bash
181
- cp .env.example .env
182
- # Fill in TARGET_DEV_URL and optional Slack tokens
183
- ```
184
-
185
- Then configure your routes in [src/config/targets.js](src/config/targets.js):
186
-
187
- ```js
188
- export const routes = [
189
- { path: '/', name: 'Home', critical: true, waitFor: 'main' },
190
- { path: '/login', name: 'Login', critical: true, waitFor: 'form' },
191
- { path: '/dashboard', name: 'Dashboard', critical: true, waitFor: '[data-testid="dashboard"]' },
192
- { path: '/settings', name: 'Settings', critical: false, waitFor: null },
193
- ];
194
- ```
195
-
196
- - `critical: true` errors on this route go to `#bugs-critical`
197
- - `waitFor` CSS selector Argus waits for before capturing (signals page-ready)
198
-
199
- ---
200
-
201
- ## CLI Commands
202
-
203
- ```bash
204
- npm run crawl # Batch audit of all configured routes
205
- npm run compare # Dev vs staging diff (CSS-only if no staging URL)
206
- npm run watch # Passive monitor — polls open Chrome tab every 1s
207
- npm run report:html # Generate reports/report.html from last JSON audit
208
- npm run server # Start Slack slash-command server (port 3001)
209
- npm run init # Interactive setup wizard
210
- npm run test:unit # 61 unit tests — no Chrome required
211
- npm run test:harness # 138-block correctness harness requires Chrome
212
- ```
213
-
214
- **Watch mode** live monitoring as you develop:
215
-
216
- ```bash
217
- # Terminal 1: start your app
218
- npm run dev
219
-
220
- # Terminal 2: start Argus watcher
221
- npm run watch
222
- # Ctrl+C stops monitor and writes reports/report.html
223
- ```
224
-
225
- **Slack slash command** (on-demand from any channel):
226
-
227
- ```
228
- /argus-retest https://staging.example.com/checkout
229
- ```
230
-
231
- To expose the server via tunnel: `cloudflared tunnel --url http://localhost:3001` (free, no account required). Set the resulting URL as the Request URL in Slack App → Slash Commands.
232
-
233
- ---
234
-
235
- ## GitHub Actions CI
236
-
237
- Add to your repo's secrets (Settings → Secrets → Actions):
238
-
239
- | Secret | Required | Value |
240
- |---|---|---|
241
- | `TARGET_STAGING_URL` | Yes | Your staging base URL |
242
- | `SLACK_BOT_TOKEN` | No | `xoxb-...` token (omit for HTML-only mode) |
243
- | `SLACK_CHANNEL_CRITICAL` | No* | Channel ID (needed when Slack is configured) |
244
- | `SLACK_CHANNEL_WARNINGS` | No* | Channel ID |
245
- | `SLACK_CHANNEL_DIGEST` | No* | Channel ID |
246
- | `GITHUB_TOKEN` | No | Auto-injected by Actions for PR comments + Check Runs |
247
-
248
- The included [workflow](.github/workflows/argus.yml) runs on push to `main`, daily at 6 AM UTC, and on manual trigger. If critical issues are found, the pipeline fails.
249
-
250
- ---
251
-
252
- ## Environment Variables
253
-
254
- <details>
255
- <summary>Full reference (click to expand)</summary>
256
-
257
- | Variable | Default | Description |
258
- |---|---|---|
259
- | `TARGET_DEV_URL` | | **Required.** Base URL of your dev environment |
260
- | `TARGET_STAGING_URL` | — | Staging URL — enables `argus_compare`; omit for CSS-only mode |
261
- | `SLACK_BOT_TOKEN` | — | `xoxb-...` token. Omit for local `report.html` mode |
262
- | `SLACK_SIGNING_SECRET` | — | For `/argus-retest` slash command verification |
263
- | `SLACK_CHANNEL_CRITICAL` | — | Channel ID for critical bugs |
264
- | `SLACK_CHANNEL_WARNINGS` | — | Channel ID for warnings |
265
- | `SLACK_CHANNEL_DIGEST` | — | Channel ID for info / daily digest |
266
- | `PORT` | `3001` | Slack slash-command server port |
267
- | `REPORT_OUTPUT_DIR` | `./reports` | Where to write JSON reports |
268
- | `ARGUS_CONCURRENCY` | `1` | Parallel MCP clients for route crawling |
269
- | `ARGUS_LOG_LEVEL` | `info` | `trace` / `debug` / `info` / `warn` / `error` |
270
- | `ARGUS_LOG_PRETTY` | — | Set `1` for human-readable logs in dev |
271
- | `ARGUS_RETRY_ATTEMPTS` | `3` | Max retries for `navigate`/`fill` MCP calls |
272
- | `ARGUS_WATCH_INTERVAL_MS` | `1000` | Watch mode poll interval (ms) |
273
- | `ARGUS_WATCH_UI_PORT` | `3002` | Watch mode web dashboard port |
274
- | `ARGUS_SOURCE_DIR` | — | App source path enables env-var / feature-flag / dead-route analysis |
275
- | `ARGUS_ENV_FILE` | — | Path to app `.env` for codebase cross-reference |
276
- | `SCREENSHOT_DIFF_THRESHOLD` | `0.5` | Pixel diff % threshold for environment comparison |
277
- | `GITHUB_TOKEN` | | For PR comments + Check Runs |
278
- | `GITHUB_REPOSITORY` | | `owner/repo` format |
279
- | `GITHUB_PR_NUMBER` | | Auto-injected by Actions from PR context |
280
- | `ARGUS_CRITICAL_THRESHOLD` | `1` | New criticals before blocking merge (0 = never block) |
281
- | `ARGUS_DIFF_IMAGE_URL` | — | Visual diff image URL to embed in PR comment |
282
- | `OTEL_EXPORTER_OTLP_ENDPOINT` | | OTLP collector for Jaeger / Grafana Tempo |
283
- | `FIGMA_API_TOKEN` | | Required for `argus_design_audit` |
284
- | `FONT_SLOW_MS` | `1000` | Slow web font load threshold (ms) |
285
- | `A11Y_CONTRAST_AA` | `4.5` | WCAG AA min contrast ratio for CVD simulation |
286
-
287
- </details>
288
-
289
- ---
290
-
291
- ## Troubleshooting
292
-
293
- **Chrome DevTools MCP not connecting**
294
- ```bash
295
- claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
296
- # Restart Claude Code after adding
297
- ```
298
-
299
- **Slack messages not posting**
300
- - Token must start with `xoxb-` (not `xoxp-`, `xoxe-`, or `xapp-`)
301
- - Run `/invite @BugBot` in each channel
302
- - Required scopes: `chat:write`, `files:write`, `files:read`
303
-
304
- **Screenshots are blank**
305
- - Page hasn't settled — increase `pageSettleMs` in `src/config/targets.js` or add a `waitFor` selector for the route
306
-
307
- **`/argus-retest` returns "dispatch_failed"**
308
- - Tunnel URL changed — update the Request URL in Slack App → Slash Commands and reinstall
309
-
310
- **CSS analysis returns empty results**
311
- - Page may be behind auth ensure you're logged in on the Chrome instance Argus is controlling
312
-
313
- **CI pipeline fails immediately**
314
- - Chrome may not start fast enough — increase `sleep 3` to `sleep 5` in [.github/workflows/argus.yml](.github/workflows/argus.yml)
315
-
316
- ---
317
-
318
- ## How Argus Differs From Playwright / Cypress
319
-
320
- Argus is a **complementary layer**, not a replacement for unit or E2E tests:
321
-
322
- | | Playwright / Cypress | Argus |
323
- |---|---|---|
324
- | **Purpose** | Test your logic and API contracts | Catch what the user actually sees |
325
- | **What it catches** | Regressions in behavior | CSS drift, visual regressions, API loops, console noise, perf budgets |
326
- | **When it runs** | In your test suite | Continuously, on the live running app |
327
- | **Setup** | Write test files | Configure routes in `targets.js` |
328
- | **Output** | Pass / fail | Structured Slack reports with screenshots |
329
-
330
- ---
331
-
332
- ## Known Limitations
333
-
334
- 3 permanent test failures (`641/644`) are MCP-layer restrictions — not fixable in Argus code:
335
-
336
- | Tool | Constraint |
337
- |---|---|
338
- | `drag` | Uses mouse simulation, not HTML5 DnD `dragstart`/`dragover`/`drop` events never fire |
339
- | `list_console_messages({ types: ['issue'] })` | Issues panel returns empty even when violations exist |
340
-
341
- ---
342
-
343
- ## Project Structure
344
-
345
- ```
346
- src/
347
- argus.js — single-page audit entry point
348
- mcp-server.js — 9 MCP tools exposed to Claude / any MCP client
349
- orchestration/ — crawl loop, Slack/GitHub dispatch, env comparison, watch mode
350
- utils/ — 30+ analysis engines (accessibility, security, performance, etc.)
351
- adapters/browser.js — CdpBrowserAdapter — wraps all chrome-devtools-mcp calls
352
- config/targets.js — routes, thresholds, auth steps
353
- cli/init.js argus init interactive setup wizard
354
- test-harness/ 138-block correctness harness, 62 fixture pages
355
- test/unit/ 61 Vitest unit tests (no Chrome required)
356
- landing/ — Product landing page (React 19 + Vite + Tailwind)
357
- ```
358
-
359
- Full source map → [CLAUDE.md](CLAUDE.md) · MCP/DSL reference → [SKILL.md](SKILL.md)
360
-
361
- ---
362
-
363
- ## Contributing
364
-
365
- 1. Fork the repo and create a branch
366
- 2. `npm run test:unit` verify without Chrome (61 tests)
367
- 3. `npm run test:harness` — full integration coverage (requires Chrome on port 9222)
368
- 4. Open a PR — Argus audits itself via the CI workflow
369
-
370
- ---
371
-
372
- ## License
373
-
374
- MIT © [ironclawdevs27](https://github.com/ironclawdevs27)
375
-
376
- ---
377
-
378
- <div align="center">
379
-
380
- *Argus Panoptes — the all-seeing giant of Greek mythology who never slept.*
381
-
382
- [argus-qa.com](https://argus-qa.com) · [npm](https://www.npmjs.com/package/argusqa-os) · [MCP Registry](https://glama.ai/mcp/servers/ironclawdevs27/Argus)
383
-
384
- </div>
1
+ <div align="center">
2
+
3
+ # Argus — AI-Powered Automated QA
4
+
5
+ [![npm](https://img.shields.io/npm/v/argusqa-os?color=7C3AED)](https://www.npmjs.com/package/argusqa-os)
6
+ [![MCP Server](https://glama.ai/mcp/servers/ironclawdevs27/Argus/badges/card.svg)](https://glama.ai/mcp/servers/ironclawdevs27/Argus)
7
+ [![Harness](https://img.shields.io/badge/harness-688%2F688-4ADE80)](test-harness/)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
9
+
10
+ **Argus catches the bugs your test suite misses — visual regressions, API loops, CSS drift, console noise, accessibility failures, and more — and delivers rich reports to Slack (or a local HTML dashboard).**
11
+
12
+ [Quick Start](#quick-start) · [Features](#what-argus-catches) · [Setup](#full-setup) · [MCP Tools](#mcp-tools) · [CLI Commands](#cli-commands) · [Troubleshooting](#troubleshooting) · [Full Reference](REFERENCE.md)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## Quick Start
19
+
20
+ > **No install required.** `npx` auto-downloads Argus on first run.
21
+
22
+ **Step 1 — Add to `.mcp.json`** in your project root:
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest"] },
28
+ "argus": { "command": "npx", "args": ["-y", "argusqa-os"] }
29
+ }
30
+ }
31
+ ```
32
+
33
+ Or via Claude Code CLI:
34
+
35
+ ```bash
36
+ claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
37
+ claude mcp add argus -- npx -y argusqa-os
38
+ ```
39
+
40
+ **Step 2 — Start Chrome with remote debugging:**
41
+
42
+ ```bash
43
+ # macOS
44
+ open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
45
+
46
+ # Windows (PowerShell)
47
+ & "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --headless=new --no-sandbox --disable-gpu --user-data-dir="$env:TEMP\chrome-argus"
48
+
49
+ # Linux
50
+ google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
51
+ ```
52
+
53
+ **Step 3 — Run an audit:**
54
+
55
+ ```
56
+ Run argus_audit on http://localhost:3000
57
+ ```
58
+
59
+ Argus scans your app and either posts findings to Slack or opens a local `report.html`. That's it.
60
+
61
+ ---
62
+
63
+ ## What Argus Catches
64
+
65
+ 32 analysis engines, 140 distinct issue types, zero test-file maintenance:
66
+
67
+ | Category | What it detects |
68
+ |---|---|
69
+ | **JavaScript** | Uncaught exceptions, unhandled promise rejections, `console.error` on critical routes |
70
+ | **Network & API** | HTTP 5xx, 401/403 auth failures, duplicate API calls (infinite loops), 4xx errors, broken links |
71
+ | **Performance** | LCP > 2500ms, CLS > 0.1, TTFB > 800ms, slow APIs > 1s/3s, payloads > 500KB/2MB, JS bundles > 500KB |
72
+ | **Accessibility** | axe-core (80+ WCAG rules), color-blind simulation, missing ARIA, keyboard focus, heading hierarchy |
73
+ | **SEO** | Missing meta description, OG tags, canonical, viewport, h1 |
74
+ | **Security** | Auth tokens in localStorage/URL, `eval()`, missing CSP/X-Frame-Options, CSP violations, missing SRI on external scripts, source map exposure, open redirects, npm CVEs |
75
+ | **CSS** | Cascade overrides, component style leaks, unused rules, React inline style conflicts |
76
+ | **Content** | `null`/`undefined` as visible text, lorem ipsum, broken images, empty data lists |
77
+ | **Responsive** | Horizontal overflow at 375px/768px, touch targets < 44×44px |
78
+ | **Memory** | Detached DOM nodes via V8 heap snapshot, heap growth across navigation |
79
+ | **Visual** | Pixel-level screenshot regression via pixelmatch (≥0.1% warning, ≥5% critical) |
80
+ | **Figma** | Design-to-implementation fidelity — 13 property types (color, spacing, typography, shadows, etc.) |
81
+ | **Forms** | Missing `required`, `autocomplete`, `aria-describedby`; unlabelled inputs |
82
+ | **Fonts** | FOIT, FOUT, missing fallbacks, slow loads > 1s, suboptimal formats |
83
+ | **Motion** | `prefers-reduced-motion` violations, `autoplay` without pause controls |
84
+ | **Network baseline** | New requests, missing requests, status-code regressions vs saved HAR baseline |
85
+ | **Environment diff** | Dev vs staging — screenshot diff, DOM changes, console/network regressions |
86
+
87
+ And every finding is post-processed with:
88
+
89
+ | Post-processor | What it adds |
90
+ |---|---|
91
+ | **Intelligent baseline filtering** | Findings that flip-flop across runs are tagged `noisy` and downgraded to info — pure cross-run heuristics, no API calls (`ARGUS_NOISE_FILTER=0` to disable) |
92
+ | **Root cause linking** | New findings are annotated with the recent git commits and files most likely to have caused them (`ARGUS_ROOT_CAUSE=0` to disable) |
93
+
94
+ > All findings are classified as `critical` / `warning` / `info` and routed to the right Slack channel — or surfaced in the local HTML report. For per-finding severity tables and detection methods, see [REFERENCE.md](REFERENCE.md).
95
+
96
+ ---
97
+
98
+ ## MCP Tools
99
+
100
+ Ask Claude (or any MCP client) no terminal required:
101
+
102
+ | Tool | Description |
103
+ |---|---|
104
+ | `argus_audit` | Fast pass JS, network, accessibility, SEO, security, CSS, content |
105
+ | `argus_audit_full` | Deep pass adds Lighthouse, responsive checks, memory leak detection, hover-state bugs |
106
+ | `argus_compare` | Diff dev vs staging — screenshots, findings delta, environment regressions |
107
+ | `argus_get_context` | Capture everything broken on the open tab for Claude to diagnose |
108
+ | `argus_watch_snapshot` | Snapshot the open tab without navigating (preserves auth/form state) |
109
+ | `argus_last_report` | Return last JSON report without re-running |
110
+ | `argus_design_audit` | Figma URL → 13 design-token finding types (color, spacing, typography, shadows, etc.) |
111
+ | `argus_visual_diff` | Screenshot baseline comparison. Pass `updateBaseline: true` to reset. |
112
+ | `argus_pr_validate` | Fetch GitHub PR diff → map changed files to affected routes → targeted audit → `{ blocked, findings }` |
113
+
114
+ **Example prompts:**
115
+
116
+ ```
117
+ Run argus_audit on http://localhost:3000/checkout
118
+ Run argus_audit_full on http://localhost:3000/dashboard
119
+ Run argus_compare
120
+ Run argus_get_context
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Full Setup
126
+
127
+ ### Prerequisites
128
+
129
+ | Requirement | Version |
130
+ |---|---|
131
+ | Node.js | v20.19+ |
132
+ | Chrome | Stable (desktop or headless) |
133
+ | Claude Code | Latest (`npm install -g @anthropic-ai/claude-code`) |
134
+ | Slack workspace | **Optional** — omit for local `report.html` mode |
135
+
136
+ ---
137
+
138
+ ### Option A MCP Server *(recommended for Claude Code users)*
139
+
140
+ No local install needed. Use the [Quick Start](#quick-start) above, then add your target URL:
141
+
142
+ ```env
143
+ # .env in your project root
144
+ TARGET_DEV_URL=http://localhost:3000
145
+ TARGET_STAGING_URL=https://staging.example.com # optional enables argus_compare
146
+ ```
147
+
148
+ **Optional — Slack notifications:**
149
+
150
+ 1. [api.slack.com/apps](https://api.slack.com/apps) → Create New App → name it **BugBot**
151
+ 2. OAuth & Permissions → Bot Token Scopes: `chat:write`, `files:write`, `files:read`
152
+ 3. Install to workspace → copy the `xoxb-...` token
153
+ 4. Create channels `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` and run `/invite @BugBot` in each
154
+
155
+ ```env
156
+ SLACK_BOT_TOKEN=xoxb-...
157
+ SLACK_CHANNEL_CRITICAL=C0000000000
158
+ SLACK_CHANNEL_WARNINGS=C0000000001
159
+ SLACK_CHANNEL_DIGEST=C0000000002
160
+ ```
161
+
162
+ > Without Slack: Argus auto-generates `reports/report.html` and opens it in your browser — zero extra config.
163
+
164
+ ---
165
+
166
+ ### Option B — npm Package (CI / dev dependency)
167
+
168
+ ```bash
169
+ npm install --save-dev argusqa-os
170
+ npx argus init # interactive wizard — detects framework, discovers routes, writes .env
171
+ npm run crawl # run after Chrome is started
172
+ ```
173
+
174
+ ---
175
+
176
+ ### Option C — Clone the Repository (contributors / full source)
177
+
178
+ ```bash
179
+ git clone https://github.com/ironclawdevs27/Argus.git
180
+ cd Argus
181
+ npm install
182
+ npm run init # interactive setup wizard
183
+ ```
184
+
185
+ **Manual setup (skip the wizard):**
186
+
187
+ ```bash
188
+ cp .env.example .env
189
+ # Fill in TARGET_DEV_URL and optional Slack tokens
190
+ ```
191
+
192
+ Then configure your routes in [src/config/targets.js](src/config/targets.js):
193
+
194
+ ```js
195
+ export const routes = [
196
+ { path: '/', name: 'Home', critical: true, waitFor: 'main' },
197
+ { path: '/login', name: 'Login', critical: true, waitFor: 'form' },
198
+ { path: '/dashboard', name: 'Dashboard', critical: true, waitFor: '[data-testid="dashboard"]' },
199
+ { path: '/settings', name: 'Settings', critical: false, waitFor: null },
200
+ ];
201
+ ```
202
+
203
+ - `critical: true` — errors on this route go to `#bugs-critical`
204
+ - `waitFor` CSS selector Argus waits for before capturing (signals page-ready)
205
+
206
+ ---
207
+
208
+ ## CLI Commands
209
+
210
+ ```bash
211
+ npm run chrome # Launch Chrome with --remote-debugging-port=9222 (auto-detects binary)
212
+ npm run doctor # Pre-flight check: Chrome reachable, .mcp.json valid, .env has TARGET_DEV_URL
213
+ npm run crawl # Batch audit of all configured routes
214
+ npm run compare # Dev vs staging diff (CSS-only if no staging URL)
215
+ npm run watch # Passive monitor — polls open Chrome tab every 1s
216
+ npm run report:html # Generate reports/report.html from last JSON audit
217
+ npm run report:pdf # Export HTML report to A4 PDF (requires: npm install puppeteer)
218
+ npm run server # Start Slack slash-command server (port 3001)
219
+ npm run init # Interactive setup wizard
220
+ npm run test:unit # 61 unit tests — no Chrome required
221
+ npm run test:harness # 142-block correctness harness — requires Chrome
222
+ npm run test:harness:log # same, but tees full output to harness-results.txt
223
+ ```
224
+
225
+ **Watch mode** live monitoring as you develop:
226
+
227
+ ```bash
228
+ # Terminal 1: start your app
229
+ npm run dev
230
+
231
+ # Terminal 2: start Argus watcher
232
+ npm run watch
233
+ # Ctrl+C → stops monitor and writes reports/report.html
234
+ ```
235
+
236
+ **Slack slash command** (on-demand from any channel):
237
+
238
+ ```
239
+ /argus-retest https://staging.example.com/checkout
240
+ ```
241
+
242
+ To expose the server via tunnel: `cloudflared tunnel --url http://localhost:3001` (free, no account required). Set the resulting URL as the Request URL in Slack App → Slash Commands.
243
+
244
+ ---
245
+
246
+ ## GitHub Actions CI
247
+
248
+ Add to your repo's secrets (Settings Secrets Actions):
249
+
250
+ | Secret | Required | Value |
251
+ |---|---|---|
252
+ | `TARGET_STAGING_URL` | Yes | Your staging base URL |
253
+ | `SLACK_BOT_TOKEN` | No | `xoxb-...` token (omit for HTML-only mode) |
254
+ | `SLACK_CHANNEL_CRITICAL` | No* | Channel ID (needed when Slack is configured) |
255
+ | `SLACK_CHANNEL_WARNINGS` | No* | Channel ID |
256
+ | `SLACK_CHANNEL_DIGEST` | No* | Channel ID |
257
+ | `GITHUB_TOKEN` | No | Auto-injected by Actions for PR comments + Check Runs |
258
+
259
+ The included [workflow](.github/workflows/argus.yml) runs on push to `main`, daily at 6 AM UTC, and on manual trigger. If critical issues are found, the pipeline fails.
260
+
261
+ ---
262
+
263
+ ## Environment Variables
264
+
265
+ <details>
266
+ <summary>Full reference (click to expand)</summary>
267
+
268
+ | Variable | Default | Description |
269
+ |---|---|---|
270
+ | `TARGET_DEV_URL` | — | **Required.** Base URL of your dev environment |
271
+ | `TARGET_STAGING_URL` | | Staging URL enables `argus_compare`; omit for CSS-only mode |
272
+ | `SLACK_BOT_TOKEN` | | `xoxb-...` token. Omit for local `report.html` mode |
273
+ | `SLACK_SIGNING_SECRET` | | For `/argus-retest` slash command verification |
274
+ | `SLACK_CHANNEL_CRITICAL` | — | Channel ID for critical bugs |
275
+ | `SLACK_CHANNEL_WARNINGS` | — | Channel ID for warnings |
276
+ | `SLACK_CHANNEL_DIGEST` | | Channel ID for info / daily digest |
277
+ | `PORT` | `3001` | Slack slash-command server port |
278
+ | `REPORT_OUTPUT_DIR` | `./reports` | Where to write JSON reports |
279
+ | `ARGUS_CONCURRENCY` | `1` | Parallel MCP clients for route crawling |
280
+ | `ARGUS_LOG_LEVEL` | `info` | `trace` / `debug` / `info` / `warn` / `error` |
281
+ | `ARGUS_LOG_PRETTY` | — | Set `1` for human-readable logs in dev |
282
+ | `ARGUS_RETRY_ATTEMPTS` | `3` | Max retries for `navigate`/`fill` MCP calls |
283
+ | `ARGUS_WATCH_INTERVAL_MS` | `1000` | Watch mode poll interval (ms) |
284
+ | `ARGUS_WATCH_UI_PORT` | `3002` | Watch mode web dashboard port |
285
+ | `ARGUS_SOURCE_DIR` | | App source path enables env-var / feature-flag / dead-route analysis |
286
+ | `ARGUS_ENV_FILE` | — | Path to app `.env` for codebase cross-reference |
287
+ | `SCREENSHOT_DIFF_THRESHOLD` | `0.5` | Pixel diff % threshold for environment comparison |
288
+ | `GITHUB_TOKEN` | — | For PR comments + Check Runs |
289
+ | `GITHUB_REPOSITORY` | — | `owner/repo` format |
290
+ | `GITHUB_PR_NUMBER` | — | Auto-injected by Actions from PR context |
291
+ | `ARGUS_CRITICAL_THRESHOLD` | `1` | New criticals before blocking merge (0 = never block) |
292
+ | `ARGUS_DIFF_IMAGE_URL` | — | Visual diff image URL to embed in PR comment |
293
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | | OTLP collector for Jaeger / Grafana Tempo |
294
+ | `FIGMA_API_TOKEN` | — | Required for `argus_design_audit` |
295
+ | `FONT_SLOW_MS` | `1000` | Slow web font load threshold (ms) |
296
+ | `A11Y_CONTRAST_AA` | `4.5` | WCAG AA min contrast ratio for CVD simulation |
297
+
298
+ </details>
299
+
300
+ ---
301
+
302
+ ## Troubleshooting
303
+
304
+ **Chrome DevTools MCP not connecting**
305
+ ```bash
306
+ claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
307
+ # Restart Claude Code after adding
308
+ ```
309
+
310
+ **Slack messages not posting**
311
+ - Token must start with `xoxb-` (not `xoxp-`, `xoxe-`, or `xapp-`)
312
+ - Run `/invite @BugBot` in each channel
313
+ - Required scopes: `chat:write`, `files:write`, `files:read`
314
+
315
+ **Screenshots are blank**
316
+ - Page hasn't settled — increase `pageSettleMs` in `src/config/targets.js` or add a `waitFor` selector for the route
317
+
318
+ **`/argus-retest` returns "dispatch_failed"**
319
+ - Tunnel URL changed — update the Request URL in Slack App → Slash Commands and reinstall
320
+
321
+ **CSS analysis returns empty results**
322
+ - Page may be behind auth — ensure you're logged in on the Chrome instance Argus is controlling
323
+
324
+ **CI pipeline fails immediately**
325
+ - Chrome may not start fast enough increase `sleep 3` to `sleep 5` in [.github/workflows/argus.yml](.github/workflows/argus.yml)
326
+
327
+ ---
328
+
329
+ ## How Argus Differs From Playwright / Cypress
330
+
331
+ Argus is a **complementary layer**, not a replacement for unit or E2E tests:
332
+
333
+ | | Playwright / Cypress | Argus |
334
+ |---|---|---|
335
+ | **Purpose** | Test your logic and API contracts | Catch what the user actually sees |
336
+ | **What it catches** | Regressions in behavior | CSS drift, visual regressions, API loops, console noise, perf budgets |
337
+ | **When it runs** | In your test suite | Continuously, on the live running app |
338
+ | **Setup** | Write test files | Configure routes in `targets.js` |
339
+ | **Output** | Pass / fail | Structured Slack reports with screenshots |
340
+
341
+ ---
342
+
343
+ ## Known Limitations
344
+
345
+ All 688 harness assertions pass (`688/688`) — there are currently no known MCP- or Chrome-layer restrictions. Soft assertions (Lighthouse, performance traces) still require non-headless Chrome and are skipped in headless CI.
346
+
347
+ ---
348
+
349
+ ## Project Structure
350
+
351
+ ```
352
+ src/
353
+ argus.js single-page audit entry point
354
+ mcp-server.js 9 MCP tools exposed to Claude / any MCP client
355
+ orchestration/ crawl loop, Slack/GitHub dispatch, env comparison, watch mode
356
+ utils/ — 32 analysis engines (accessibility, security, performance, PDF, recording, etc.)
357
+ adapters/browser.js — CdpBrowserAdapter — wraps all chrome-devtools-mcp calls
358
+ config/targets.js — routes, thresholds, auth steps
359
+ cli/
360
+ init.js — argus init interactive setup wizard
361
+ chrome-launcher.js — npm run chrome / argus-chrome — launches Chrome with correct flags
362
+ doctor.js — npm run doctor / argus-doctor — pre-flight checks
363
+ pr-validate.js — headless CI entry point for GitHub Actions
364
+ test-harness/ — 142-block correctness harness, 688 hard assertions, 62 fixture pages
365
+ test/unit/ — 61 Vitest unit tests (no Chrome required)
366
+ landing/ — Product landing page (React 19 + Vite + Tailwind)
367
+ ```
368
+
369
+ Full source map → [CLAUDE.md](CLAUDE.md) · MCP/DSL reference → [SKILL.md](SKILL.md)
370
+
371
+ ---
372
+
373
+ ## Contributing
374
+
375
+ 1. Fork the repo and create a branch
376
+ 2. `npm run test:unit` — verify without Chrome (61 tests)
377
+ 3. `npm run test:harness` — full integration coverage (requires Chrome on port 9222)
378
+ 4. Open a PR — Argus audits itself via the CI workflow
379
+
380
+ ---
381
+
382
+ ## License
383
+
384
+ MIT © [ironclawdevs27](https://github.com/ironclawdevs27)
385
+
386
+ ---
387
+
388
+ <div align="center">
389
+
390
+ *Argus Panoptes — the all-seeing giant of Greek mythology who never slept.*
391
+
392
+ [argus-qa.com](https://argus-qa.com) · [npm](https://www.npmjs.com/package/argusqa-os) · [MCP Registry](https://glama.ai/mcp/servers/ironclawdevs27/Argus)
393
+
394
+ </div>