argusqa-os 9.5.1 → 9.5.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.
package/README.md CHANGED
@@ -1,1089 +1,1100 @@
1
- # Argus — AI-Powered Dev Testing Tool
2
-
3
- [![Argus MCP server](https://glama.ai/mcp/servers/ironclawdevs27/Argus/badges/card.svg)](https://glama.ai/mcp/servers/ironclawdevs27/Argus)
4
-
5
- > *Argus Panoptes — the all-seeing giant of Greek mythology with a hundred eyes who never slept.*
6
-
7
- Automated browser testing pipeline that catches bugs, compares environments, and sends rich reports to Slack (or generates a self-contained HTML dashboard when Slack is not configured) — powered by Chrome DevTools MCP and Claude Code.
8
-
9
- ---
10
-
11
- ## MCP Quick Start
12
-
13
- Add both servers to your `.mcp.json`:
14
-
15
- ```json
16
- {
17
- "mcpServers": {
18
- "chrome-devtools": {
19
- "command": "npx",
20
- "args": ["-y", "chrome-devtools-mcp@latest"]
21
- },
22
- "argus": {
23
- "command": "npx",
24
- "args": ["-y", "argusqa-os"]
25
- }
26
- }
27
- }
28
- ```
29
-
30
- Or register via the Claude Code CLI:
31
-
32
- ```bash
33
- claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
34
- claude mcp add argus -- npx -y argusqa-os
35
- ```
36
-
37
- Set your target URL and start Chrome with remote debugging:
38
-
39
- ```bash
40
- # .env
41
- TARGET_DEV_URL=http://localhost:3000
42
-
43
- # Start Chrome (required — Argus drives this instance via CDP)
44
- # macOS: open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
45
- # Windows: "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --headless=new
46
- # Linux: google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
47
- ```
48
-
49
- Then ask Claude (or any MCP client):
50
-
51
- ```
52
- Run argus_audit on http://localhost:3000
53
- ```
54
-
55
- **Six tools are exposed:**
56
-
57
- | Tool | What it does |
58
- | --- | --- |
59
- | `argus_audit` | Fast QA pass — JS errors, network failures, accessibility, SEO, security, CSS, content |
60
- | `argus_audit_full` | Deep QA pass — adds Lighthouse scoring, responsive layout checks across 4 viewports, memory leak detection, hover-state bug detection, and accessibility tree snapshot |
61
- | `argus_compare` | Diff dev vs staging side-by-side — screenshots, findings delta, environment regressions |
62
- | `argus_last_report` | Return the last saved JSON report without re-running a scan |
63
- | `argus_watch_snapshot` | Snapshot the currently open Chrome tab without navigating — raw console + network capture |
64
- | `argus_get_context` | Capture everything broken on the open tab, formatted as a diagnostic context for Claude to diagnose and suggest fixes |
65
-
66
- > **Requires**: Node.js ≥ 20.19, Chrome (desktop or headless), and the `chrome-devtools-mcp` server registered alongside Argus (shown above).
67
-
68
- ---
69
-
70
- The `landing/` directory contains the product landing page (React + Vite + Tailwind + Framer Motion) with Supabase-backed waitlist and enterprise contact forms. Live at **[argus-qa.com](https://argus-qa.com)** (deployed via Cloudflare Pages; background video served from Cloudflare R2). See [landing/README.md](landing/README.md) for setup.
71
-
72
- <div align="center">
73
-
74
- [![Tech stack icons](https://skillicons.dev/icons?i=nodejs,js,expressjs,react,css,sass,github,githubactions,vscode)](https://skillicons.dev)
75
-
76
- </div>
77
-
78
- <div align="center">
79
-
80
- | 🔴 Critical / 🟡 Warning / 🔵 Info | ⚙️ | 🧪 | 📋 |
81
- | :---: | :---: | :---: | :---: |
82
- | **114 distinct issue types detected** | **24 analysis engines** | **528 test assertions** | **126 test blocks** |
83
-
84
- </div>
85
-
86
- ---
87
-
88
- ## What Argus Catches
89
-
90
- Argus runs **24 analysis engines** per run and detects **114 distinct issue types** across JavaScript runtime, network, CSS, performance, accessibility, SEO, security, content quality, responsive layout, memory, runtime anti-patterns, hover-state interactions, accessibility tree snapshots, keyboard focus, and Chrome DevTools issues panel — plus flakiness detection, historical baselines, user flow assertions, and environment comparison as cross-cutting layers. Every finding is classified by severity (`critical` / `warning` / `info`) and routed to the right Slack channel — or rendered as a local `report.html` when Slack is not configured.
91
-
92
- ### JavaScript Runtime
93
-
94
- | Severity | Bug / Issue | Detection Method |
95
- | --- | --- | --- |
96
- | 🔴 Critical | Uncaught exceptions — `TypeError`, `ReferenceError`, etc. | `window.onerror` listener injected before page load |
97
- | 🔴 Critical | Unhandled Promise rejections | `unhandledrejection` event listener injected into the page |
98
- | 🟡 Warning | `console.error` calls (on non-critical routes) | Chrome DevTools `list_console_messages` |
99
- | 🔴 Critical | `console.error` calls (on critical routes) | Chrome DevTools `list_console_messages` |
100
- | 🔵 Info | `console.warn` deprecation notices and warnings | Chrome DevTools `list_console_messages` |
101
-
102
- ### Network & API
103
-
104
- | Severity | Bug / Issue | Detection Method |
105
- | --- | --- | --- |
106
- | 🔴 Critical | HTTP 5xx server errors on any request | `list_network_requests` → status ≥ 500 |
107
- | 🔴 Critical | 401 / 403 auth failures on a **critical route** — user is being kicked out | `list_network_requests` → status 401 or 403 + `routeIsCritical` flag |
108
- | 🟡 Warning | 401 / 403 auth failures on a non-critical route | `list_network_requests` → status 401 or 403 (non-critical path) |
109
- | 🔴 Critical | API endpoint called 5+ times in one page load — likely an infinite loop | Network frequency grouping by normalized URL + method |
110
- | 🟡 Warning | HTTP 4xx client errors (404, 422, 429, etc.) | `list_network_requests` status 400–499 (non-auth) |
111
- | 🟡 Warning | API endpoint called 3–4 times likely a double-fetch bug | Frequency grouping 3 count ≤ 4 (check `useEffect` deps) |
112
- | 🔵 Info | API endpoint called twicemay be intentional prefetch | Frequency grouping → count = 2 |
113
- | 🔵 Info | API call summary per page load (total calls, unique endpoints, duplicates) | Aggregated network analysis |
114
- | 🟡 Warning | Redirect chain longer than 2 hops extra round-trips inflate load time | Navigation Timing `redirectCount` read after page settle |
115
- | 🟡 Warning | Broken internal link `<a href>` target returns HTTP 404 | `<a>` elements harvested via `evaluate_script`, each verified against `list_network_requests` |
116
-
117
- ### Page Health
118
-
119
- | Severity | Bug / Issue | Detection Method |
120
- | --- | --- | --- |
121
- | 🔴 Critical | Blank or near-empty page — less than 50 characters of body text | `document.body.innerText` length check after navigation |
122
- | 🟡 Warning | Expected element never appearedpage may have crashed mid-load | `waitFor` selector timeout after 10 seconds |
123
-
124
- ### CSS & Styling
125
-
126
- | Severity | Bug / Issue | Detection Method |
127
- | --- | --- | --- |
128
- | 🟡 Warning | `!important` cascade conflict — forced override fighting another rule | CSS rule walk: property declared with `!important` on same element |
129
- | 🟡 Warning | Component style leakBEM selector found in the wrong stylesheet | `.block__element` selector in a file whose name doesn't match `block` |
130
- | 🟡 Warning | React inline style overriding a stylesheet declaration on the same element | `style=""` attribute vs. matching CSS rule, `__reactFiber` presence confirmed |
131
- | 🔵 Info | CSS property declared by multiple rules on the same element (cascade override) | Computed style walk across all matched rules per key element |
132
- | 🔵 Info | Unused CSS rules selectors matching no element on the page (> 10 flagged) | `querySelectorAll(selector).length === 0` for every rule |
133
- | 🔵 Info | CSS Modules detected hashed class names found on DOM elements | Pattern `_ComponentName_class_hash` matched on live DOM |
134
- | 🔵 Info | SCSS source map found compiled CSS traced back to `.scss` origin file | `sourceMappingURL` comment in `<style>` tags |
135
-
136
- ### Performance
137
-
138
- | Severity | Bug / Issue | Detection Method |
139
- | --- | --- | --- |
140
- | 🟡 Warning | LCP > 2500ms — largest element took too long to paint | Chrome performance trace → `performance_analyze_insight` |
141
- | 🟡 Warning | CLS > 0.1layout shifted significantly after initial render | Chrome performance trace |
142
- | 🟡 Warning | FID / TBT > 100msmain thread was blocked during interaction | Chrome performance trace |
143
- | 🟡 Warning | TTFB > 800msserver took too long to send the first byte | Chrome performance trace |
144
-
145
- ### Accessibility
146
-
147
- | Severity | Bug / Issue | Detection Method |
148
- | --- | --- | --- |
149
- | 🔴 Critical | Lighthouse accessibility score below 50 / 100 | Lighthouse audit via `lighthouse_audit` |
150
- | 🟡 Warning | Lighthouse accessibility score 50–89 / 100 | Lighthouse audit |
151
- | 🟡 Warning | Missing alt text on images | Individual Lighthouse audit check |
152
- | 🟡 Warning | Insufficient color contrast ratio | Individual Lighthouse audit check |
153
- | 🟡 Warning | Missing ARIA labels on interactive elements | Individual Lighthouse audit check |
154
- | 🟡 Warning | Keyboard navigation broken or unreachable elements | Individual Lighthouse audit check |
155
-
156
- ### SEO
157
-
158
- | Severity | Bug / Issue | Detection Method |
159
- | --- | --- | --- |
160
- | 🟡 Warning | Missing `<meta name="description">` | DOM inspection via `evaluate_script` |
161
- | 🟡 Warning | Missing Open Graph tags (`og:title`, `og:description`, `og:image`) | DOM inspection via `evaluate_script` |
162
- | 🟡 Warning | `og:image` URL is relative — Open Graph requires an absolute URL | DOM inspection + URL prefix check (`http://` / `https://`) |
163
- | 🟡 Warning | Multiple `<h1>` tags on one page | DOM inspection `querySelectorAll('h1').length > 1` |
164
- | 🟡 Warning | Zero `<h1>` tags page has no primary heading | DOM inspection — `querySelectorAll('h1').length === 0` |
165
- | 🟡 Warning | Generic page title (less than 10 characters, or default placeholder) | DOM inspection + length check |
166
- | 🟡 Warning | Missing `<link rel="canonical">` | DOM inspection via `evaluate_script` |
167
- | 🟡 Warning | Missing `<meta name="viewport">` | DOM inspection via `evaluate_script` |
168
-
169
- ### Security
170
-
171
- | Severity | Bug / Issue | Detection Method |
172
- | --- | --- | --- |
173
- | 🔴 Critical | Auth token found in `localStorage` or `sessionStorage` | `evaluate_script` walks storage keys for token patterns |
174
- | 🔴 Critical | Sensitive token in the page URL (query param or hash) | URL pattern match against current `window.location.href` |
175
- | 🔴 Critical | `eval()` call detected in page scripts | `evaluate_script` AST-style text scan of inline `<script>` tags |
176
- | 🔴 Critical | CSP violation inline script or external resource blocked by Content-Security-Policy | Chrome DevTools Issues panel (`list_console_messages({ types: ['issue'] })`) |
177
- | 🟡 Warning | Sensitive data (`password`, `token`, `secret`) logged to the console | `list_console_messages` + keyword match |
178
- | 🟡 Warning | Missing `Content-Security-Policy` response header | `fetch(location.href)` inside the page response headers check |
179
- | 🟡 Warning | Missing `X-Frame-Options` response header | Same headers fetch |
180
- | 🟡 Warning | Cross-origin `<iframe>` without `sandbox` attribute enables form submission, parent navigation, cookie access | `evaluate_script` checks `iframe[src]` elements for missing sandbox attribute |
181
- | 🟡 Warning | Page served over plain HTTP with no HTTPS upgrade redirect | URL protocol check (`http://` + non-localhost) |
182
- | 🔵 Info | Cookie present without `HttpOnly` flag (limited detection JS-visible cookies only) | `document.cookie` inspection |
183
- | 🔵 Info | Deprecated browser API usage (e.g. `document.domain`, `DOMSubtreeModified`) | Chrome DevTools Issues panel |
184
-
185
- ### Content Quality
186
-
187
- | Severity | Bug / Issue | Detection Method |
188
- | --- | --- | --- |
189
- | 🟡 Warning | `null` or `undefined` rendered as visible text | DOM text scan for literal "null" / "undefined" strings |
190
- | 🟡 Warning | Lorem ipsum / placeholder copy still in production | DOM text scan for "lorem ipsum" and common placeholder strings |
191
- | 🟡 Warning | Broken image (404 or failed to load) | `evaluate_script` checks `img.naturalWidth === 0` on all images |
192
- | 🔵 Info | Empty data list `<ul>`, `<ol>`, or `<select>` with no children | DOM structure check |
193
-
194
- ### Responsive / Mobile
195
-
196
- | Severity | Bug / Issue | Detection Method |
197
- | --- | --- | --- |
198
- | 🔴 Critical | Horizontal overflow at mobile / tablet viewport (≤ 768px) | `emulate` at 375px and 768px → `document.documentElement.scrollWidth > clientWidth` |
199
- | 🟡 Warning | Touch target smaller than 44×44 px at mobile or tablet viewport | CSS computed size check on interactive elements at 375px and 768px |
200
- | 🔵 Info | Responsive screenshot grid snapshots at 375 / 768 / 1024 / 1440px | `emulate` at 4 breakpoints, screenshots dispatched to Slack |
201
-
202
- ### Network Performance
203
-
204
- | Severity | Bug / Issue | Detection Method |
205
- | --- | --- | --- |
206
- | 🔴 Critical | API response time > 3000ms | `PerformanceObserver` entries for `fetch` / XHR calls |
207
- | 🟡 Warning | API response time > 1000ms | Same observer, lower threshold |
208
- | 🔴 Critical | API response payload > 2 MB | `list_network_requests` response body size |
209
- | 🟡 Warning | API response payload > 500 KB | Same, lower threshold |
210
- | 🟡 Warning | Cross-origin (third-party) script TTFB > 2000ms blocking render or late interactivity | HAR `timing.wait` field from `list_network_requests` HAR data; cross-origin requests only |
211
-
212
- ### Network Request Origin Tagging
213
-
214
- All network findings carry an `origin` field (`'first-party'` / `'third-party'`) so operators can triage critical first-party failures separately from third-party noise.
215
-
216
- ### Lighthouse Audits
217
-
218
- | Severity | Bug / Issue | Detection Method |
219
- | --- | --- | --- |
220
- | 🔴 Critical | Lighthouse accessibility score < 50 / 100 | `lighthouse_audit` (accessibility category) |
221
- | 🟡 Warning | Lighthouse accessibility score 50–89 / 100 | `lighthouse_audit` |
222
- | 🟡 Warning | Lighthouse performance score < 90 / 100 | `lighthouse_audit` (performance category) |
223
- | 🟡 Warning | Lighthouse SEO score < 90 / 100 | `lighthouse_audit` (seo category) |
224
- | 🟡 Warning | Lighthouse best-practices score < 90 / 100 | `lighthouse_audit` (best-practices category) |
225
- | 🟡 Warning | Individual failing Lighthouse audit items | Surfaced per-audit from the full Lighthouse report |
226
-
227
- ### Memory Leaks
228
-
229
- | Severity | Bug / Issue | Detection Method |
230
- | --- | --- | --- |
231
- | 🔴 Critical | > 100 detached DOM nodes in V8 heap — severe leak | `take_heapsnapshot` → parse flat nodes array for "Detached Xxx" names |
232
- | 🟡 Warning | > 10 detached DOM nodes in V8 heap — probable leak | Same snapshot parse, lower threshold |
233
- | 🟡 Warning | Heap grew > 2 MB after navigate-away + navigate-back — probable per-load leak | `performance.memory.usedJSHeapSize` delta across round-trip (soft — GC-dependent) |
234
-
235
- ### Runtime Anti-Patterns
236
-
237
- | Severity | Bug / Issue | Detection Method |
238
- | --- | --- | --- |
239
- | 🟡 Warning | Synchronous `XMLHttpRequest` — blocks the main thread until the server responds | `XMLHttpRequest.open` patched via `addScriptToEvaluateOnNewDocument`; `async === false` calls recorded |
240
- | 🟡 Warning | `document.write` / `document.writeln` called can erase the page or block parsing | `document.write` and `document.writeln` patched before page load; calls recorded with method + content |
241
- | 🟡 Warning | Long task > 50ms on the main thread blocks user interaction | `PerformanceObserver` with `entryTypes: ['longtask']` injected before page load |
242
- | 🔴 Critical | CORS policy violation cross-origin fetch blocked by the browser | `list_console_messages` + pattern match for `"has been blocked by CORS policy"` |
243
- | 🟡 Warning | Service worker registration failure SW script returns 4xx or is invalid | `navigator.serviceWorker.register` patched before page load; `.catch()` records failing script URL |
244
- | 🔵 Info | Same-origin static asset (`.js`, `.css`, `.png`, `.woff2`, etc.) served without `Cache-Control` or `ETag` browsers cannot cache it efficiently | `evaluate_script` reads `performance.getEntriesByType('resource')`, HEAD-fetches each unique same-origin asset, checks response headers |
245
-
246
- ### Historical Baselines & Trends
247
-
248
- | Severity | Bug / Issue | Detection Method |
249
- | --- | --- | --- |
250
- | 🔴 Critical | New critical finding not present in the saved baseline — regression introduced since last run | `applyBaseline` compares finding keys (`type::message[:100]::status`) against `reports/baselines/<branch>.json` (D7.2 per-branch) |
251
- | 🟡 Warning | New warning finding not present in the baseline | Same key comparison, warning severity |
252
- | 🔵 Info | Pre-existing finding still present no change since last run | Suppressed from real-time alerts; included in info digest only |
253
- | 🔵 Info | Run trend summarynew vs resolved counts, saved per run | Appended to `reports/baselines/<branch>-trends.json`; surfaced as a trend line in Slack digest |
254
-
255
- ### Hover-State Bugs
256
-
257
- | Severity | Bug / Issue | Detection Method |
258
- | --- | --- | --- |
259
- | 🟡 Warning / 🔴 Critical | `[aria-haspopup]` element whose controlled popup does not become visible after hover — `aria-expanded` stays false and popup remains `display:none` / `visibility:hidden` / `opacity:0` | `hover` dispatches `mousemove`; `evaluate_script` checks `aria-expanded` + `getComputedStyle` on the controlled element; critical on routes marked `critical: true` |
260
- | 🟡 Warning | `[data-tooltip]` element whose `[role="tooltip"]` is not visible in the DOM after hover — not found or opacity 0.05 | Same hover + `evaluate_script` checks tooltip opacity, `display`, `visibility`, and `offsetHeight` |
261
-
262
- ### Accessibility Snapshot Analysis
263
-
264
- | Severity | Bug / Issue | Detection Method |
265
- | --- | --- | --- |
266
- | 🟡 Warning | Interactive element (`<button>`, `<a>`, `[role="button"]`, `[role="link"]`) with no accessible name — no text content, `aria-label`, `aria-labelledby`, `title`, or `alt` | `take_snapshot` captures DOM/AX state; `evaluate_script` queries each visible interactive element for accessible name sources |
267
- | 🟡 Warning | Form control (`<input>`, `<select>`, `<textarea>`) with no associated label — no `<label for="...">`, `aria-label`, or `aria-labelledby` (placeholder is intentionally excluded not a valid accessible name per WCAG 2.1 §3.3.2) | `evaluate_script` checks `label[for]`, ancestor `<label>`, `aria-label`, and `aria-labelledby` for each visible control |
268
- | 🟡 Warning | Landmark role appearing more than once without distinct `aria-label` / `aria-labelledby` — screen readers cannot differentiate them | `evaluate_script` counts `[role=X]` instances and checks for unique label values across: `main`, `banner`, `contentinfo`, `navigation`, `search`, `complementary`, `form`, `region` |
269
- | 🟡 Warning | Heading level skip h1→h3 or h4→h6 jumps more than one level, breaking WCAG 1.3.1 document outline | DOM walk of `h1`–`h6` elements; detects gaps > 1 between consecutive heading levels |
270
- | 🟡 Warning | `aria-expanded` button/control has no `aria-controls` attribute or references a non-existent element | `evaluate_script` checks `[aria-expanded]` elements for missing or broken `aria-controls` pointer |
271
-
272
- ### Keyboard Accessibility
273
-
274
- | Severity | Bug / Issue | Detection Method |
275
- | --- | --- | --- |
276
- | 🟡 Warning | Button or focusable element has `outline:0` with no `box-shadow` fallback — no visible focus ring | `press_key({ key: 'Tab' })` walk + `evaluate_script` reads `document.activeElement` computed style for outline/box-shadow |
277
-
278
- ### Flakiness Detection
279
-
280
- | Severity | Bug / Issue | Detection Method |
281
- | --- | --- | --- |
282
- | original | Confirmed finding — present in both crawl runs | `mergeRunResults` finds the key in both run1 and run2 (`type::message[:100]::status` scheme); original severity kept |
283
- | 🔵 Info | Flaky finding — appeared in only one of two crawl runs | Present in run1 or run2 but not both; downgraded to `severity: 'info'`, labelled `:zap: _flaky_` in Slack digest |
284
-
285
- ### User Flow Assertions
286
-
287
- | Severity | Bug / Issue | Detection Method |
288
- | --- | --- | --- |
289
- | 🔴 Critical | Flow step failed — navigate/fill/click/waitFor threw mid-flow (page state unknown) | `flow-runner.js` wraps every step; any throw emits `flow_step_failed` and halts the flow |
290
- | 🔴 Critical | `element_visible` assertexpected selector absent within timeout | Polled via `evaluate_script` + `document.querySelector` (MCP `wait_for` doesn't reliably throw on timeout) |
291
- | 🟡 Warning | `no_console_errors` assert — console errors recorded *during* this flow (baseline-sliced, not session-wide) | Baseline snapshot of `list_console_messages` at flow start; only messages after that offset count |
292
- | 🟡 Warning | `no_network_errors` assert — 4xx/5xx request during this flow (baseline-sliced) | Baseline snapshot of `list_network_requests` at flow start; status 400 after offset |
293
- | 🟡 Warning | `url_contains` assert — URL does not include expected substring after flow completes | `evaluate_script` reads `window.location.href` |
294
- | 🟡 Warning | `element_not_visible` assert — selector unexpectedly present in DOM | `evaluate_script` `!document.querySelector(...)` |
295
- | 🔴 Critical | `no_js_errors` assert — uncaught exceptions captured in `window.__argusErrors` during flow | Script parses the injected error buffer |
296
-
297
- ### Environment Regressions *(dev vs staging)*
298
-
299
- | Severity | Bug / Issue | Detection Method |
300
- | --- | --- | --- |
301
- | 🔴 Critical | API status regressed — request that returned 2xx in dev now returns 5xx in staging | Network diff between both environments |
302
- | 🟡 Warning | Visual change > 0.5% pixels different between dev and staging screenshots | `pixelmatch` pixel-level comparison + diff overlay image |
303
- | 🟡 Warning | New console error in staging that doesn't exist in dev | Console message diff |
304
- | 🟡 Warning | New network request in staging unexpected endpoint appeared | Network request URL diff |
305
- | 🟡 Warning | Request present in dev is missing in staging — endpoint removed or broken | Network request URL diff |
306
- | 🟡 Warning | API status changed between environments (any non-5xx change) | Network status diff |
307
- | 🔵 Info | DOM structural change element count differs between dev and staging | HTML tag count comparison across snapshots |
308
-
309
- ---
310
-
311
- ## What It Does
312
-
313
- Argus watches your running application and automatically surfaces issues that test suites miss: visual regressions, API loops, CSS drift, console noise, and accessibility failures — all with screenshots delivered directly to Slack.
314
-
315
- | Feature | Description |
316
- | --- | --- |
317
- | **Error Detection** | Crawls your app's routes; captures JS exceptions, console errors, failed API calls, redirect chains, and broken internal links |
318
- | **Environment Comparison** | Diffs dev vs staging: screenshots, DOM structure, network requests, console errors |
319
- | **CSS Analysis** | Detects cascade overrides, component style leaks, unused rules, React inline style conflicts |
320
- | **API Frequency Analysis** | Flags endpoints called more than once per page load (double-fetch, missing `useEffect` deps, infinite loops) |
321
- | **Network Performance** | `slow_api` > 1s/3s and `large_payload` > 500KB/2MB per API call |
322
- | **SEO Checks** | Missing meta description, OG tags, canonical, viewport, h1 DOM-inspected on every route |
323
- | **Security Checks** | localStorage tokens, token-in-URL, `eval()`, sensitive console output, missing CSP/X-Frame-Options |
324
- | **Content Quality** | `null`/`undefined` rendered text, lorem ipsum, broken images, empty data lists |
325
- | **Responsive Analysis** | Overflow + touch target checks at 375/768px; screenshot grid at 4 breakpoints dispatched to Slack |
326
- | **Memory Leak Detection** | V8 heap snapshot detached DOM node count; heap growth across navigate-away + navigate-back |
327
- | **Runtime Anti-Patterns** | Synchronous XHR, `document.write`, long tasks > 50ms, CORS violations, service worker registration failures, and missing cache headers on static assets — detected via script injection and post-load HEAD checks |
328
- | **Hover-State Bug Detection** | Fires `hover` on every `[aria-haspopup]` and `[data-tooltip]` element; detects broken dropdowns and invisible tooltips that CSS `:hover` was supposed to reveal |
329
- | **Accessibility Snapshot Analysis** | Calls `take_snapshot` then `evaluate_script`; flags interactive elements missing accessible names, unlabelled form controls, duplicate landmark regions, heading level skips, and `aria-expanded` buttons with missing/broken `aria-controls` |
330
- | **Keyboard Focus Analysis** | Tab-walks every focusable element (up to 20 steps); detects `focus_visible_missing` (button/link with `outline:0` and no `box-shadow` fallback keyboard users cannot see where focus is) |
331
- | **Chrome DevTools Issues Panel** | Queries `list_console_messages({ types: ['issue'] })` for the Issues panel namespace, which is entirely separate from `console.error`; catches CSP violations and deprecated API usage (verified) additional Chrome-surfaced types (CORS blocks, mixed content, cookie misconfiguration, low-contrast) are classified when present |
332
- | **Mobile CPU Throttling** | Applies 4× CPU throttle (`emulate({ cpuThrottlingRate: 4 })`) during ≤768px responsive breakpoints finds layout reflow and animation jank that only manifests under realistic mobile CPU pressure |
333
- | **Origin-Tagged Network Findings** | All network error and timing findings carry `origin: 'first-party' \| 'third-party'` so operators can triage critical first-party failures without digging through third-party CDN noise |
334
- | **Historical Baselines** | Saves finding keys after each run; subsequent runs only alert on *new* issues; trend summary in Slack digest |
335
- | **Flakiness Detection** | Crawls each route twice per run; findings in both runs are confirmed (original severity); findings in only one run are marked flaky (`severity: info`, `:zap: _flaky_` label) |
336
- | **User Flow Assertions** | Named multi-step flows (`navigate/fill/click/press_key/drag/upload_file/waitFor/sleep/handle_dialog/assert`) with baseline-sliced `no_console_errors`, `no_network_errors`, `element_visible`, `url_contains`, `no_js_errors` asserts — runs end-to-end user journeys without writing Playwright specs · Use `typing: true` on a fill step to dispatch real keyboard events via `mcp.type_text` (triggers input-event validation) · Use `drag` step to fire dragstart→dragover→drop sequences · Use `upload_file` step to deliver a local file to a file input via CDP (`{ action: 'upload_file', selector: 'input[type=file]', filePath: '/path/to/file' }`) |
337
- | **API Contract Validation** | Define `apiContracts[]` in `targets.js` with inline `schema` or `schemaFile`; validates captured response bodies against JSON Schema (type, required, properties, items) emits `api_contract_violation` warnings when shapes diverge from spec |
338
- | **Severity Policy Overrides** | Define `severityOverrides` in `targets.js` (`{ finding_type: 'info' \| 'warning' \| 'critical' \| 'suppress' }`); applied before Slack routingremap or silence specific detections without touching analyzer code |
339
- | **Auth Token Refresh** | `refreshSession()` is called before each route; re-runs the login flow when the saved session has less than `sessionRefreshWindowMs` (default 5 min) remainingprevents long crawls from failing mid-run when the auth cookie expires |
340
- | **Slack-optional mode** | When `SLACK_BOT_TOKEN` is not configured, Argus skips Slack entirely and auto-generates a local `report.html` (all findings + inline screenshots) and opens it in the default browser zero setup required to start using Argus |
341
- | **Codebase Cross-Reference** | Points `ARGUS_SOURCE_DIR` at your app source to detect: missing env vars (`process.env.X` used in code but absent from `.env`), feature flag leakage (conditional env var that is falsy/unset), console error stack traces resolved to `file:line`, and internal links that return 404 — all without opening a browser |
342
- | **GitHub PR Integration** | Posts a structured Markdown findings table as a PR comment (updates in-place one comment per PR, no spam); sets an `argus-qa` commit status check (`failure` when new criticals exist, `success` otherwise) blocks merge via branch protection when regressions are introduced. Requires `GITHUB_TOKEN` + `GITHUB_REPOSITORY` env vars |
343
- | **Auto Route Discovery** | Augments manual `routes[]` with paths from three sources: fetches `/sitemap.xml` (follows one sitemap-index level, 10s timeout), scans Next.js `pages/` (Next 12) and `app/` (Next 13+) directories stripping route groups `(auth)`, and greps JS/TS source for React Router `<Route path>` declarations. Dynamic `[param]` segments are skipped — no concrete URL to crawl. Manual route config (`critical`, `waitFor`) always takes precedence. |
344
- | **`argus init` Setup Wizard** | `npm run init` (or `npx argus init`) guides first-time setup: collects target URLs, detects the app framework (Next.js / React Router / unknown) from the source directory's `package.json`, runs C3 route discovery against the dev URL, prompts for optional Slack tokens and GitHub credentials, then writes a populated `.env` and a pre-filled `src/config/targets.js` zero manual config editing required. |
345
- | **Watch Mode** | `npm run watch` attaches to whatever Chrome tab is open and polls `list_console_messages` + `list_network_requests` every 1 s (configurable via `ARGUS_WATCH_INTERVAL_MS`). Reports new console errors, network failures (4xx/5xx), CORS blocks, and auth failures in real time without navigating. Starts a live web dashboard at `http://localhost:3002` (configurable via `ARGUS_WATCH_UI_PORT`). On `Ctrl+C`, generates a final `reports/report.html`. No route config needed. |
346
- | **Full Lighthouse Suite** | All 4 Lighthouse categories (performance, SEO, best-practices, accessibility) with per-audit items |
347
- | **Performance Budgets** | Enforces LCP < 2500ms, CLS < 0.1, FID < 100ms, TTFB < 800ms per route |
348
- | **Slack Notifications** | Rich Block Kit reports with inline screenshots routed to `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` |
349
- | **Slash Command** | `/argus-retest <url>` triggers an on-demand test from any Slack channel |
350
- | **CI Integration** | GitHub Actions workflow runs daily at 6 AM UTC and on every push to `main` |
351
- | **MCP Server (AI-callable Argus)** | Register Argus as an MCP server via `.mcp.json`; Claude (or any MCP client) can call `argus_audit`, `argus_audit_full`, `argus_compare`, `argus_last_report`, `argus_watch_snapshot`, and `argus_get_context` directly from a conversation — no CLI, no terminal required. Published to npm as **[argusqa-os](https://www.npmjs.com/package/argusqa-os)** — add via `{ "command": "npx", "args": ["-y", "argusqa-os"] }` in `.mcp.json` |
352
-
353
- Works with **React + SCSS**, CSS Modules, CSS-in-JS (styled-components / emotion), and plain HTML/CSS apps.
354
-
355
- ---
356
-
357
- ## How It Works
358
-
359
- Three components run against the same Chrome instance:
360
-
361
- ```text
362
- Claude Code (Terminal / VS Code)
363
- ├── MCP Protocol Chrome DevTools MCP Server → Chrome
364
- └── Writes → Orchestration Layer → Slack Bot API
365
- ```
366
-
367
- - **Chrome DevTools MCP Server** programmatic access to Chrome: network traffic, console, screenshots, DOM, performance traces
368
- - **Claude Code** orchestration hub: reads codebase, drives the MCP tools, classifies findings, posts to Slack
369
- - **Slack Bot (BugBot)** — receives reports, exposes `/argus-retest` slash command, handles Acknowledge / Retest button actions
370
-
371
- In interactive mode (running from Claude Code), MCP tools are called natively. In CI mode (GitHub Actions), `src/utils/mcp-client.js` spawns `chrome-devtools-mcp` as a child process and communicates via JSON-RPC over stdio.
372
-
373
- ---
374
-
375
- ## Prerequisites
376
-
377
- | Requirement | Version | Notes |
378
- | --- | --- | --- |
379
- | Node.js | v20.19+ | Required by Chrome DevTools MCP |
380
- | Chrome | Stable (current) | Must be installed |
381
- | Claude Code | Latest | `npm install -g @anthropic-ai/claude-code` |
382
- | Slack workspace | | **Optional** — only needed if you want Slack reports. Without it, Argus generates a local `report.html` instead |
383
-
384
- ---
385
-
386
- ## One-Time Setup
387
-
388
- ### Option A — MCP Server (Claude Code / any MCP client)
389
-
390
- No local install required. `npx` auto-downloads `argusqa-os` on first use.
391
-
392
- #### 1. Register both MCP servers
393
-
394
- Add to `.mcp.json` in your project root:
395
-
396
- ```json
397
- {
398
- "mcpServers": {
399
- "chrome-devtools": {
400
- "command": "npx",
401
- "args": ["-y", "chrome-devtools-mcp@latest"]
402
- },
403
- "argus": {
404
- "command": "npx",
405
- "args": ["-y", "argusqa-os"]
406
- }
407
- }
408
- }
409
- ```
410
-
411
- Or via Claude Code CLI:
412
-
413
- ```bash
414
- claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
415
- claude mcp add argus -- npx -y argusqa-os
416
- ```
417
-
418
- #### 2. Environment variables
419
-
420
- Create a `.env` file in your project root:
421
-
422
- ```env
423
- TARGET_DEV_URL=http://localhost:3000
424
- TARGET_STAGING_URL=https://staging.example.com # optional enables argus_compare
425
- ```
426
-
427
- #### 3. Start Chrome with remote debugging
428
-
429
- ```bash
430
- # macOS
431
- open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
432
-
433
- # Windows
434
- "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --headless=new --no-sandbox --disable-gpu
435
-
436
- # Linux
437
- google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
438
- ```
439
-
440
- #### 4. Slack notifications (optional)
441
-
442
- > Skip to use local `report.html` mode — Argus generates a self-contained HTML report when Slack is not configured.
443
-
444
- 1. [api.slack.com/apps](https://api.slack.com/apps) **Create New App** → name it **BugBot**
445
- 2. **OAuth & Permissions** → Bot Token Scopes: `chat:write`, `files:write`, `files:read`
446
- 3. Install to workspace copy **Bot User OAuth Token** (`xoxb-...`) to `.env` as `SLACK_BOT_TOKEN`
447
- 4. Create `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` and `/invite @BugBot` in each
448
-
449
- ```env
450
- SLACK_BOT_TOKEN=xoxb-...
451
- SLACK_CHANNEL_CRITICAL=C0000000000
452
- SLACK_CHANNEL_WARNINGS=C0000000001
453
- SLACK_CHANNEL_DIGEST=C0000000002
454
- ```
455
-
456
- ---
457
-
458
- ### Option B — npm Package (dev dependency / CI/CD)
459
-
460
- #### 1. Install
461
-
462
- ```bash
463
- npm install --save-dev argusqa-os
464
- ```
465
-
466
- #### 2. Environment variables
467
-
468
- Run the interactive wizard to auto-generate `.env` and `src/config/targets.js`:
469
-
470
- ```bash
471
- npx argus
472
- ```
473
-
474
- The wizard detects your framework (Next.js / React Router), discovers routes from `sitemap.xml` and your file structure, and optionally collects Slack and GitHub credentials.
475
-
476
- **Alternative — manual setup:** Create a `.env` with `TARGET_DEV_URL` and optionally `TARGET_STAGING_URL`.
477
-
478
- #### 3. Start Chrome with remote debugging
479
-
480
- Same as Option A see above.
481
-
482
- #### 4. Slack notifications (optional)
483
-
484
- Same as Option A — see above.
485
-
486
- ---
487
-
488
- ### Option CClone the Repository (full source / contributors)
489
-
490
- #### 1. Clone and install
491
-
492
- ```bash
493
- git clone https://github.com/ironclawdevs27/Argus.git
494
- cd Argus
495
- npm install
496
- npm run setup # creates reports/ directory
497
- ```
498
-
499
- #### 2. Environment variables
500
-
501
- **Recommended — use the interactive setup wizard:**
502
-
503
- ```bash
504
- npm run init
505
- ```
506
-
507
- **Alternative — manual setup:**
508
-
509
- ```bash
510
- cp .env.example .env
511
- ```
512
-
513
- Open `.env` and fill in:
514
-
515
- ```env
516
- TARGET_DEV_URL=http://localhost:3000
517
- TARGET_STAGING_URL=https://staging.example.com # leave blank CSS-only analysis mode
518
-
519
- # Slack — OPTIONAL. Omit to get a local report.html instead.
520
- # SLACK_BOT_TOKEN=xoxb-...
521
- # SLACK_SIGNING_SECRET=...
522
- # SLACK_CHANNEL_CRITICAL=C0000000000
523
- # SLACK_CHANNEL_WARNINGS=C0000000001
524
- # SLACK_CHANNEL_DIGEST=C0000000002
525
- ```
526
-
527
- #### 3. Configure routes
528
-
529
- If you ran `npm run init` — skip this step.
530
-
531
- Otherwise, edit [src/config/targets.js](src/config/targets.js):
532
-
533
- ```js
534
- export const routes = [
535
- { path: '/', name: 'Home', critical: true, waitFor: 'main' },
536
- { path: '/login', name: 'Login', critical: true, waitFor: 'form' },
537
- { path: '/dashboard', name: 'Dashboard', critical: true, waitFor: '[data-testid="dashboard"]' },
538
- { path: '/settings', name: 'Settings', critical: false, waitFor: null },
539
- ];
540
- ```
541
-
542
- - `critical: true` errors on this route go to `#bugs-critical`
543
- - `waitFor` — CSS selector Argus waits for before capturing (signals the page is ready)
544
-
545
- #### 4. Connect Chrome DevTools MCP to Claude Code
546
-
547
- ```bash
548
- claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
549
- ```
550
-
551
- Verify — ask Claude: *"List all open Chrome pages"* — you should see your tabs.
552
-
553
- #### 5. Start Chrome with remote debugging
554
-
555
- Same as Option A — see above.
556
-
557
- #### 6. Slack notifications (optional)
558
-
559
- Same as Option A — see above.
560
-
561
- ---
562
-
563
- ## Running Argus
564
-
565
- ### Option A — Via MCP (Claude Code / any MCP client)
566
-
567
- Ask Claude directly — no terminal needed.
568
-
569
- **Available tools:**
570
-
571
- | Tool | What it does |
572
- | --- | --- |
573
- | `argus_audit` | Fast QA pass — JS errors, network failures, accessibility, SEO, security, CSS, content |
574
- | `argus_audit_full` | Deep QA pass — adds Lighthouse, responsive layout checks across 4 viewports, memory leak detection, hover-state bug detection, and accessibility tree snapshot |
575
- | `argus_compare` | Diff dev vs staging — screenshots, findings delta, environment regressions |
576
- | `argus_last_report` | Return the last saved JSON report without re-running a scan |
577
- | `argus_watch_snapshot` | Snapshot the currently open Chrome tab without navigating raw console + network capture |
578
- | `argus_get_context` | Capture everything broken on the open tab, formatted as a diagnostic context for Claude to diagnose and suggest fixes |
579
-
580
- **`argus_audit`** fast audit of any URL:
581
-
582
- ```text
583
- Run argus_audit on http://localhost:3000/checkout
584
- Run argus_audit on http://localhost:3000/login with critical: true
585
- ```
586
-
587
- **`argus_audit_full`** — deep audit with Lighthouse + memory + responsive checks:
588
-
589
- ```text
590
- Run argus_audit_full on http://localhost:3000/dashboard
591
- ```
592
-
593
- **`argus_compare`** — dev vs staging diff (reads `TARGET_DEV_URL` and `TARGET_STAGING_URL` from `.env`):
594
-
595
- ```text
596
- Run argus_compare
597
- ```
598
-
599
- **`argus_last_report`** — retrieve last audit without re-running Chrome:
600
-
601
- ```text
602
- Run argus_last_report
603
- ```
604
-
605
- **`argus_watch_snapshot`** — snapshot the currently open tab without navigating. Useful when the page is in an authenticated or post-interaction state that navigation would reset:
606
-
607
- ```text
608
- Run argus_watch_snapshot
609
- Run argus_watch_snapshot with url: http://localhost:3000
610
- ```
611
-
612
- **`argus_get_context`** — when your app is stuck or throwing errors, run this to capture everything that's broken and feed it to Claude for diagnosis:
613
-
614
- ```text
615
- Run argus_get_context
616
- ```
617
-
618
- Then follow with: *"Here's the context — what's causing these errors and how do I fix them?"*
619
-
620
- ---
621
-
622
- ### Option B & C — Via CLI / npm scripts
623
-
624
- **Available commands:**
625
-
626
- | Command | What it does |
627
- | --- | --- |
628
- | `npm run crawl` | Multi-page batch audit of all routes in `targets.js` |
629
- | `npm run compare` | Dev vs staging diff (or CSS analysis if no `TARGET_STAGING_URL`) |
630
- | `npm run watch` | Passive monitor — polls the open Chrome tab every 1s, no navigation |
631
- | `npm run report:html` | Generate `reports/report.html` from the latest JSON audit |
632
- | `npm run server` | Start the Slack slash command + interaction server (port 3001) |
633
- | `npm run init` | Interactive setup wizard generates `.env` + `targets.js` |
634
- | `npm run test:unit` | Run 61 unit tests (no Chrome required) |
635
- | `npm run test:harness` | Run 126-block correctness harness (requires Chrome) |
636
-
637
- **`npm run crawl`** full audit of all configured routes:
638
-
639
- ```bash
640
- npm run crawl
641
- ```
642
-
643
- Reports are saved to `reports/` as JSON files. Run `npm run report:html` after any crawl for a portable `reports/report.html` with all screenshots inlined — useful for sharing with designers or reviewing offline.
644
-
645
- **`npm run compare`** — dev vs staging diff:
646
-
647
- ```bash
648
- npm run compare
649
- ```
650
-
651
- When `TARGET_STAGING_URL` is not set, automatically switches to **CSS analysis mode** — cascade overrides, component style leaks, unused rules, and React inline style conflicts on the dev environment only.
652
-
653
- **`npm run watch`** — passive monitoring (polls every 1s, no navigation):
654
-
655
- Attaches to whatever Chrome tab is open and reports new issues in real time without navigating anywhere. Use this while developing.
656
-
657
- ```text
658
- Requires 2 terminals:
659
- Terminal 1 — your app (npm start / npm run dev)
660
- Terminal 2 npm run watch
661
- ```
662
-
663
- Steps:
664
- 1. Open Chrome and navigate to your app
665
- 2. Terminal 1: start your application
666
- 3. Terminal 2: `npm run watch` — Argus begins polling
667
- 4. Develop normally — console errors, network failures (4xx/5xx), CORS blocks, and auth failures print in real time
668
- 5. `Ctrl+C` — stops the monitor and writes `reports/report.html`
669
-
670
- ```bash
671
- # Attribute findings to a specific URL:
672
- npm run watch http://localhost:4000
673
- ```
674
-
675
- | Variable | Default | Description |
676
- | --- | --- | --- |
677
- | `ARGUS_WATCH_INTERVAL_MS` | `1000` | Poll interval in milliseconds |
678
- | `TARGET_DEV_URL` | `http://localhost:3000` | URL attributed to findings when none passed |
679
-
680
- **`npm run report:html`** generate HTML dashboard from last audit:
681
-
682
- ```bash
683
- npm run report:html
684
- # → reports/report.html (all findings + inline screenshots, portable, no server needed)
685
- ```
686
-
687
- ---
688
-
689
- ### Option D From Slack (on-demand)
690
-
691
- ```text
692
- /argus-retest https://staging.example.com/checkout
693
- ```
694
-
695
- BugBot responds immediately, runs the test, and posts results back. Detailed bug reports go to `#bugs-critical`. See [Slack Slash Command Setup](#slack-slash-command-setup) for configuration.
696
-
697
- ---
698
-
699
- ## CSS Analysis Mode
700
-
701
- When `TARGET_STAGING_URL` is not set in `.env`, `npm run compare` automatically switches to **CSS analysis mode** instead of comparing two environments.
702
-
703
- **What it analyzes on your dev environment:**
704
-
705
- | Check | What it catches |
706
- | --- | --- |
707
- | **Cascade overrides** | Same CSS property declared multiple times on an element; `!important` flagged as warning |
708
- | **Component style leaks** | BEM selector (`.card__title`) found in a stylesheet that doesn't belong to that component |
709
- | **Unused rules** | CSS selectors that match no element on the current page |
710
- | **CSS Modules** | Detects hashed class names; extracts readable component names (`Button`, `Card`, etc.) |
711
- | **React inline style conflicts** | `style=""` attribute overriding a stylesheet declaration on the same element |
712
- | **SCSS source maps** | Traces compiled CSS back to original `.scss` files where source maps are available |
713
-
714
- **API frequency analysis** also runs automatically:
715
-
716
- | Call count | Severity | Likely cause |
717
- | --- | --- | --- |
718
- | 2 calls | info | Possible prefetch + actual — verify intentional |
719
- | 3–4 calls | warning | Double-fetch — check `useEffect` deps or component re-mounts |
720
- | 5+ calls | critical | Runaway loop — missing cleanup, infinite re-render |
721
-
722
- ---
723
-
724
- ## Performance Budgets
725
-
726
- Argus enforces these thresholds on every crawl:
727
-
728
- | Metric | Threshold | Severity |
729
- | --- | --- | --- |
730
- | LCP (Largest Contentful Paint) | < 2500ms | warning |
731
- | CLS (Cumulative Layout Shift) | < 0.1 | warning |
732
- | FID / TBT (interaction latency) | < 100ms | warning |
733
- | TTFB (Time to First Byte) | < 800ms | warning |
734
-
735
- Violations are reported as individual warning bugs with the measured value.
736
-
737
- ---
738
-
739
- ## Lighthouse Suite
740
-
741
- Runs all four Lighthouse categories on every route:
742
-
743
- - **Accessibility** — score < 50 → `critical`; score < 90 → `warning`
744
- - **Performance** — score < 90 → `warning`
745
- - **SEO** — score < 90 → `warning`
746
- - **Best Practices** score < 90 → `warning`
747
-
748
- Individual failing audit items (e.g., missing alt text, low contrast, render-blocking resources) are surfaced as separate findings alongside the category score.
749
-
750
- ---
751
-
752
- ## Slack Channel Routing
753
-
754
- > **Slack is optional.** When `SLACK_BOT_TOKEN` is not set, Argus skips Slack entirely and
755
- > auto-generates a local `report.html` (all findings + inline screenshots) and opens it in
756
- > the default browser. No Slack setup needed to start using Argus.
757
-
758
- When Slack **is** configured, findings are routed by severity:
759
-
760
- | Severity | Channel | When |
761
- | --- | --- | --- |
762
- | `critical` | `#bugs-critical` | JS exceptions, HTTP 5xx, blank page, auth failure, API called 5+ times, Lighthouse accessibility < 50, auth token in storage/URL, responsive overflow, slow API > 3s, payload > 2MB, > 100 detached DOM nodes, CORS policy violations, `debugger;` statements in production code, blocked mixed content (HTTP resource on HTTPS page) |
763
- | `warning` | `#bugs-warnings` | Visual regression > 0.5%, HTTP 4xx, CSS overrides with `!important`, API called 3–4×, Lighthouse scores < 90, missing SEO/OG tags, missing security headers, placeholder content, touch targets too small, slow API > 1s, payload > 500KB, > 10 detached DOM nodes, redirect chains > 2 hops, broken links, sync XHR, `document.write`, long tasks > 50ms, SW registration failures, duplicate `id` attributes, passive mixed content (images/audio on HTTPS page) |
764
- | `info` | `#bugs-digest` | Console warnings, unused CSS rules, API summaries, CSS Modules detection, empty data lists, responsive screenshot grid, missing cache headers on static assets |
765
-
766
- Each message includes:
767
-
768
- - Severity badge + affected URL + timestamp
769
- - AI-generated description
770
- - Inline screenshot (uploaded directly to Slack — no external hosting)
771
- - **View Page**, **Acknowledge**, and **Retest** action buttons
772
-
773
- ---
774
-
775
- ## Slack Slash Command Setup
776
-
777
- To use `/argus-retest` from Slack, you need to expose the Argus server publicly.
778
-
779
- ### Step 1 — Start the server
780
-
781
- ```bash
782
- npm run server
783
- ```
784
-
785
- Server runs on port 3001.
786
-
787
- ### Step 2 — Expose with Cloudflare Tunnel
788
-
789
- Download [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) (free, no account needed), then:
790
-
791
- ```bash
792
- cloudflared tunnel --url http://localhost:3001
793
- ```
794
-
795
- Alternatively, with no install at all (SSH tunnel):
796
-
797
- ```bash
798
- ssh -R 80:localhost:3001 nokey@localhost.run
799
- ```
800
-
801
- Copy the public HTTPS URL that appears.
802
-
803
- ### Step 3 — Configure Slack App
804
-
805
- 1. [api.slack.com/apps](https://api.slack.com/apps) → BugBot → **Slash Commands** → Create New Command:
806
- - Command: `/argus-retest`
807
- - Request URL: `https://your-public-url/slack/commands`
808
- - Description: `Run Argus regression test on a URL`
809
- - Usage hint: `<url>`
810
-
811
- 2. **Interactivity & Shortcuts** → Enable → Request URL: `https://your-public-url/slack/interactions`
812
-
813
- 3. **OAuth & Permissions** **Reinstall to Workspace**
814
-
815
- ### Step 4 — Test
816
-
817
- ```text
818
- /argus-retest http://localhost:3000
819
- ```
820
-
821
- BugBot should reply within 3 seconds with a "running" acknowledgement, then post results.
822
-
823
- ---
824
-
825
- ## GitHub Actions CI Setup
826
-
827
- ### Add secrets to your repository
828
-
829
- Go to GitHub repo → **Settings** → **Secrets and variables** → **Actions** → add:
830
-
831
- | Secret name | Required | Value |
832
- | --- | --- | --- |
833
- | `SLACK_BOT_TOKEN` | No | Your `xoxb-...` token. **Omit entirely to use Slack-optional mode** — Argus generates `report.html` instead |
834
- | `SLACK_SIGNING_SECRET` | No* | From Slack App Basic Information (only needed for `/argus-retest` slash command) |
835
- | `SLACK_CHANNEL_CRITICAL` | No* | Channel ID (required when Slack is configured) |
836
- | `SLACK_CHANNEL_WARNINGS` | No* | Channel ID (required when Slack is configured) |
837
- | `SLACK_CHANNEL_DIGEST` | No* | Channel ID (required when Slack is configured) |
838
- | `TARGET_STAGING_URL` | Yes | Your staging base URL |
839
- | `GITHUB_TOKEN` | No | For C2 PR integration auto-injected by GitHub Actions as `secrets.GITHUB_TOKEN` |
840
- | `GITHUB_REPOSITORY` | No | For C2 PR integration `owner/repo` format (e.g., `acme/my-app`) |
841
-
842
- > **C2 PR integration**: when `GITHUB_TOKEN` and `GITHUB_REPOSITORY` are set, Argus posts a PR comment and commit status check for every crawl. `GITHUB_PR_NUMBER` is injected automatically by the workflow from `github.event.pull_request.number`. The included workflow does not wire these up by default — add them to the `env:` block in `.github/workflows/argus.yml` if you want PR-level comments.
843
-
844
- The workflow at [.github/workflows/argus.yml](.github/workflows/argus.yml) runs:
845
-
846
- - On every push to `main` / `master`
847
- - Daily at 6 AM UTC (before the team starts work)
848
- - Manually via **Actions** → **Run workflow** (with optional URL override)
849
-
850
- If critical issues are found, the pipeline **fails** — preventing silent regressions from being missed.
851
-
852
- ---
853
-
854
- ## Project Structure
855
-
856
- ```text
857
- argus/
858
- ├── .env # Your secrets (never commit this)
859
- ├── .env.example # Template — copy to .env
860
- ├── .gitignore
861
- ├── package.json
862
- ├── README.md
863
- ├── .claude/
864
- │ └── settings.json # Claude Code permission config (auto-approve node/npm/reports)
865
- ├── .github/
866
- │ └── workflows/
867
- │ └── argus.yml # CI pipeline
868
- ├── .vscode/
869
- │ └── mcp.json # Chrome DevTools MCP config for VS Code
870
- ├── .mcp.json # Argus MCP server registration — exposes argus_audit/argus_audit_full/argus_compare/argus_last_report/argus_watch_snapshot/argus_get_context to Claude
871
- ├── src/
872
- ├── argus.js # Single-page audit entry point
873
- ├── batch-runner.js # Multi-page batch audit
874
- ├── mcp-server.js # Argus MCP server argus_audit / argus_audit_full / argus_compare / argus_last_report / argus_watch_snapshot / argus_get_context
875
- ├── adapters/
876
- │ │ └── browser.js # CdpBrowserAdapter — facade over all chrome-devtools-mcp calls
877
- │ ├── domain/
878
- │ └── finding.js # createFinding() factory — canonical finding shape
879
- │ ├── registry.js # Analyzer plugin registryregisterCheap/registerExpensive/getCheap/getExpensive/clearAll
880
- │ ├── config/
881
- │ │ ├── targets.js # Routes to test, thresholds, config
882
- │ └── schema.js # Zod validation schema; validateConfig() called inside runCrawl()
883
- ├── orchestration/
884
- ├── crawl-and-report.js # Backward-compat re-export shell orchestrator + report-processor + dispatcher
885
- ├── orchestrator.js # Crawl loop, route/flow crawl, runCrawl()
886
- │ │ ├── report-processor.js # Dedup severity overrides → baseline → JSON write
887
- │ │ ├── dispatcher.js # Slack / GitHub / HTML dispatch
888
- ├── env-comparison.js # Dev vs staging diff + CSS analysis mode
889
- │ │ ├── watch-mode.js # Passive browser monitoring (WatchSession + runWatchMode)
890
- │ │ └── slack-notifier.js # Slack Block Kit dispatcher
891
- │ ├── server/
892
- │ │ ├── index.js # Express server (port 3001)
893
- │ │ ├── slash-command-handler.js # /argus-retest handler
894
- │ │ └── interaction-handler.js # Acknowledge + Retest button handler
895
- ├── utils/
896
- ├── css-analyzer.js # CSS analysis script injected into the browser
897
- │ │ ├── seo-analyzer.js # SEO checks: meta, OG tags, h1, canonical, viewport
898
- │ │ ├── security-analyzer.js # Security: localStorage tokens, eval(), headers, cookies
899
- │ │ ├── content-analyzer.js # Content quality: null text, placeholders, broken images
900
- ├── responsive-analyzer.js # Responsive: overflow + touch targets at 4 breakpoints
901
- │ │ ├── memory-analyzer.js # Memory leaks: V8 heap snapshot + heap growth
902
- │ │ ├── logger.js # Pino structured logger — childLogger(module)│ │ ├── retry.js # withRetry() exponential backoff — navigate/fill only; Number.isFinite guard│ │ ├── telemetry.js # OTel tracing + metrics — startSpan() / recordFinding() / recordFlaky() / recordNewFindings(); no-op default│ │ ├── session-manager.js # Auth: backward-compat re-export barrel│ │ ├── session-persistence.js # Auth: saveSession (mkdirSync+atomic write), restoreSession, hasSession, clearSession│ │ ├── login-orchestrator.js # Auth: runLoginFlow, refreshSession + lock file│ │ ├── baseline-manager.js # Baselines: loadBaseline, saveBaseline, applyBaseline, appendTrend
903
- │ │ ├── flakiness-detector.js # Flakiness: mergeRunResults confirmed vs flaky per double-crawl
904
- │ │ ├── flow-runner.js # User flow assertions: runFlow / runAllFlows assert DSL
905
- │ │ ├── html-reporter.js # HTML dashboard: generateHtmlReport() + npm run report:html (D7.1 / D7.7)
906
- │ │ ├── parallel-crawler.js # chunkArray sharding utility (ARGUS_CONCURRENCY=N parallel crawl)
907
- │ │ ├── contract-validator.js # API contract validation: validateSchema, matchesContract (D7.4)
908
- │ │ ├── severity-overrides.js # Severity policy overrides: applyOverrides (D7.5)
909
- │ │ ├── slack-guard.js # Slack-optional guard: isSlackConfigured() (D7.7)
910
- │ │ ├── hover-analyzer.js # Hover-state bug detection aria-haspopup + data-tooltip (D8.1)
911
- │ │ ├── snapshot-analyzer.js # Accessibility tree snapshot — missing names, labels, landmarks, heading hierarchy, ARIA state (D8.2 + v6)
912
- │ │ ├── issues-analyzer.js # Chrome DevTools Issues panel CSP/deprecated/cookie issues
913
- │ │ ├── network-timing-analyzer.js # HAR timing analysis slow third-party detection
914
- │ │ ├── keyboard-analyzer.js # Keyboard Tab-walk focus_visible_missing, focus_lost
915
- │ │ ├── codebase-analyzer.js # Codebase cross-reference env vars, feature flags, dead routes (C1)
916
- │ │ ├── github-reporter.js # GitHub PR comment + commit status integration (C2)
917
- │ │ ├── route-discoverer.js # Auto route discoverysitemap + Next.js + React Router (C3)
918
- │ │ ├── diff.js # pixelmatch screenshot + DOM/network diff utilities
919
- │ │ ├── mcp-parsers.js # Text-format parsers for list_console_messages + list_network_requests (v9)
920
- │ │ └── mcp-client.js # Headless JSON-RPC MCP client for CI mode
921
- └── cli/
922
- └── init.js # argus init setup wizard detect framework, discover routes, write .env + targets.js (C4)
923
- ├── test/
924
- └── unit/ # Vitest unit tests no Chrome required
925
- ├── finding.test.js # createFinding() fields, throws, frozen, extra fields (8 tests)
926
- ├── config-schema.test.js # validateConfig() + ConfigSchema.safeParse (8 tests)
927
- ├── report-processor.test.js # deduplicateFindings + rebuildSummary (11 tests)
928
- ├── flakiness-detector.test.js # findingKey normalization + mergeRunResults (13 tests)
929
- ├── baseline-manager.test.js # loadBaseline/saveBaseline/applyBaseline (9 tests)
930
- └── flow-runner.test.js # normalizeArray (pure) + runFlow mock browser (11 tests)
931
- ├── landing/ # Product landing page (React 19 + Vite 8 + Tailwind + Framer Motion 12)
932
- ├── src/
933
- │ ├── App.jsx # Single-page apphero, features, comparison, waitlist + enterprise modals
934
- │ └── supabase.js # Supabase client factory (null-safe when env vars missing)
935
- ├── public/
936
- ├── favicon.svg # SVG favicon purple ring + dot
937
- ├── argus-poster.png # Video poster fallback (1918×1078)
938
- ├── og-image-v2.jpg # OG social card — 1200×630 JPEG, branded overlay, black-outlined stat numbers
939
- │ ├── robots.txt # Allows all crawlers; Sitemap reference
940
- │ │ └── sitemap.xml # Canonical URL for argus-qa.com/
941
- │ ├── index.html # Vite entry; OG/Twitter/JSON-LD SEO tags; canonical; favicon
942
- │ ├── package.json
943
- ├── .env.example # VITE_SUPABASE_URL + VITE_SUPABASE_ANON_KEY template
944
- └── README.md # Setup guide, Supabase SQL schema, env vars, deployment
945
- ├── scripts/
946
- └── dispatch-report.js # Standalone Slack re-dispatch script (re-posts last report.json to Slack)
947
- ├── test-harness/ # Fixture server + test runner (126 blocks, 528 hard assertions, 53 fixture pages)
948
- │ ├── README.md
949
- ├── server.js # Express fixture server (ports 3100 dev / 3101 staging)
950
- │ ├── harness-config.js # Route definitions + expected findings
951
- │ ├── validate.js # Test runner — 126 numbered blocks ([80]–[84] MCP/createFinding/withRetry/watch/init, [85]–[93] Sprint 0.5 Tier 3, [94]–[126] gap-close Sections 1–6)
952
- │ ├── pages/ # 53 fixture HTML pages (one per detection category)
953
- ├── nextjs-fixture/ # Next.js app structure for C3 discovery tests (10 files)
954
- ├── source-fixture/ # Minimal app.js for C1 codebase-analyzer tests (env var audit)
955
- │ └── static/
956
- │ └── button-styles.css # BEM card selectors in button file component leak
957
- └── reports/ # Output: JSON reports + screenshots (gitignored)
958
- ├── baselines/
959
- │ ├── <branch>.json # Per-route finding keys per git branch (D7.2)
960
- └── <branch>-trends.json # Append-only run history per branch (D7.2)
961
- └── .gitkeep
962
- ```
963
-
964
- ---
965
-
966
- ## Key Technical Decisions
967
-
968
- | Decision | Choice | Reason |
969
- | --- | --- | --- |
970
- | Screenshot comparison | pixelmatch + AI classification | pixelmatch is fast and deterministic; Claude removes false positives from anti-aliasing and dynamic content |
971
- | Slack API | Bot API, not Incoming Webhooks | Bot API supports file uploads, message updates, interactive buttons, and threads |
972
- | File uploads | `files.getUploadURLExternal` + PUT + `files.completeUploadExternal` | `files.upload` is deprecated; pre-signed URL requires PUT — POST silently produces broken files |
973
- | CSS analysis | Script injected via `evaluate_script` | Runs in page context so it sees the live computed styles, CSS Modules hashes, and React fiber properties |
974
- | Responsive viewport | `emulate` (not `resize_page`) | `resize_page` only resizes the browser window and does not update CSS viewport width — `emulate` is the correct API |
975
- | Viewport width measurement | `document.documentElement.clientWidth` | After `emulate` with mobile flag, `window.innerWidth` returns the legacy layout viewport (~952px), not the device width |
976
- | V8 heap snapshot | `take_heapsnapshot({ filePath })` → read from disk | The MCP tool writes JSON to disk (not inline); parse with `JSON.parse(fs.readFileSync(filePath))` then delete the temp file |
977
- | Detached DOM detection | Walk flat `nodes` array for "Detached " prefix in strings table | Chrome serializes detached elements as "Detached HTMLDivElement" etc.; secondary check on `detachedness === 2` (Chrome 90+) |
978
- | Baseline finding key | `type::message[:100]::status` | Excludes timestamps and dynamic URL path IDs; message truncated to 100 chars to handle slight wording variations; `::status` suffix only added when non-null |
979
- | Baseline alert filter | `isNew === true` (strict) | Only findings explicitly marked new by `applyBaseline` are dispatched to Slack — prevents stale re-dispatch if baseline-manager is not called (fails silently rather than spamming) |
980
- | Flakiness routing | `severity: 'info'` for flaky findings | Downgrading severity means existing `dispatchToSlack` routing sends them to the info digest with zero routing changes — only the `:zap: _flaky_` label needed |
981
- | Private `findingKey` per module | Each of `baseline-manager.js` and `flakiness-detector.js` has its own copy | Avoids coupling two independently-useful modules via a shared export for a trivial 3-line function |
982
- | Runtime anti-pattern injection | `addScriptToEvaluateOnNewDocument` via MCP | Scripts registered this way run in the new page context before any page script intercepts `XMLHttpRequest.open`, `document.write`, and `navigator.serviceWorker.register` before the page can call them |
983
- | CORS error detection | `list_console_messages` + text match, not in-page intercept | CORS errors are generated by the browser itself, not by page JS — `console.error` patcher misses them; the MCP console log captures them |
984
- | Long task detection | `PerformanceObserver({ entryTypes: ['longtask'] })` injected before load | Only the duration is included in the finding message (not `startTime`) ensures identical tasks on two crawl runs produce the same dedup key |
985
- | CI MCP client | JSON-RPC over stdio | In CI there's no Claude Code agent the headless client replaces it with the same API surface |
986
- | Node.js | v20.19+ | Minimum required by Chrome DevTools MCP |
987
-
988
- ---
989
-
990
- ## Known MCP Tool Limitations
991
-
992
- The Chrome DevTools MCP behavioral constraints below cause **3 permanent test failures** in the harness (`525/528` pass). These are MCP-layer restrictions they cannot be fixed in Argus code. `validate.js` now exits with code 0 when only these 3 failures remain, making the CI harness gate reliable.
993
-
994
- > **`type_text` clarification**: `type_text` does fire DOM `input` events when the element is properly focused first with `mcp.click({ uid })`. Always use uid-based focus passing `{ selector }` to `mcp.click` silently does nothing.
995
-
996
- | Tool | Constraint | Impact |
997
- | --- | --- | --- |
998
- | `drag` | Uses mouse simulation, **not** HTML5 DnD API | `dragstart`/`dragover`/`drop` events never fire |
999
- | `list_console_messages({ types: ['issue'] })` | Issues panel returns empty even when violations exist | CSP and deprecated-API detection is unreliable |
1000
-
1001
- These constraints are documented with workarounds in [SKILL.md §10](SKILL.md).
1002
-
1003
- ---
1004
-
1005
- ## Environment Variables Reference
1006
-
1007
- | Variable | Required | Description |
1008
- | --- | --- | --- |
1009
- | `SLACK_BOT_TOKEN` | No | `xoxb-...` Bot User OAuth Token. **Omit to enable Slack-optional mode** — Argus generates `report.html` and opens it in the browser instead |
1010
- | `SLACK_SIGNING_SECRET` | No* | Verifies slash command / interaction requests from Slack (required only when using `/argus-retest`) |
1011
- | `SLACK_CHANNEL_CRITICAL` | No* | Channel ID for critical bugs (required when Slack is configured) |
1012
- | `SLACK_CHANNEL_WARNINGS` | No* | Channel ID for warnings (required when Slack is configured) |
1013
- | `SLACK_CHANNEL_DIGEST` | No* | Channel ID for info / daily digest (required when Slack is configured) |
1014
- | `TARGET_DEV_URL` | Yes | Base URL of your dev environment |
1015
- | `TARGET_STAGING_URL` | No | Base URL of staging. If blank → CSS analysis mode |
1016
- | `SCREENSHOT_DIFF_THRESHOLD` | No | Pixel diff % to flag (default: `0.5`) |
1017
- | `REPORT_OUTPUT_DIR` | No | Where to write reports (default: `./reports`) |
1018
- | `ARGUS_CONCURRENCY` | No | Number of parallel MCP clients for route crawling (default: `1` = sequential) |
1019
- | `PORT` | No | Server port (default: `3001`) |
1020
- | `ARGUS_LOG_LEVEL` | No | Pino log level `trace`, `debug`, `info`, `warn`, `error`, `fatal` (default: `info`) |
1021
- | `ARGUS_LOG_PRETTY` | No | Set to `1` for human-readable log output instead of JSON (dev mode) |
1022
- | `ARGUS_RETRY_ATTEMPTS` | No | Max retry attempts for `navigate`/`fill` MCP calls (default: `3`) |
1023
- | `OTEL_EXPORTER_OTLP_ENDPOINT` | No | OTLP collector endpoint enables span/metric export to Jaeger, Grafana Tempo, Datadog, etc. |
1024
- | `ARGUS_OTEL_CONSOLE` | No | Set to `1` to print OTel spans to stdout without an OTLP endpoint (dev tracing) |
1025
- | `ARGUS_WATCH_INTERVAL_MS` | No | Watch mode poll interval in milliseconds (default: `1000`) |
1026
- | `ARGUS_WATCH_UI_PORT` | No | Watch mode web dashboard port (default: `3002`) |
1027
- | `ARGUS_SOURCE_DIR` | No | Path to your app's source directory — enables codebase cross-reference (env var detection, feature flag leakage, dead routes) |
1028
- | `ARGUS_ENV_FILE` | No | Path to your app's `.env` file — C1 cross-references env vars used in source code against this file to detect missing declarations |
1029
- | `GITHUB_TOKEN` | No | GitHub personal access token required for PR comment + commit status integration |
1030
- | `GITHUB_REPOSITORY` | No | Repository in `owner/repo` format — required for GitHub PR integration |
1031
- | `GITHUB_SHA` | No | Commit SHA for the commit status check injected automatically by GitHub Actions (`${{ github.sha }}`) |
1032
- | `GITHUB_PR_NUMBER` | No | PR number for comment targeting set via `${{ github.event.pull_request.number }}` in your workflow |
1033
- | `ARGUS_REPORT_URL` | No | Full URL to the hosted HTML report linked from the GitHub commit status check |
1034
-
1035
- ---
1036
-
1037
- ## Troubleshooting
1038
-
1039
- ### Chrome DevTools MCP not connecting
1040
-
1041
- ```bash
1042
- claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
1043
- # Then restart Claude Code
1044
- ```
1045
-
1046
- ### Slack messages not posting
1047
-
1048
- - Confirm `SLACK_BOT_TOKEN` starts with `xoxb-` (not `xoxp-`, `xoxe-`, or `xapp-`)
1049
- - Verify BugBot is invited to each channel: `/invite @BugBot`
1050
- - Check token scopes: `chat:write`, `files:write`, `files:read`
1051
-
1052
- ### Screenshots not appearing in Slack messages
1053
-
1054
- - The upload uses a pre-signed URL that requires `PUT`, not `POST` — if you see a broken image, check that the Slack token has `files:write` scope and the channel is correct
1055
-
1056
- ### Slash command returns "dispatch_failed"
1057
-
1058
- - Your tunnel URL has changed (Cloudflare Tunnel / localhost.run URLs change on restart)
1059
- - Update the Request URL in Slack App Slash Commands and reinstall
1060
-
1061
- ### CSS analysis returns empty results
1062
-
1063
- - Page may be behind auth — make sure you're logged in on the Chrome instance Argus is controlling
1064
- - Cross-origin stylesheets (CDN fonts, third-party widgets) can't be read due to browser security restrictions — this is expected
1065
-
1066
- ### Screenshots are blank
1067
-
1068
- - Page hasn't finished loading — increase `pageSettleMs` in `src/config/targets.js`
1069
- - Add a `waitFor` selector for that route
1070
-
1071
- ### CI pipeline fails immediately
1072
-
1073
- - Chrome may not be starting fast enough — increase the `sleep 3` after Chrome launch to `sleep 5` in `.github/workflows/argus.yml`
1074
-
1075
- ---
1076
-
1077
- ## How Argus Differs From Playwright / Cypress
1078
-
1079
- Argus is not a replacement for unit or E2E tests. It's a complementary layer:
1080
-
1081
- | | Playwright / Cypress | Argus |
1082
- | --- | --- | --- |
1083
- | **Tests** | Your logic and API contracts | What the user actually sees |
1084
- | **Catches** | Regression in behaviour | CSS drift, visual regressions, API redundancy, console noise, perf budgets |
1085
- | **Runs** | In your test suite | Continuously, on the live running app |
1086
- | **Setup** | Write test files | Configure routes in `targets.js` |
1087
- | **Output** | Pass / fail | Structured Slack reports with screenshots and action buttons |
1088
-
1089
- They complement each other — Argus catches what test suites miss.
1
+ # Argus — AI-Powered Dev Testing Tool
2
+
3
+ [![Argus MCP server](https://glama.ai/mcp/servers/ironclawdevs27/Argus/badges/card.svg)](https://glama.ai/mcp/servers/ironclawdevs27/Argus)
4
+
5
+ > *Argus Panoptes — the all-seeing giant of Greek mythology with a hundred eyes who never slept.*
6
+
7
+ Automated browser testing pipeline that catches bugs, compares environments, and sends rich reports to Slack (or generates a self-contained HTML dashboard when Slack is not configured) — powered by Chrome DevTools MCP and Claude Code.
8
+
9
+ ---
10
+
11
+ ## MCP Quick Start
12
+
13
+ Add both servers to your `.mcp.json`:
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "chrome-devtools": {
19
+ "command": "npx",
20
+ "args": ["-y", "chrome-devtools-mcp@latest"]
21
+ },
22
+ "argus": {
23
+ "command": "npx",
24
+ "args": ["-y", "argusqa-os"]
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ Or register via the Claude Code CLI:
31
+
32
+ ```bash
33
+ claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
34
+ claude mcp add argus -- npx -y argusqa-os
35
+ ```
36
+
37
+ Set your target URL and start Chrome with remote debugging:
38
+
39
+ ```bash
40
+ # .env
41
+ TARGET_DEV_URL=http://localhost:3000
42
+
43
+ # Start Chrome (required — Argus drives this instance via CDP)
44
+ # macOS: open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
45
+ # Windows (PowerShell): & "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"
46
+ # Linux: google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
47
+ ```
48
+
49
+ Then ask Claude (or any MCP client):
50
+
51
+ ```
52
+ Run argus_audit on http://localhost:3000
53
+ ```
54
+
55
+ **Seven tools are exposed:**
56
+
57
+ | Tool | What it does |
58
+ | --- | --- |
59
+ | `argus_audit` | Fast QA pass — JS errors, network failures, accessibility, SEO, security, CSS, content |
60
+ | `argus_audit_full` | Deep QA pass — adds Lighthouse scoring, responsive layout checks across 4 viewports, memory leak detection, hover-state bug detection, and accessibility tree snapshot |
61
+ | `argus_compare` | Diff dev vs staging side-by-side — screenshots, findings delta, environment regressions |
62
+ | `argus_last_report` | Return the last saved JSON report without re-running a scan |
63
+ | `argus_watch_snapshot` | Snapshot the currently open Chrome tab without navigating — raw console + network capture |
64
+ | `argus_get_context` | Capture everything broken on the open tab, formatted as a diagnostic context for Claude to diagnose and suggest fixes |
65
+ | `argus_design_audit` | Full Figma design-to-implementation fidelity audit — 13 finding types across color, typography, spacing, per-corner radius, position drift, stroke, shadow (color+spread), opacity, gap, and text. Selector fallback: `[data-testid]` → `[aria-label]` → `#id` → `.class` |
66
+
67
+ > **Requires**: Node.js ≥ 20.19, Chrome (desktop or headless), and the `chrome-devtools-mcp` server registered alongside Argus (shown above).
68
+
69
+ ---
70
+
71
+ The `landing/` directory contains the product landing page (React + Vite + Tailwind + Framer Motion) with Supabase-backed waitlist and enterprise contact forms. Live at **[argus-qa.com](https://argus-qa.com)** (deployed via Cloudflare Pages; background video served from Cloudflare R2). See [landing/README.md](landing/README.md) for setup.
72
+
73
+ <div align="center">
74
+
75
+ [![Tech stack icons](https://skillicons.dev/icons?i=nodejs,js,expressjs,react,css,sass,github,githubactions,vscode)](https://skillicons.dev)
76
+
77
+ </div>
78
+
79
+ <div align="center">
80
+
81
+ | 🔴 Critical / 🟡 Warning / 🔵 Info | ⚙️ | 🧪 | 📋 |
82
+ | :---: | :---: | :---: | :---: |
83
+ | **114 distinct issue types detected** | **26 analysis engines** | **581 test assertions** | **130 test blocks** |
84
+
85
+ </div>
86
+
87
+ ---
88
+
89
+ ## What Argus Catches
90
+
91
+ Argus runs **26 analysis engines** per run and detects **114 distinct issue types** across JavaScript runtime, network, CSS, performance, accessibility, SEO, security, content quality, responsive layout, memory, runtime anti-patterns, hover-state interactions, accessibility tree snapshots, keyboard focus, and Chrome DevTools issues panel — plus flakiness detection, historical baselines, user flow assertions, and environment comparison as cross-cutting layers. Every finding is classified by severity (`critical` / `warning` / `info`) and routed to the right Slack channel — or rendered as a local `report.html` when Slack is not configured.
92
+
93
+ ### JavaScript Runtime
94
+
95
+ | Severity | Bug / Issue | Detection Method |
96
+ | --- | --- | --- |
97
+ | 🔴 Critical | Uncaught exceptions `TypeError`, `ReferenceError`, etc. | `window.onerror` listener injected before page load |
98
+ | 🔴 Critical | Unhandled Promise rejections | `unhandledrejection` event listener injected into the page |
99
+ | 🟡 Warning | `console.error` calls (on non-critical routes) | Chrome DevTools `list_console_messages` |
100
+ | 🔴 Critical | `console.error` calls (on critical routes) | Chrome DevTools `list_console_messages` |
101
+ | 🔵 Info | `console.warn` deprecation notices and warnings | Chrome DevTools `list_console_messages` |
102
+
103
+ ### Network & API
104
+
105
+ | Severity | Bug / Issue | Detection Method |
106
+ | --- | --- | --- |
107
+ | 🔴 Critical | HTTP 5xx server errors on any request | `list_network_requests` → status 500 |
108
+ | 🔴 Critical | 401 / 403 auth failures on a **critical route** — user is being kicked out | `list_network_requests` → status 401 or 403 + `routeIsCritical` flag |
109
+ | 🟡 Warning | 401 / 403 auth failures on a non-critical route | `list_network_requests` status 401 or 403 (non-critical path) |
110
+ | 🔴 Critical | API endpoint called 5+ times in one page load — likely an infinite loop | Network frequency grouping by normalized URL + method |
111
+ | 🟡 Warning | HTTP 4xx client errors (404, 422, 429, etc.) | `list_network_requests`status 400–499 (non-auth) |
112
+ | 🟡 Warning | API endpoint called 3–4 times likely a double-fetch bug | Frequency grouping → 3 ≤ count 4 (check `useEffect` deps) |
113
+ | 🔵 Info | API endpoint called twice may be intentional prefetch | Frequency grouping count = 2 |
114
+ | 🔵 Info | API call summary per page load (total calls, unique endpoints, duplicates) | Aggregated network analysis |
115
+ | 🟡 Warning | Redirect chain longer than 2 hops extra round-trips inflate load time | Navigation Timing `redirectCount` read after page settle |
116
+ | 🟡 Warning | Broken internal link — `<a href>` target returns HTTP 404 | `<a>` elements harvested via `evaluate_script`, each verified against `list_network_requests` |
117
+
118
+ ### Page Health
119
+
120
+ | Severity | Bug / Issue | Detection Method |
121
+ | --- | --- | --- |
122
+ | 🔴 Critical | Blank or near-empty pageless than 50 characters of body text | `document.body.innerText` length check after navigation |
123
+ | 🟡 Warning | Expected element never appeared — page may have crashed mid-load | `waitFor` selector timeout after 10 seconds |
124
+
125
+ ### CSS & Styling
126
+
127
+ | Severity | Bug / Issue | Detection Method |
128
+ | --- | --- | --- |
129
+ | 🟡 Warning | `!important` cascade conflictforced override fighting another rule | CSS rule walk: property declared with `!important` on same element |
130
+ | 🟡 Warning | Component style leak BEM selector found in the wrong stylesheet | `.block__element` selector in a file whose name doesn't match `block` |
131
+ | 🟡 Warning | React inline style overriding a stylesheet declaration on the same element | `style=""` attribute vs. matching CSS rule, `__reactFiber` presence confirmed |
132
+ | 🔵 Info | CSS property declared by multiple rules on the same element (cascade override) | Computed style walk across all matched rules per key element |
133
+ | 🔵 Info | Unused CSS rulesselectors matching no element on the page (> 10 flagged) | `querySelectorAll(selector).length === 0` for every rule |
134
+ | 🔵 Info | CSS Modules detectedhashed class names found on DOM elements | Pattern `_ComponentName_class_hash` matched on live DOM |
135
+ | 🔵 Info | SCSS source map found — compiled CSS traced back to `.scss` origin file | `sourceMappingURL` comment in `<style>` tags |
136
+
137
+ ### Performance
138
+
139
+ | Severity | Bug / Issue | Detection Method |
140
+ | --- | --- | --- |
141
+ | 🟡 Warning | LCP > 2500mslargest element took too long to paint | Chrome performance trace → `performance_analyze_insight` |
142
+ | 🟡 Warning | CLS > 0.1layout shifted significantly after initial render | Chrome performance trace |
143
+ | 🟡 Warning | FID / TBT > 100msmain thread was blocked during interaction | Chrome performance trace |
144
+ | 🟡 Warning | TTFB > 800ms — server took too long to send the first byte | Chrome performance trace |
145
+
146
+ ### Accessibility
147
+
148
+ | Severity | Bug / Issue | Detection Method |
149
+ | --- | --- | --- |
150
+ | 🔴 Critical | Lighthouse accessibility score below 50 / 100 | Lighthouse audit via `lighthouse_audit` |
151
+ | 🟡 Warning | Lighthouse accessibility score 50–89 / 100 | Lighthouse audit |
152
+ | 🟡 Warning | Missing alt text on images | Individual Lighthouse audit check |
153
+ | 🟡 Warning | Insufficient color contrast ratio | Individual Lighthouse audit check |
154
+ | 🟡 Warning | Missing ARIA labels on interactive elements | Individual Lighthouse audit check |
155
+ | 🟡 Warning | Keyboard navigation broken or unreachable elements | Individual Lighthouse audit check |
156
+
157
+ ### SEO
158
+
159
+ | Severity | Bug / Issue | Detection Method |
160
+ | --- | --- | --- |
161
+ | 🟡 Warning | Missing `<meta name="description">` | DOM inspection via `evaluate_script` |
162
+ | 🟡 Warning | Missing Open Graph tags (`og:title`, `og:description`, `og:image`) | DOM inspection via `evaluate_script` |
163
+ | 🟡 Warning | `og:image` URL is relative Open Graph requires an absolute URL | DOM inspection + URL prefix check (`http://` / `https://`) |
164
+ | 🟡 Warning | Multiple `<h1>` tags on one page | DOM inspection — `querySelectorAll('h1').length > 1` |
165
+ | 🟡 Warning | Zero `<h1>` tags page has no primary heading | DOM inspection `querySelectorAll('h1').length === 0` |
166
+ | 🟡 Warning | Generic page title (less than 10 characters, or default placeholder) | DOM inspection + length check |
167
+ | 🟡 Warning | Missing `<link rel="canonical">` | DOM inspection via `evaluate_script` |
168
+ | 🟡 Warning | Missing `<meta name="viewport">` | DOM inspection via `evaluate_script` |
169
+
170
+ ### Security
171
+
172
+ | Severity | Bug / Issue | Detection Method |
173
+ | --- | --- | --- |
174
+ | 🔴 Critical | Auth token found in `localStorage` or `sessionStorage` | `evaluate_script` walks storage keys for token patterns |
175
+ | 🔴 Critical | Sensitive token in the page URL (query param or hash) | URL pattern match against current `window.location.href` |
176
+ | 🔴 Critical | `eval()` call detected in page scripts | `evaluate_script` AST-style text scan of inline `<script>` tags |
177
+ | 🔴 Critical | CSP violation inline script or external resource blocked by Content-Security-Policy | Chrome DevTools Issues panel (`list_console_messages({ types: ['issue'] })`) |
178
+ | 🟡 Warning | Sensitive data (`password`, `token`, `secret`) logged to the console | `list_console_messages` + keyword match |
179
+ | 🟡 Warning | Missing `Content-Security-Policy` response header | `fetch(location.href)` inside the page → response headers check |
180
+ | 🟡 Warning | Missing `X-Frame-Options` response header | Same headers fetch |
181
+ | 🟡 Warning | Cross-origin `<iframe>` without `sandbox` attribute enables form submission, parent navigation, cookie access | `evaluate_script` checks `iframe[src]` elements for missing sandbox attribute |
182
+ | 🟡 Warning | Page served over plain HTTP with no HTTPS upgrade redirect | URL protocol check (`http://` + non-localhost) |
183
+ | 🔵 Info | Cookie present without `HttpOnly` flag (limited detection — JS-visible cookies only) | `document.cookie` inspection |
184
+ | 🔵 Info | Deprecated browser API usage (e.g. `document.domain`, `DOMSubtreeModified`) | Chrome DevTools Issues panel |
185
+
186
+ ### Content Quality
187
+
188
+ | Severity | Bug / Issue | Detection Method |
189
+ | --- | --- | --- |
190
+ | 🟡 Warning | `null` or `undefined` rendered as visible text | DOM text scan for literal "null" / "undefined" strings |
191
+ | 🟡 Warning | Lorem ipsum / placeholder copy still in production | DOM text scan for "lorem ipsum" and common placeholder strings |
192
+ | 🟡 Warning | Broken image (404 or failed to load) | `evaluate_script` checks `img.naturalWidth === 0` on all images |
193
+ | 🔵 Info | Empty data list — `<ul>`, `<ol>`, or `<select>` with no children | DOM structure check |
194
+
195
+ ### Responsive / Mobile
196
+
197
+ | Severity | Bug / Issue | Detection Method |
198
+ | --- | --- | --- |
199
+ | 🔴 Critical | Horizontal overflow at mobile / tablet viewport (≤ 768px) | `emulate` at 375px and 768px → `document.documentElement.scrollWidth > clientWidth` |
200
+ | 🟡 Warning | Touch target smaller than 44×44 px at mobile or tablet viewport | CSS computed size check on interactive elements at 375px and 768px |
201
+ | 🔵 Info | Responsive screenshot grid — snapshots at 375 / 768 / 1024 / 1440px | `emulate` at 4 breakpoints, screenshots dispatched to Slack |
202
+
203
+ ### Network Performance
204
+
205
+ | Severity | Bug / Issue | Detection Method |
206
+ | --- | --- | --- |
207
+ | 🔴 Critical | API response time > 3000ms | `PerformanceObserver` entries for `fetch` / XHR calls |
208
+ | 🟡 Warning | API response time > 1000ms | Same observer, lower threshold |
209
+ | 🔴 Critical | API response payload > 2 MB | `list_network_requests` response body size |
210
+ | 🟡 Warning | API response payload > 500 KB | Same, lower threshold |
211
+ | 🟡 Warning | Cross-origin (third-party) script TTFB > 2000ms — blocking render or late interactivity | HAR `timing.wait` field from `list_network_requests` HAR data; cross-origin requests only |
212
+
213
+ ### Network Request Origin Tagging
214
+
215
+ All network findings carry an `origin` field (`'first-party'` / `'third-party'`) so operators can triage critical first-party failures separately from third-party noise.
216
+
217
+ ### Lighthouse Audits
218
+
219
+ | Severity | Bug / Issue | Detection Method |
220
+ | --- | --- | --- |
221
+ | 🔴 Critical | Lighthouse accessibility score < 50 / 100 | `lighthouse_audit` (accessibility category) |
222
+ | 🟡 Warning | Lighthouse accessibility score 50–89 / 100 | `lighthouse_audit` |
223
+ | 🟡 Warning | Lighthouse performance score < 90 / 100 | `lighthouse_audit` (performance category) |
224
+ | 🟡 Warning | Lighthouse SEO score < 90 / 100 | `lighthouse_audit` (seo category) |
225
+ | 🟡 Warning | Lighthouse best-practices score < 90 / 100 | `lighthouse_audit` (best-practices category) |
226
+ | 🟡 Warning | Individual failing Lighthouse audit items | Surfaced per-audit from the full Lighthouse report |
227
+
228
+ ### Memory Leaks
229
+
230
+ | Severity | Bug / Issue | Detection Method |
231
+ | --- | --- | --- |
232
+ | 🔴 Critical | > 100 detached DOM nodes in V8 heap — severe leak | `take_heapsnapshot` parse flat nodes array for "Detached Xxx" names |
233
+ | 🟡 Warning | > 10 detached DOM nodes in V8 heap — probable leak | Same snapshot parse, lower threshold |
234
+ | 🟡 Warning | Heap grew > 2 MB after navigate-away + navigate-back — probable per-load leak | `performance.memory.usedJSHeapSize` delta across round-trip (soft — GC-dependent) |
235
+
236
+ ### Runtime Anti-Patterns
237
+
238
+ | Severity | Bug / Issue | Detection Method |
239
+ | --- | --- | --- |
240
+ | 🟡 Warning | Synchronous `XMLHttpRequest` blocks the main thread until the server responds | `XMLHttpRequest.open` patched via `addScriptToEvaluateOnNewDocument`; `async === false` calls recorded |
241
+ | 🟡 Warning | `document.write` / `document.writeln` called can erase the page or block parsing | `document.write` and `document.writeln` patched before page load; calls recorded with method + content |
242
+ | 🟡 Warning | Long task > 50ms on the main thread blocks user interaction | `PerformanceObserver` with `entryTypes: ['longtask']` injected before page load |
243
+ | 🔴 Critical | CORS policy violationcross-origin fetch blocked by the browser | `list_console_messages` + pattern match for `"has been blocked by CORS policy"` |
244
+ | 🟡 Warning | Service worker registration failure SW script returns 4xx or is invalid | `navigator.serviceWorker.register` patched before page load; `.catch()` records failing script URL |
245
+ | 🔵 Info | Same-origin static asset (`.js`, `.css`, `.png`, `.woff2`, etc.) served without `Cache-Control` or `ETag` — browsers cannot cache it efficiently | `evaluate_script` reads `performance.getEntriesByType('resource')`, HEAD-fetches each unique same-origin asset, checks response headers |
246
+
247
+ ### Historical Baselines & Trends
248
+
249
+ | Severity | Bug / Issue | Detection Method |
250
+ | --- | --- | --- |
251
+ | 🔴 Critical | New critical finding not present in the saved baseline — regression introduced since last run | `applyBaseline` compares finding keys (`type::message[:100]::status`) against `reports/baselines/<branch>.json` (D7.2 per-branch) |
252
+ | 🟡 Warning | New warning finding not present in the baseline | Same key comparison, warning severity |
253
+ | 🔵 Info | Pre-existing finding still present no change since last run | Suppressed from real-time alerts; included in info digest only |
254
+ | 🔵 Info | Run trend summary — new vs resolved counts, saved per run | Appended to `reports/baselines/<branch>-trends.json`; surfaced as a trend line in Slack digest |
255
+
256
+ ### Hover-State Bugs
257
+
258
+ | Severity | Bug / Issue | Detection Method |
259
+ | --- | --- | --- |
260
+ | 🟡 Warning / 🔴 Critical | `[aria-haspopup]` element whose controlled popup does not become visible after hover — `aria-expanded` stays false and popup remains `display:none` / `visibility:hidden` / `opacity:0` | `hover` dispatches `mousemove`; `evaluate_script` checks `aria-expanded` + `getComputedStyle` on the controlled element; critical on routes marked `critical: true` |
261
+ | 🟡 Warning | `[data-tooltip]` element whose `[role="tooltip"]` is not visible in the DOM after hover — not found or opacity ≤ 0.05 | Same hover + `evaluate_script` checks tooltip opacity, `display`, `visibility`, and `offsetHeight` |
262
+
263
+ ### Accessibility Snapshot Analysis
264
+
265
+ | Severity | Bug / Issue | Detection Method |
266
+ | --- | --- | --- |
267
+ | 🟡 Warning | Interactive element (`<button>`, `<a>`, `[role="button"]`, `[role="link"]`) with no accessible name — no text content, `aria-label`, `aria-labelledby`, `title`, or `alt` | `take_snapshot` captures DOM/AX state; `evaluate_script` queries each visible interactive element for accessible name sources |
268
+ | 🟡 Warning | Form control (`<input>`, `<select>`, `<textarea>`) with no associated label — no `<label for="...">`, `aria-label`, or `aria-labelledby` (placeholder is intentionally excluded not a valid accessible name per WCAG 2.1 §3.3.2) | `evaluate_script` checks `label[for]`, ancestor `<label>`, `aria-label`, and `aria-labelledby` for each visible control |
269
+ | 🟡 Warning | Landmark role appearing more than once without distinct `aria-label` / `aria-labelledby` screen readers cannot differentiate them | `evaluate_script` counts `[role=X]` instances and checks for unique label values across: `main`, `banner`, `contentinfo`, `navigation`, `search`, `complementary`, `form`, `region` |
270
+ | 🟡 Warning | Heading level skip h1→h3 or h4→h6 jumps more than one level, breaking WCAG 1.3.1 document outline | DOM walk of `h1`–`h6` elements; detects gaps > 1 between consecutive heading levels |
271
+ | 🟡 Warning | `aria-expanded` button/control has no `aria-controls` attribute or references a non-existent element | `evaluate_script` checks `[aria-expanded]` elements for missing or broken `aria-controls` pointer |
272
+
273
+ ### Keyboard Accessibility
274
+
275
+ | Severity | Bug / Issue | Detection Method |
276
+ | --- | --- | --- |
277
+ | 🟡 Warning | Button or focusable element has `outline:0` with no `box-shadow` fallback — no visible focus ring | `press_key({ key: 'Tab' })` walk + `evaluate_script` reads `document.activeElement` computed style for outline/box-shadow |
278
+
279
+ ### Flakiness Detection
280
+
281
+ | Severity | Bug / Issue | Detection Method |
282
+ | --- | --- | --- |
283
+ | original | Confirmed finding — present in both crawl runs | `mergeRunResults` finds the key in both run1 and run2 (`type::message[:100]::status` scheme); original severity kept |
284
+ | 🔵 Info | Flaky finding — appeared in only one of two crawl runs | Present in run1 or run2 but not both; downgraded to `severity: 'info'`, labelled `:zap: _flaky_` in Slack digest |
285
+
286
+ ### User Flow Assertions
287
+
288
+ | Severity | Bug / Issue | Detection Method |
289
+ | --- | --- | --- |
290
+ | 🔴 Critical | Flow step failed navigate/fill/click/waitFor threw mid-flow (page state unknown) | `flow-runner.js` wraps every step; any throw emits `flow_step_failed` and halts the flow |
291
+ | 🔴 Critical | `element_visible` assert — expected selector absent within timeout | Polled via `evaluate_script` + `document.querySelector` (MCP `wait_for` doesn't reliably throw on timeout) |
292
+ | 🟡 Warning | `no_console_errors` assert — console errors recorded *during* this flow (baseline-sliced, not session-wide) | Baseline snapshot of `list_console_messages` at flow start; only messages after that offset count |
293
+ | 🟡 Warning | `no_network_errors` assert — 4xx/5xx request during this flow (baseline-sliced) | Baseline snapshot of `list_network_requests` at flow start; status ≥ 400 after offset |
294
+ | 🟡 Warning | `url_contains` assert — URL does not include expected substring after flow completes | `evaluate_script` reads `window.location.href` |
295
+ | 🟡 Warning | `element_not_visible` assert — selector unexpectedly present in DOM | `evaluate_script` `!document.querySelector(...)` |
296
+ | 🔴 Critical | `no_js_errors` assert — uncaught exceptions captured in `window.__argusErrors` during flow | Script parses the injected error buffer |
297
+
298
+ ### Environment Regressions *(dev vs staging)*
299
+
300
+ | Severity | Bug / Issue | Detection Method |
301
+ | --- | --- | --- |
302
+ | 🔴 Critical | API status regressed request that returned 2xx in dev now returns 5xx in staging | Network diff between both environments |
303
+ | 🟡 Warning | Visual change > 0.5% pixels different between dev and staging screenshots | `pixelmatch` pixel-level comparison + diff overlay image |
304
+ | 🟡 Warning | New console error in staging that doesn't exist in dev | Console message diff |
305
+ | 🟡 Warning | New network request in staging — unexpected endpoint appeared | Network request URL diff |
306
+ | 🟡 Warning | Request present in dev is missing in staging — endpoint removed or broken | Network request URL diff |
307
+ | 🟡 Warning | API status changed between environments (any non-5xx change) | Network status diff |
308
+ | 🔵 Info | DOM structural change — element count differs between dev and staging | HTML tag count comparison across snapshots |
309
+
310
+ ---
311
+
312
+ ## What It Does
313
+
314
+ Argus watches your running application and automatically surfaces issues that test suites miss: visual regressions, API loops, CSS drift, console noise, and accessibility failures — all with screenshots delivered directly to Slack.
315
+
316
+ | Feature | Description |
317
+ | --- | --- |
318
+ | **Error Detection** | Crawls your app's routes; captures JS exceptions, console errors, failed API calls, redirect chains, and broken internal links |
319
+ | **Environment Comparison** | Diffs dev vs staging: screenshots, DOM structure, network requests, console errors |
320
+ | **CSS Analysis** | Detects cascade overrides, component style leaks, unused rules, React inline style conflicts |
321
+ | **API Frequency Analysis** | Flags endpoints called more than once per page load (double-fetch, missing `useEffect` deps, infinite loops) |
322
+ | **Network Performance** | `slow_api` > 1s/3s and `large_payload` > 500KB/2MB per API call |
323
+ | **SEO Checks** | Missing meta description, OG tags, canonical, viewport, h1 — DOM-inspected on every route |
324
+ | **Security Checks** | localStorage tokens, token-in-URL, `eval()`, sensitive console output, missing CSP/X-Frame-Options |
325
+ | **Content Quality** | `null`/`undefined` rendered text, lorem ipsum, broken images, empty data lists |
326
+ | **Responsive Analysis** | Overflow + touch target checks at 375/768px; screenshot grid at 4 breakpoints dispatched to Slack |
327
+ | **Memory Leak Detection** | V8 heap snapshot detached DOM node count; heap growth across navigate-away + navigate-back |
328
+ | **Runtime Anti-Patterns** | Synchronous XHR, `document.write`, long tasks > 50ms, CORS violations, service worker registration failures, and missing cache headers on static assets detected via script injection and post-load HEAD checks |
329
+ | **Hover-State Bug Detection** | Fires `hover` on every `[aria-haspopup]` and `[data-tooltip]` element; detects broken dropdowns and invisible tooltips that CSS `:hover` was supposed to reveal |
330
+ | **Accessibility Snapshot Analysis** | Calls `take_snapshot` then `evaluate_script`; flags interactive elements missing accessible names, unlabelled form controls, duplicate landmark regions, heading level skips, and `aria-expanded` buttons with missing/broken `aria-controls` |
331
+ | **Keyboard Focus Analysis** | Tab-walks every focusable element (up to 20 steps); detects `focus_visible_missing` (button/link with `outline:0` and no `box-shadow` fallbackkeyboard users cannot see where focus is) |
332
+ | **Chrome DevTools Issues Panel** | Queries `list_console_messages({ types: ['issue'] })` for the Issues panel namespace, which is entirely separate from `console.error`; catches CSP violations and deprecated API usage (verified) additional Chrome-surfaced types (CORS blocks, mixed content, cookie misconfiguration, low-contrast) are classified when present |
333
+ | **Mobile CPU Throttling** | Applies CPU throttle (`emulate({ cpuThrottlingRate: 4 })`) during ≤768px responsive breakpoints finds layout reflow and animation jank that only manifests under realistic mobile CPU pressure |
334
+ | **Origin-Tagged Network Findings** | All network error and timing findings carry `origin: 'first-party' \| 'third-party'` so operators can triage critical first-party failures without digging through third-party CDN noise |
335
+ | **Historical Baselines** | Saves finding keys after each run; subsequent runs only alert on *new* issues; trend summary in Slack digest |
336
+ | **Flakiness Detection** | Crawls each route twice per run; findings in both runs are confirmed (original severity); findings in only one run are marked flaky (`severity: info`, `:zap: _flaky_` label) |
337
+ | **User Flow Assertions** | Named multi-step flows (`navigate/fill/click/press_key/drag/upload_file/waitFor/sleep/handle_dialog/assert`) with baseline-sliced `no_console_errors`, `no_network_errors`, `element_visible`, `url_contains`, `no_js_errors` asserts — runs end-to-end user journeys without writing Playwright specs · Use `typing: true` on a fill step to dispatch real keyboard events via `mcp.type_text` (triggers input-event validation) · Use `drag` step to fire dragstart→dragover→drop sequences · Use `upload_file` step to deliver a local file to a file input via CDP (`{ action: 'upload_file', selector: 'input[type=file]', filePath: '/path/to/file' }`) |
338
+ | **API Contract Validation** | Define `apiContracts[]` in `targets.js` with inline `schema` or `schemaFile`; validates captured response bodies against JSON Schema (type, required, properties, items)emits `api_contract_violation` warnings when shapes diverge from spec |
339
+ | **Severity Policy Overrides** | Define `severityOverrides` in `targets.js` (`{ finding_type: 'info' \| 'warning' \| 'critical' \| 'suppress' }`); applied before Slack routingremap or silence specific detections without touching analyzer code |
340
+ | **Auth Token Refresh** | `refreshSession()` is called before each route; re-runs the login flow when the saved session has less than `sessionRefreshWindowMs` (default 5 min) remaining prevents long crawls from failing mid-run when the auth cookie expires |
341
+ | **Slack-optional mode** | When `SLACK_BOT_TOKEN` is not configured, Argus skips Slack entirely and auto-generates a local `report.html` (all findings + inline screenshots) and opens it in the default browser zero setup required to start using Argus |
342
+ | **Codebase Cross-Reference** | Points `ARGUS_SOURCE_DIR` at your app source to detect: missing env vars (`process.env.X` used in code but absent from `.env`), feature flag leakage (conditional env var that is falsy/unset), console error stack traces resolved to `file:line`, and internal links that return 404 all without opening a browser |
343
+ | **GitHub PR Integration** | Posts a structured Markdown findings table as a PR comment (updates in-place — one comment per PR, no spam); sets an `argus-qa` commit status check (`failure` when new criticals exist, `success` otherwise) blocks merge via branch protection when regressions are introduced. Requires `GITHUB_TOKEN` + `GITHUB_REPOSITORY` env vars |
344
+ | **Auto Route Discovery** | Augments manual `routes[]` with paths from three sources: fetches `/sitemap.xml` (follows one sitemap-index level, 10s timeout), scans Next.js `pages/` (Next 12) and `app/` (Next 13+) directories stripping route groups `(auth)`, and greps JS/TS source for React Router `<Route path>` declarations. Dynamic `[param]` segments are skipped no concrete URL to crawl. Manual route config (`critical`, `waitFor`) always takes precedence. |
345
+ | **`argus init` Setup Wizard** | `npm run init` (or `npx argus init`) guides first-time setup: collects target URLs, detects the app framework (Next.js / React Router / unknown) from the source directory's `package.json`, runs C3 route discovery against the dev URL, prompts for optional Slack tokens and GitHub credentials, then writes a populated `.env` and a pre-filled `src/config/targets.js` zero manual config editing required. |
346
+ | **Watch Mode** | `npm run watch` attaches to whatever Chrome tab is open and polls `list_console_messages` + `list_network_requests` every 1 s (configurable via `ARGUS_WATCH_INTERVAL_MS`). Reports new console errors, network failures (4xx/5xx), CORS blocks, and auth failures in real time — without navigating. Starts a live web dashboard at `http://localhost:3002` (configurable via `ARGUS_WATCH_UI_PORT`). On `Ctrl+C`, generates a final `reports/report.html`. No route config needed. |
347
+ | **Full Lighthouse Suite** | All 4 Lighthouse categories (performance, SEO, best-practices, accessibility) with per-audit items |
348
+ | **Performance Budgets** | Enforces LCP < 2500ms, CLS < 0.1, FID < 100ms, TTFB < 800ms per route |
349
+ | **Slack Notifications** | Rich Block Kit reports with inline screenshots routed to `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` |
350
+ | **Slash Command** | `/argus-retest <url>` triggers an on-demand test from any Slack channel |
351
+ | **CI Integration** | GitHub Actions workflow runs daily at 6 AM UTC and on every push to `main` |
352
+ | **MCP Server (AI-callable Argus)** | Register Argus as an MCP server via `.mcp.json`; Claude (or any MCP client) can call `argus_audit`, `argus_audit_full`, `argus_compare`, `argus_last_report`, `argus_watch_snapshot`, `argus_get_context`, and `argus_design_audit` directly from a conversation — no CLI, no terminal required. Published to npm as **[argusqa-os](https://www.npmjs.com/package/argusqa-os)** — add via `{ "command": "npx", "args": ["-y", "argusqa-os"] }` in `.mcp.json` |
353
+ | **Figma Design Fidelity** | `argus_design_audit(url, figmaFrameUrl)` compares every extracted Figma property — 13 mismatch finding types: CSS token values, component presence, per-node fill/text color (RGB distance), typography (fontSize/fontWeight/lineHeight/fontFamily/letterSpacing), Auto Layout padding and gap, border-radius (per-corner), bounding-box overflow, **absolute position drift** (scroll-corrected x/y vs Figma bounds, 20px), border stroke (color+weight), box-shadow (offset+blur+**spread**+**color**), opacity, and text content. Selector fallback: tries `[data-testid]`, `[aria-label]`, `#id`, `.class` per node. Requires `FIGMA_API_TOKEN` env var. |
354
+ | **Visual Regression** | Per-route screenshot baseline comparison using pixelmatch. First run saves the baseline PNG; subsequent runs emit (warning ≥0.1% / critical ≥5% pixels changed) + . Baselines stored in . |
355
+ | **Core Web Vitals & Bundle Size** | Per-run LCP, CLS, FCP, TTI (domInteractive), and TTFB captured directly via browser Performance API — works in **headless Chrome** without Lighthouse. Bundle size regression: `perf_bundle_large` fires when JS ≥ 500 KB (warning) / ≥ 2 MB (critical) or CSS ≥ 150 KB. `perf_vitals_summary` always emitted with all metric values. No external dependencies — pure Performance API. |
356
+
357
+ Works with **React + SCSS**, CSS Modules, CSS-in-JS (styled-components / emotion), and plain HTML/CSS apps.
358
+
359
+ ---
360
+
361
+ ## How It Works
362
+
363
+ Three components run against the same Chrome instance:
364
+
365
+ ```text
366
+ Claude Code (Terminal / VS Code)
367
+ ├── MCP Protocol → Chrome DevTools MCP Server Chrome
368
+ └── Writes Orchestration Layer Slack Bot API
369
+ ```
370
+
371
+ - **Chrome DevTools MCP Server** programmatic access to Chrome: network traffic, console, screenshots, DOM, performance traces
372
+ - **Claude Code** — orchestration hub: reads codebase, drives the MCP tools, classifies findings, posts to Slack
373
+ - **Slack Bot (BugBot)** — receives reports, exposes `/argus-retest` slash command, handles Acknowledge / Retest button actions
374
+
375
+ In interactive mode (running from Claude Code), MCP tools are called natively. In CI mode (GitHub Actions), `src/utils/mcp-client.js` spawns `chrome-devtools-mcp` as a child process and communicates via JSON-RPC over stdio.
376
+
377
+ ---
378
+
379
+ ## Prerequisites
380
+
381
+ | Requirement | Version | Notes |
382
+ | --- | --- | --- |
383
+ | Node.js | v20.19+ | Required by Chrome DevTools MCP |
384
+ | Chrome | Stable (current) | Must be installed |
385
+ | Claude Code | Latest | `npm install -g @anthropic-ai/claude-code` |
386
+ | Slack workspace | — | **Optional** — only needed if you want Slack reports. Without it, Argus generates a local `report.html` instead |
387
+
388
+ ---
389
+
390
+ ## One-Time Setup
391
+
392
+ ### Option A MCP Server (Claude Code / any MCP client)
393
+
394
+ No local install required. `npx` auto-downloads `argusqa-os` on first use.
395
+
396
+ #### 1. Register both MCP servers
397
+
398
+ Add to `.mcp.json` in your project root:
399
+
400
+ ```json
401
+ {
402
+ "mcpServers": {
403
+ "chrome-devtools": {
404
+ "command": "npx",
405
+ "args": ["-y", "chrome-devtools-mcp@latest"]
406
+ },
407
+ "argus": {
408
+ "command": "npx",
409
+ "args": ["-y", "argusqa-os"]
410
+ }
411
+ }
412
+ }
413
+ ```
414
+
415
+ Or via Claude Code CLI:
416
+
417
+ ```bash
418
+ claude mcp add chrome-devtools -- npx -y chrome-devtools-mcp@latest
419
+ claude mcp add argus -- npx -y argusqa-os
420
+ ```
421
+
422
+ #### 2. Environment variables
423
+
424
+ Create a `.env` file in your project root:
425
+
426
+ ```env
427
+ TARGET_DEV_URL=http://localhost:3000
428
+ TARGET_STAGING_URL=https://staging.example.com # optional — enables argus_compare
429
+ ```
430
+
431
+ #### 3. Start Chrome with remote debugging
432
+
433
+ ```bash
434
+ # macOS
435
+ open -a "Google Chrome" --args --remote-debugging-port=9222 --headless=new
436
+
437
+ # Windows (PowerShell)
438
+ & "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"
439
+
440
+ # Linux
441
+ google-chrome --remote-debugging-port=9222 --headless=new --no-sandbox
442
+ ```
443
+
444
+ #### 4. Slack notifications (optional)
445
+
446
+ > Skip to use local `report.html` mode Argus generates a self-contained HTML report when Slack is not configured.
447
+
448
+ 1. [api.slack.com/apps](https://api.slack.com/apps) → **Create New App** → name it **BugBot**
449
+ 2. **OAuth & Permissions** → Bot Token Scopes: `chat:write`, `files:write`, `files:read`
450
+ 3. Install to workspace → copy **Bot User OAuth Token** (`xoxb-...`) to `.env` as `SLACK_BOT_TOKEN`
451
+ 4. Create `#bugs-critical`, `#bugs-warnings`, `#bugs-digest` and `/invite @BugBot` in each
452
+
453
+ ```env
454
+ SLACK_BOT_TOKEN=xoxb-...
455
+ SLACK_CHANNEL_CRITICAL=C0000000000
456
+ SLACK_CHANNEL_WARNINGS=C0000000001
457
+ SLACK_CHANNEL_DIGEST=C0000000002
458
+ ```
459
+
460
+ ---
461
+
462
+ ### Option B — npm Package (dev dependency / CI/CD)
463
+
464
+ #### 1. Install
465
+
466
+ ```bash
467
+ npm install --save-dev argusqa-os
468
+ ```
469
+
470
+ #### 2. Environment variables
471
+
472
+ Run the interactive wizard to auto-generate `.env` and `src/config/targets.js`:
473
+
474
+ ```bash
475
+ npx argus
476
+ ```
477
+
478
+ The wizard detects your framework (Next.js / React Router), discovers routes from `sitemap.xml` and your file structure, and optionally collects Slack and GitHub credentials.
479
+
480
+ **Alternative manual setup:** Create a `.env` with `TARGET_DEV_URL` and optionally `TARGET_STAGING_URL`.
481
+
482
+ #### 3. Start Chrome with remote debugging
483
+
484
+ Same as Option A — see above.
485
+
486
+ #### 4. Slack notifications (optional)
487
+
488
+ Same as Option Asee above.
489
+
490
+ ---
491
+
492
+ ### Option C — Clone the Repository (full source / contributors)
493
+
494
+ #### 1. Clone and install
495
+
496
+ ```bash
497
+ git clone https://github.com/ironclawdevs27/Argus.git
498
+ cd Argus
499
+ npm install
500
+ npm run setup # creates reports/ directory
501
+ ```
502
+
503
+ #### 2. Environment variables
504
+
505
+ **Recommended — use the interactive setup wizard:**
506
+
507
+ ```bash
508
+ npm run init
509
+ ```
510
+
511
+ **Alternative — manual setup:**
512
+
513
+ ```bash
514
+ cp .env.example .env
515
+ ```
516
+
517
+ Open `.env` and fill in:
518
+
519
+ ```env
520
+ TARGET_DEV_URL=http://localhost:3000
521
+ TARGET_STAGING_URL=https://staging.example.com # leave blank → CSS-only analysis mode
522
+
523
+ # Slack — OPTIONAL. Omit to get a local report.html instead.
524
+ # SLACK_BOT_TOKEN=xoxb-...
525
+ # SLACK_SIGNING_SECRET=...
526
+ # SLACK_CHANNEL_CRITICAL=C0000000000
527
+ # SLACK_CHANNEL_WARNINGS=C0000000001
528
+ # SLACK_CHANNEL_DIGEST=C0000000002
529
+ ```
530
+
531
+ #### 3. Configure routes
532
+
533
+ If you ran `npm run init` — skip this step.
534
+
535
+ Otherwise, edit [src/config/targets.js](src/config/targets.js):
536
+
537
+ ```js
538
+ export const routes = [
539
+ { path: '/', name: 'Home', critical: true, waitFor: 'main' },
540
+ { path: '/login', name: 'Login', critical: true, waitFor: 'form' },
541
+ { path: '/dashboard', name: 'Dashboard', critical: true, waitFor: '[data-testid="dashboard"]' },
542
+ { path: '/settings', name: 'Settings', critical: false, waitFor: null },
543
+ ];
544
+ ```
545
+
546
+ - `critical: true` — errors on this route go to `#bugs-critical`
547
+ - `waitFor` — CSS selector Argus waits for before capturing (signals the page is ready)
548
+
549
+ #### 4. Connect Chrome DevTools MCP to Claude Code
550
+
551
+ ```bash
552
+ claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
553
+ ```
554
+
555
+ Verify ask Claude: *"List all open Chrome pages"* you should see your tabs.
556
+
557
+ #### 5. Start Chrome with remote debugging
558
+
559
+ Same as Option A — see above.
560
+
561
+ #### 6. Slack notifications (optional)
562
+
563
+ Same as Option A — see above.
564
+
565
+ ---
566
+
567
+ ## Running Argus
568
+
569
+ ### Option A — Via MCP (Claude Code / any MCP client)
570
+
571
+ Ask Claude directly no terminal needed.
572
+
573
+ **Available tools:**
574
+
575
+ | Tool | What it does |
576
+ | --- | --- |
577
+ | `argus_audit` | Fast QA pass JS errors, network failures, accessibility, SEO, security, CSS, content |
578
+ | `argus_audit_full` | Deep QA pass adds Lighthouse, responsive layout checks across 4 viewports, memory leak detection, hover-state bug detection, and accessibility tree snapshot |
579
+ | `argus_compare` | Diff dev vs staging — screenshots, findings delta, environment regressions |
580
+ | `argus_last_report` | Return the last saved JSON report without re-running a scan |
581
+ | `argus_watch_snapshot` | Snapshot the currently open Chrome tab without navigating — raw console + network capture |
582
+ | `argus_get_context` | Capture everything broken on the open tab, formatted as a diagnostic context for Claude to diagnose and suggest fixes |
583
+ | `argus_design_audit` | Figma design-to-implementation fidelity audit — 13 finding types across color, typography, spacing, per-corner radius, position drift, stroke, shadow (color+spread), opacity, gap, and text content |
584
+
585
+ **`argus_audit`** — fast audit of any URL:
586
+
587
+ ```text
588
+ Run argus_audit on http://localhost:3000/checkout
589
+ Run argus_audit on http://localhost:3000/login with critical: true
590
+ ```
591
+
592
+ **`argus_audit_full`** — deep audit with Lighthouse + memory + responsive checks:
593
+
594
+ ```text
595
+ Run argus_audit_full on http://localhost:3000/dashboard
596
+ ```
597
+
598
+ **`argus_compare`** — dev vs staging diff (reads `TARGET_DEV_URL` and `TARGET_STAGING_URL` from `.env`):
599
+
600
+ ```text
601
+ Run argus_compare
602
+ ```
603
+
604
+ **`argus_last_report`** — retrieve last audit without re-running Chrome:
605
+
606
+ ```text
607
+ Run argus_last_report
608
+ ```
609
+
610
+ **`argus_watch_snapshot`** — snapshot the currently open tab without navigating. Useful when the page is in an authenticated or post-interaction state that navigation would reset:
611
+
612
+ ```text
613
+ Run argus_watch_snapshot
614
+ Run argus_watch_snapshot with url: http://localhost:3000
615
+ ```
616
+
617
+ **`argus_get_context`** — when your app is stuck or throwing errors, run this to capture everything that's broken and feed it to Claude for diagnosis:
618
+
619
+ ```text
620
+ Run argus_get_context
621
+ ```
622
+
623
+ Then follow with: *"Here's the context — what's causing these errors and how do I fix them?"*
624
+
625
+ ---
626
+
627
+ ### Option B & C — Via CLI / npm scripts
628
+
629
+ **Available commands:**
630
+
631
+ | Command | What it does |
632
+ | --- | --- |
633
+ | `npm run crawl` | Multi-page batch audit of all routes in `targets.js` |
634
+ | `npm run compare` | Dev vs staging diff (or CSS analysis if no `TARGET_STAGING_URL`) |
635
+ | `npm run watch` | Passive monitor polls the open Chrome tab every 1s, no navigation |
636
+ | `npm run report:html` | Generate `reports/report.html` from the latest JSON audit |
637
+ | `npm run server` | Start the Slack slash command + interaction server (port 3001) |
638
+ | `npm run init` | Interactive setup wizard — generates `.env` + `targets.js` |
639
+ | `npm run test:unit` | Run 61 unit tests (no Chrome required) |
640
+ | `npm run test:harness` | Run 129-block correctness harness (requires Chrome) |
641
+
642
+ **`npm run crawl`** — full audit of all configured routes:
643
+
644
+ ```bash
645
+ npm run crawl
646
+ ```
647
+
648
+ Reports are saved to `reports/` as JSON files. Run `npm run report:html` after any crawl for a portable `reports/report.html` with all screenshots inlined — useful for sharing with designers or reviewing offline.
649
+
650
+ **`npm run compare`** — dev vs staging diff:
651
+
652
+ ```bash
653
+ npm run compare
654
+ ```
655
+
656
+ When `TARGET_STAGING_URL` is not set, automatically switches to **CSS analysis mode** — cascade overrides, component style leaks, unused rules, and React inline style conflicts on the dev environment only.
657
+
658
+ **`npm run watch`** — passive monitoring (polls every 1s, no navigation):
659
+
660
+ Attaches to whatever Chrome tab is open and reports new issues in real time without navigating anywhere. Use this while developing.
661
+
662
+ ```text
663
+ Requires 2 terminals:
664
+ Terminal 1 your app (npm start / npm run dev)
665
+ Terminal 2 npm run watch
666
+ ```
667
+
668
+ Steps:
669
+ 1. Open Chrome and navigate to your app
670
+ 2. Terminal 1: start your application
671
+ 3. Terminal 2: `npm run watch` — Argus begins polling
672
+ 4. Develop normally — console errors, network failures (4xx/5xx), CORS blocks, and auth failures print in real time
673
+ 5. `Ctrl+C` — stops the monitor and writes `reports/report.html`
674
+
675
+ ```bash
676
+ # Attribute findings to a specific URL:
677
+ npm run watch http://localhost:4000
678
+ ```
679
+
680
+ | Variable | Default | Description |
681
+ | --- | --- | --- |
682
+ | `ARGUS_WATCH_INTERVAL_MS` | `1000` | Poll interval in milliseconds |
683
+ | `TARGET_DEV_URL` | `http://localhost:3000` | URL attributed to findings when none passed |
684
+
685
+ **`npm run report:html`** — generate HTML dashboard from last audit:
686
+
687
+ ```bash
688
+ npm run report:html
689
+ # reports/report.html (all findings + inline screenshots, portable, no server needed)
690
+ ```
691
+
692
+ ---
693
+
694
+ ### Option D — From Slack (on-demand)
695
+
696
+ ```text
697
+ /argus-retest https://staging.example.com/checkout
698
+ ```
699
+
700
+ BugBot responds immediately, runs the test, and posts results back. Detailed bug reports go to `#bugs-critical`. See [Slack Slash Command Setup](#slack-slash-command-setup) for configuration.
701
+
702
+ ---
703
+
704
+ ## CSS Analysis Mode
705
+
706
+ When `TARGET_STAGING_URL` is not set in `.env`, `npm run compare` automatically switches to **CSS analysis mode** instead of comparing two environments.
707
+
708
+ **What it analyzes on your dev environment:**
709
+
710
+ | Check | What it catches |
711
+ | --- | --- |
712
+ | **Cascade overrides** | Same CSS property declared multiple times on an element; `!important` flagged as warning |
713
+ | **Component style leaks** | BEM selector (`.card__title`) found in a stylesheet that doesn't belong to that component |
714
+ | **Unused rules** | CSS selectors that match no element on the current page |
715
+ | **CSS Modules** | Detects hashed class names; extracts readable component names (`Button`, `Card`, etc.) |
716
+ | **React inline style conflicts** | `style=""` attribute overriding a stylesheet declaration on the same element |
717
+ | **SCSS source maps** | Traces compiled CSS back to original `.scss` files where source maps are available |
718
+
719
+ **API frequency analysis** also runs automatically:
720
+
721
+ | Call count | Severity | Likely cause |
722
+ | --- | --- | --- |
723
+ | 2 calls | info | Possible prefetch + actual — verify intentional |
724
+ | 3–4 calls | warning | Double-fetch — check `useEffect` deps or component re-mounts |
725
+ | 5+ calls | critical | Runaway loop — missing cleanup, infinite re-render |
726
+
727
+ ---
728
+
729
+ ## Performance Budgets
730
+
731
+ Argus enforces these thresholds on every crawl:
732
+
733
+ | Metric | Threshold | Severity |
734
+ | --- | --- | --- |
735
+ | LCP (Largest Contentful Paint) | < 2500ms | warning |
736
+ | CLS (Cumulative Layout Shift) | < 0.1 | warning |
737
+ | FID / TBT (interaction latency) | < 100ms | warning |
738
+ | TTFB (Time to First Byte) | < 800ms | warning |
739
+
740
+ Violations are reported as individual warning bugs with the measured value.
741
+
742
+ ---
743
+
744
+ ## Lighthouse Suite
745
+
746
+ Runs all four Lighthouse categories on every route:
747
+
748
+ - **Accessibility** score < 50 `critical`; score < 90 `warning`
749
+ - **Performance** — score < 90 → `warning`
750
+ - **SEO** — score < 90 → `warning`
751
+ - **Best Practices** — score < 90 → `warning`
752
+
753
+ Individual failing audit items (e.g., missing alt text, low contrast, render-blocking resources) are surfaced as separate findings alongside the category score.
754
+
755
+ ---
756
+
757
+ ## Slack Channel Routing
758
+
759
+ > **Slack is optional.** When `SLACK_BOT_TOKEN` is not set, Argus skips Slack entirely and
760
+ > auto-generates a local `report.html` (all findings + inline screenshots) and opens it in
761
+ > the default browser. No Slack setup needed to start using Argus.
762
+
763
+ When Slack **is** configured, findings are routed by severity:
764
+
765
+ | Severity | Channel | When |
766
+ | --- | --- | --- |
767
+ | `critical` | `#bugs-critical` | JS exceptions, HTTP 5xx, blank page, auth failure, API called 5+ times, Lighthouse accessibility < 50, auth token in storage/URL, responsive overflow, slow API > 3s, payload > 2MB, > 100 detached DOM nodes, CORS policy violations, `debugger;` statements in production code, blocked mixed content (HTTP resource on HTTPS page) |
768
+ | `warning` | `#bugs-warnings` | Visual regression > 0.5%, HTTP 4xx, CSS overrides with `!important`, API called 3–4×, Lighthouse scores < 90, missing SEO/OG tags, missing security headers, placeholder content, touch targets too small, slow API > 1s, payload > 500KB, > 10 detached DOM nodes, redirect chains > 2 hops, broken links, sync XHR, `document.write`, long tasks > 50ms, SW registration failures, duplicate `id` attributes, passive mixed content (images/audio on HTTPS page) |
769
+ | `info` | `#bugs-digest` | Console warnings, unused CSS rules, API summaries, CSS Modules detection, empty data lists, responsive screenshot grid, missing cache headers on static assets |
770
+
771
+ Each message includes:
772
+
773
+ - Severity badge + affected URL + timestamp
774
+ - AI-generated description
775
+ - Inline screenshot (uploaded directly to Slack no external hosting)
776
+ - **View Page**, **Acknowledge**, and **Retest** action buttons
777
+
778
+ ---
779
+
780
+ ## Slack Slash Command Setup
781
+
782
+ To use `/argus-retest` from Slack, you need to expose the Argus server publicly.
783
+
784
+ ### Step 1 — Start the server
785
+
786
+ ```bash
787
+ npm run server
788
+ ```
789
+
790
+ Server runs on port 3001.
791
+
792
+ ### Step 2 — Expose with Cloudflare Tunnel
793
+
794
+ Download [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) (free, no account needed), then:
795
+
796
+ ```bash
797
+ cloudflared tunnel --url http://localhost:3001
798
+ ```
799
+
800
+ Alternatively, with no install at all (SSH tunnel):
801
+
802
+ ```bash
803
+ ssh -R 80:localhost:3001 nokey@localhost.run
804
+ ```
805
+
806
+ Copy the public HTTPS URL that appears.
807
+
808
+ ### Step 3 Configure Slack App
809
+
810
+ 1. [api.slack.com/apps](https://api.slack.com/apps) → BugBot → **Slash Commands** → Create New Command:
811
+ - Command: `/argus-retest`
812
+ - Request URL: `https://your-public-url/slack/commands`
813
+ - Description: `Run Argus regression test on a URL`
814
+ - Usage hint: `<url>`
815
+
816
+ 2. **Interactivity & Shortcuts** → Enable → Request URL: `https://your-public-url/slack/interactions`
817
+
818
+ 3. **OAuth & Permissions** → **Reinstall to Workspace**
819
+
820
+ ### Step 4 — Test
821
+
822
+ ```text
823
+ /argus-retest http://localhost:3000
824
+ ```
825
+
826
+ BugBot should reply within 3 seconds with a "running" acknowledgement, then post results.
827
+
828
+ ---
829
+
830
+ ## GitHub Actions CI Setup
831
+
832
+ ### Add secrets to your repository
833
+
834
+ Go to GitHub repo **Settings****Secrets and variables** **Actions** add:
835
+
836
+ | Secret name | Required | Value |
837
+ | --- | --- | --- |
838
+ | `SLACK_BOT_TOKEN` | No | Your `xoxb-...` token. **Omit entirely to use Slack-optional mode** — Argus generates `report.html` instead |
839
+ | `SLACK_SIGNING_SECRET` | No* | From Slack App Basic Information (only needed for `/argus-retest` slash command) |
840
+ | `SLACK_CHANNEL_CRITICAL` | No* | Channel ID (required when Slack is configured) |
841
+ | `SLACK_CHANNEL_WARNINGS` | No* | Channel ID (required when Slack is configured) |
842
+ | `SLACK_CHANNEL_DIGEST` | No* | Channel ID (required when Slack is configured) |
843
+ | `TARGET_STAGING_URL` | Yes | Your staging base URL |
844
+ | `GITHUB_TOKEN` | No | For C2 PR integration — auto-injected by GitHub Actions as `secrets.GITHUB_TOKEN` |
845
+ | `GITHUB_REPOSITORY` | No | For C2 PR integration — `owner/repo` format (e.g., `acme/my-app`) |
846
+
847
+ > **C2 PR integration**: when `GITHUB_TOKEN` and `GITHUB_REPOSITORY` are set, Argus posts a PR comment and commit status check for every crawl. `GITHUB_PR_NUMBER` is injected automatically by the workflow from `github.event.pull_request.number`. The included workflow does not wire these up by default — add them to the `env:` block in `.github/workflows/argus.yml` if you want PR-level comments.
848
+
849
+ The workflow at [.github/workflows/argus.yml](.github/workflows/argus.yml) runs:
850
+
851
+ - On every push to `main` / `master`
852
+ - Daily at 6 AM UTC (before the team starts work)
853
+ - Manually via **Actions** → **Run workflow** (with optional URL override)
854
+
855
+ If critical issues are found, the pipeline **fails** — preventing silent regressions from being missed.
856
+
857
+ ---
858
+
859
+ ## Project Structure
860
+
861
+ ```text
862
+ argus/
863
+ ├── .env # Your secrets (never commit this)
864
+ ├── .env.example # Template copy to .env
865
+ ├── .gitignore
866
+ ├── package.json
867
+ ├── README.md
868
+ ├── .claude/
869
+ │ └── settings.json # Claude Code permission config (auto-approve node/npm/reports)
870
+ ├── .github/
871
+ │ └── workflows/
872
+ └── argus.yml # CI pipeline
873
+ ├── .vscode/
874
+ └── mcp.json # Chrome DevTools MCP config for VS Code
875
+ ├── .mcp.json # Argus MCP server registration — exposes all 7 tools to Claude: argus_audit/argus_audit_full/argus_compare/argus_last_report/argus_watch_snapshot/argus_get_context/argus_design_audit
876
+ ├── src/
877
+ │ ├── argus.js # Single-page audit entry point
878
+ ├── batch-runner.js # Multi-page batch audit
879
+ │ ├── mcp-server.js # Argus MCP serverargus_audit / argus_audit_full / argus_compare / argus_last_report / argus_watch_snapshot / argus_get_context / argus_design_audit
880
+ │ ├── adapters/
881
+ │ │ └── browser.js # CdpBrowserAdapter facade over all chrome-devtools-mcp calls
882
+ ├── domain/
883
+ │ └── finding.js # createFinding() factory — canonical finding shape
884
+ │ ├── registry.js # Analyzer plugin registry registerCheap/registerExpensive/getCheap/getExpensive/clearAll
885
+ │ ├── config/
886
+ │ │ ├── targets.js # Routes to test, thresholds, config
887
+ │ │ └── schema.js # Zod validation schema; validateConfig() called inside runCrawl()
888
+ │ ├── orchestration/
889
+ │ │ ├── crawl-and-report.js # Backward-compat re-export shell orchestrator + report-processor + dispatcher
890
+ │ │ ├── orchestrator.js # Crawl loop, route/flow crawl, runCrawl()
891
+ ├── report-processor.js # Dedup → severity overrides → baseline → JSON write
892
+ │ │ ├── dispatcher.js # Slack / GitHub / HTML dispatch
893
+ │ │ ├── env-comparison.js # Dev vs staging diff + CSS analysis mode
894
+ │ │ ├── watch-mode.js # Passive browser monitoring (WatchSession + runWatchMode)
895
+ │ └── slack-notifier.js # Slack Block Kit dispatcher
896
+ │ ├── server/
897
+ │ │ ├── index.js # Express server (port 3001)
898
+ │ │ ├── slash-command-handler.js # /argus-retest handler
899
+ │ │ └── interaction-handler.js # Acknowledge + Retest button handler
900
+ │ ├── utils/
901
+ │ │ ├── css-analyzer.js # CSS analysis script injected into the browser
902
+ │ │ ├── seo-analyzer.js # SEO checks: meta, OG tags, h1, canonical, viewport
903
+ │ │ ├── security-analyzer.js # Security: localStorage tokens, eval(), headers, cookies
904
+ │ │ ├── content-analyzer.js # Content quality: null text, placeholders, broken images
905
+ │ │ ├── responsive-analyzer.js # Responsive: overflow + touch targets at 4 breakpoints
906
+ │ │ ├── memory-analyzer.js # Memory leaks: V8 heap snapshot + heap growth
907
+ │ │ ├── logger.js # Pino structured logger — childLogger(module)│ │ ├── retry.js # withRetry() exponential backoff — navigate/fill only; Number.isFinite guard│ │ ├── telemetry.js # OTel tracing + metrics — startSpan() / recordFinding() / recordFlaky() / recordNewFindings(); no-op default│ │ ├── session-manager.js # Auth: backward-compat re-export barrel│ │ ├── session-persistence.js # Auth: saveSession (mkdirSync+atomic write), restoreSession, hasSession, clearSession│ │ ├── login-orchestrator.js # Auth: runLoginFlow, refreshSession + lock file│ │ ├── baseline-manager.js # Baselines: loadBaseline, saveBaseline, applyBaseline, appendTrend
908
+ │ │ ├── flakiness-detector.js # Flakiness: mergeRunResults confirmed vs flaky per double-crawl
909
+ │ │ ├── flow-runner.js # User flow assertions: runFlow / runAllFlows — assert DSL
910
+ │ │ ├── html-reporter.js # HTML dashboard: generateHtmlReport() + npm run report:html (D7.1 / D7.7)
911
+ │ │ ├── parallel-crawler.js # chunkArray sharding utility (ARGUS_CONCURRENCY=N parallel crawl)
912
+ │ │ ├── contract-validator.js # API contract validation: validateSchema, matchesContract (D7.4)
913
+ │ │ ├── severity-overrides.js # Severity policy overrides: applyOverrides (D7.5)
914
+ │ │ ├── slack-guard.js # Slack-optional guard: isSlackConfigured() (D7.7)
915
+ │ │ ├── hover-analyzer.js # Hover-state bug detection aria-haspopup + data-tooltip (D8.1)
916
+ │ │ ├── snapshot-analyzer.js # Accessibility tree snapshot missing names, labels, landmarks, heading hierarchy, ARIA state (D8.2 + v6)
917
+ │ │ ├── issues-analyzer.js # Chrome DevTools Issues panel CSP/deprecated/cookie issues
918
+ │ │ ├── network-timing-analyzer.js # HAR timing analysis slow third-party detection
919
+ │ │ ├── keyboard-analyzer.js # Keyboard Tab-walk focus_visible_missing, focus_lost
920
+ │ │ ├── theme-analyzer.js # A7: Theme & Dark Mode detection — emulateColorScheme, prefers-color-scheme mismatches
921
+ │ ├── design-fidelity-analyzer.js # D9: Figma design token vs DOM comparison — 13 mismatch finding types
922
+ │ ├── web-vitals-analyzer.js # Sprint 9: LCP/CLS/FCP/TTI/TTFB via Performance API + bundle size regression
923
+ │ │ ├── visual-diff-analyzer.js # A8: Visual regression baseline comparison (pixelmatch)
924
+ │ ├── codebase-analyzer.js # Codebase cross-referenceenv vars, feature flags, dead routes (C1)
925
+ ├── github-reporter.js # GitHub PR comment + commit status integration (C2)
926
+ ├── route-discoverer.js # Auto route discovery — sitemap + Next.js + React Router (C3)
927
+ ├── diff.js # pixelmatch screenshot + DOM/network diff utilities
928
+ ├── mcp-parsers.js # Text-format parsers for list_console_messages + list_network_requests (v9)
929
+ │ └── mcp-client.js # Headless JSON-RPC MCP client for CI mode
930
+ └── cli/
931
+ │ └── init.js # argus init setup wizard detect framework, discover routes, write .env + targets.js (C4)
932
+ ├── test/
933
+ └── unit/ # Vitest unit tests no Chrome required
934
+ ├── finding.test.js # createFinding() fields, throws, frozen, extra fields (8 tests)
935
+ ├── config-schema.test.js # validateConfig() + ConfigSchema.safeParse (8 tests)
936
+ ├── report-processor.test.js # deduplicateFindings + rebuildSummary (11 tests)
937
+ ├── flakiness-detector.test.js # findingKey normalization + mergeRunResults (13 tests)
938
+ ├── baseline-manager.test.js # loadBaseline/saveBaseline/applyBaseline (9 tests)
939
+ └── flow-runner.test.js # normalizeArray (pure) + runFlow mock browser (11 tests)
940
+ ├── landing/ # Product landing page (React 19 + Vite 8 + Tailwind + Framer Motion 12)
941
+ │ ├── src/
942
+ ├── App.jsx # Single-page app — hero, features, comparison, waitlist + enterprise modals
943
+ │ └── supabase.js # Supabase client factory (null-safe when env vars missing)
944
+ ├── public/
945
+ │ │ ├── favicon.svg # SVG favicon — purple ring + dot
946
+ │ ├── argus-poster.png # Video poster fallback (1918×1078)
947
+ │ │ ├── og-image-v2.jpg # OG social card 1200×630 JPEG, branded overlay, black-outlined stat numbers
948
+ ├── robots.txt # Allows all crawlers; Sitemap reference
949
+ │ └── sitemap.xml # Canonical URL for argus-qa.com/
950
+ │ ├── index.html # Vite entry; OG/Twitter/JSON-LD SEO tags; canonical; favicon
951
+ │ ├── package.json
952
+ │ ├── .env.example # VITE_SUPABASE_URL + VITE_SUPABASE_ANON_KEY template
953
+ └── README.md # Setup guide, Supabase SQL schema, env vars, deployment
954
+ ├── scripts/
955
+ │ └── dispatch-report.js # Standalone Slack re-dispatch script (re-posts last report.json to Slack)
956
+ ├── test-harness/ # Fixture server + test runner (129 blocks, 581 hard assertions, 57 fixture pages)
957
+ │ ├── README.md
958
+ ├── server.js # Express fixture server (ports 3100 dev / 3101 staging)
959
+ │ ├── harness-config.js # Route definitions + expected findings
960
+ ├── validate.js # Test runner 130 numbered blocks ([80]–[84] MCP/createFinding/withRetry/watch/init, [85]–[93] Sprint 0.5 Tier 3, [94]–[126] gap-close, [127] A7 theme, [128] D9 design fidelity, [129] Sprint 9 Web Vitals, [130] A8 Visual Regression)
961
+ │ ├── pages/ # 56 fixture HTML pages (one per detection category)
962
+ │ ├── nextjs-fixture/ # Next.js app structure for C3 discovery tests (10 files)
963
+ │ ├── source-fixture/ # Minimal app.js for C1 codebase-analyzer tests (env var audit)
964
+ │ └── static/
965
+ │ └── button-styles.css # BEM card selectors in button file → component leak
966
+ └── reports/ # Output: JSON reports + screenshots (gitignored)
967
+ ├── baselines/
968
+ │ ├── <branch>.json # Per-route finding keys per git branch (D7.2)
969
+ │ └── <branch>-trends.json # Append-only run history per branch (D7.2)
970
+ └── .gitkeep
971
+ ```
972
+
973
+ ---
974
+
975
+ ## Key Technical Decisions
976
+
977
+ | Decision | Choice | Reason |
978
+ | --- | --- | --- |
979
+ | Screenshot comparison | pixelmatch + AI classification | pixelmatch is fast and deterministic; Claude removes false positives from anti-aliasing and dynamic content |
980
+ | Slack API | Bot API, not Incoming Webhooks | Bot API supports file uploads, message updates, interactive buttons, and threads |
981
+ | File uploads | `files.getUploadURLExternal` + PUT + `files.completeUploadExternal` | `files.upload` is deprecated; pre-signed URL requires PUT POST silently produces broken files |
982
+ | CSS analysis | Script injected via `evaluate_script` | Runs in page context so it sees the live computed styles, CSS Modules hashes, and React fiber properties |
983
+ | Responsive viewport | `emulate` (not `resize_page`) | `resize_page` only resizes the browser window and does not update CSS viewport width — `emulate` is the correct API |
984
+ | Viewport width measurement | `document.documentElement.clientWidth` | After `emulate` with mobile flag, `window.innerWidth` returns the legacy layout viewport (~952px), not the device width |
985
+ | V8 heap snapshot | `take_heapsnapshot({ filePath })` read from disk | The MCP tool writes JSON to disk (not inline); parse with `JSON.parse(fs.readFileSync(filePath))` then delete the temp file |
986
+ | Detached DOM detection | Walk flat `nodes` array for "Detached " prefix in strings table | Chrome serializes detached elements as "Detached HTMLDivElement" etc.; secondary check on `detachedness === 2` (Chrome 90+) |
987
+ | Baseline finding key | `type::message[:100]::status` | Excludes timestamps and dynamic URL path IDs; message truncated to 100 chars to handle slight wording variations; `::status` suffix only added when non-null |
988
+ | Baseline alert filter | `isNew === true` (strict) | Only findings explicitly marked new by `applyBaseline` are dispatched to Slack — prevents stale re-dispatch if baseline-manager is not called (fails silently rather than spamming) |
989
+ | Flakiness routing | `severity: 'info'` for flaky findings | Downgrading severity means existing `dispatchToSlack` routing sends them to the info digest with zero routing changes — only the `:zap: _flaky_` label needed |
990
+ | Private `findingKey` per module | Each of `baseline-manager.js` and `flakiness-detector.js` has its own copy | Avoids coupling two independently-useful modules via a shared export for a trivial 3-line function |
991
+ | Runtime anti-pattern injection | `addScriptToEvaluateOnNewDocument` via MCP | Scripts registered this way run in the new page context before any page script — intercepts `XMLHttpRequest.open`, `document.write`, and `navigator.serviceWorker.register` before the page can call them |
992
+ | CORS error detection | `list_console_messages` + text match, not in-page intercept | CORS errors are generated by the browser itself, not by page JS `console.error` patcher misses them; the MCP console log captures them |
993
+ | Long task detection | `PerformanceObserver({ entryTypes: ['longtask'] })` injected before load | Only the duration is included in the finding message (not `startTime`) — ensures identical tasks on two crawl runs produce the same dedup key |
994
+ | CI MCP client | JSON-RPC over stdio | In CI there's no Claude Code agent the headless client replaces it with the same API surface |
995
+ | Node.js | v20.19+ | Minimum required by Chrome DevTools MCP |
996
+
997
+ ---
998
+
999
+ ## Known MCP Tool Limitations
1000
+
1001
+ The Chrome DevTools MCP behavioral constraints below cause **3 permanent test failures** in the harness (`578/581` pass). These are MCP-layer restrictions they cannot be fixed in Argus code. `validate.js` now exits with code 0 when only these 3 failures remain, making the CI harness gate reliable.
1002
+
1003
+ > **`type_text` clarification**: `type_text` does fire DOM `input` events when the element is properly focused first with `mcp.click({ uid })`. Always use uid-based focus — passing `{ selector }` to `mcp.click` silently does nothing.
1004
+
1005
+ | Tool | Constraint | Impact |
1006
+ | --- | --- | --- |
1007
+ | `drag` | Uses mouse simulation, **not** HTML5 DnD API | `dragstart`/`dragover`/`drop` events never fire |
1008
+ | `list_console_messages({ types: ['issue'] })` | Issues panel returns empty even when violations exist | CSP and deprecated-API detection is unreliable |
1009
+
1010
+ These constraints are documented with workarounds in [SKILL.md §10](SKILL.md).
1011
+
1012
+ The harness passes **578/581** assertions (exits 0). The 3 failures are the permanent MCP-limited ones listed above.
1013
+
1014
+ ---
1015
+
1016
+ ## Environment Variables Reference
1017
+
1018
+ | Variable | Required | Description |
1019
+ | --- | --- | --- |
1020
+ | `SLACK_BOT_TOKEN` | No | `xoxb-...` Bot User OAuth Token. **Omit to enable Slack-optional mode** Argus generates `report.html` and opens it in the browser instead |
1021
+ | `SLACK_SIGNING_SECRET` | No* | Verifies slash command / interaction requests from Slack (required only when using `/argus-retest`) |
1022
+ | `SLACK_CHANNEL_CRITICAL` | No* | Channel ID for critical bugs (required when Slack is configured) |
1023
+ | `SLACK_CHANNEL_WARNINGS` | No* | Channel ID for warnings (required when Slack is configured) |
1024
+ | `SLACK_CHANNEL_DIGEST` | No* | Channel ID for info / daily digest (required when Slack is configured) |
1025
+ | `TARGET_DEV_URL` | Yes | Base URL of your dev environment |
1026
+ | `TARGET_STAGING_URL` | No | Base URL of staging. If blank CSS analysis mode |
1027
+ | `SCREENSHOT_DIFF_THRESHOLD` | No | Pixel diff % to flag (default: `0.5`) |
1028
+ | `REPORT_OUTPUT_DIR` | No | Where to write reports (default: `./reports`) |
1029
+ | `ARGUS_CONCURRENCY` | No | Number of parallel MCP clients for route crawling (default: `1` = sequential) |
1030
+ | `PORT` | No | Server port (default: `3001`) |
1031
+ | `ARGUS_LOG_LEVEL` | No | Pino log level `trace`, `debug`, `info`, `warn`, `error`, `fatal` (default: `info`) |
1032
+ | `ARGUS_LOG_PRETTY` | No | Set to `1` for human-readable log output instead of JSON (dev mode) |
1033
+ | `ARGUS_RETRY_ATTEMPTS` | No | Max retry attempts for `navigate`/`fill` MCP calls (default: `3`) |
1034
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | No | OTLP collector endpoint — enables span/metric export to Jaeger, Grafana Tempo, Datadog, etc. |
1035
+ | `ARGUS_OTEL_CONSOLE` | No | Set to `1` to print OTel spans to stdout without an OTLP endpoint (dev tracing) |
1036
+ | `ARGUS_WATCH_INTERVAL_MS` | No | Watch mode poll interval in milliseconds (default: `1000`) |
1037
+ | `ARGUS_WATCH_UI_PORT` | No | Watch mode web dashboard port (default: `3002`) |
1038
+ | `ARGUS_SOURCE_DIR` | No | Path to your app's source directory — enables codebase cross-reference (env var detection, feature flag leakage, dead routes) |
1039
+ | `ARGUS_ENV_FILE` | No | Path to your app's `.env` file — C1 cross-references env vars used in source code against this file to detect missing declarations |
1040
+ | `GITHUB_TOKEN` | No | GitHub personal access token — required for PR comment + commit status integration |
1041
+ | `GITHUB_REPOSITORY` | No | Repository in `owner/repo` format — required for GitHub PR integration |
1042
+ | `GITHUB_SHA` | No | Commit SHA for the commit status check — injected automatically by GitHub Actions (`${{ github.sha }}`) |
1043
+ | `GITHUB_PR_NUMBER` | No | PR number for comment targeting — set via `${{ github.event.pull_request.number }}` in your workflow |
1044
+ | `ARGUS_REPORT_URL` | No | Full URL to the hosted HTML report — linked from the GitHub commit status check |
1045
+
1046
+ ---
1047
+
1048
+ ## Troubleshooting
1049
+
1050
+ ### Chrome DevTools MCP not connecting
1051
+
1052
+ ```bash
1053
+ claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
1054
+ # Then restart Claude Code
1055
+ ```
1056
+
1057
+ ### Slack messages not posting
1058
+
1059
+ - Confirm `SLACK_BOT_TOKEN` starts with `xoxb-` (not `xoxp-`, `xoxe-`, or `xapp-`)
1060
+ - Verify BugBot is invited to each channel: `/invite @BugBot`
1061
+ - Check token scopes: `chat:write`, `files:write`, `files:read`
1062
+
1063
+ ### Screenshots not appearing in Slack messages
1064
+
1065
+ - The upload uses a pre-signed URL that requires `PUT`, not `POST` — if you see a broken image, check that the Slack token has `files:write` scope and the channel is correct
1066
+
1067
+ ### Slash command returns "dispatch_failed"
1068
+
1069
+ - Your tunnel URL has changed (Cloudflare Tunnel / localhost.run URLs change on restart)
1070
+ - Update the Request URL in Slack App → Slash Commands and reinstall
1071
+
1072
+ ### CSS analysis returns empty results
1073
+
1074
+ - Page may be behind auth — make sure you're logged in on the Chrome instance Argus is controlling
1075
+ - Cross-origin stylesheets (CDN fonts, third-party widgets) can't be read due to browser security restrictions — this is expected
1076
+
1077
+ ### Screenshots are blank
1078
+
1079
+ - Page hasn't finished loading increase `pageSettleMs` in `src/config/targets.js`
1080
+ - Add a `waitFor` selector for that route
1081
+
1082
+ ### CI pipeline fails immediately
1083
+
1084
+ - Chrome may not be starting fast enough increase the `sleep 3` after Chrome launch to `sleep 5` in `.github/workflows/argus.yml`
1085
+
1086
+ ---
1087
+
1088
+ ## How Argus Differs From Playwright / Cypress
1089
+
1090
+ Argus is not a replacement for unit or E2E tests. It's a complementary layer:
1091
+
1092
+ | | Playwright / Cypress | Argus |
1093
+ | --- | --- | --- |
1094
+ | **Tests** | Your logic and API contracts | What the user actually sees |
1095
+ | **Catches** | Regression in behaviour | CSS drift, visual regressions, API redundancy, console noise, perf budgets |
1096
+ | **Runs** | In your test suite | Continuously, on the live running app |
1097
+ | **Setup** | Write test files | Configure routes in `targets.js` |
1098
+ | **Output** | Pass / fail | Structured Slack reports with screenshots and action buttons |
1099
+
1100
+ They complement each other — Argus catches what test suites miss.