@appfire-ux/audit-agent 0.2026.70-2.1 → 0.2026.702

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appfire-ux/audit-agent",
3
- "version": "0.2026.702.1",
3
+ "version": "0.2026.702",
4
4
  "description": "Claude Code UX audit agent for Appfire apps — installs the ux-auditor agent and /ux-audit command that audit a repo against @appfire-ux/guidelines",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -22,10 +22,6 @@
22
22
  },
23
23
  "files": [
24
24
  "bin/",
25
- "templates/",
26
- "scripts/"
27
- ],
28
- "optionalDependencies": {
29
- "playwright": "^1.47.0"
30
- }
25
+ "templates/"
26
+ ]
31
27
  }
@@ -99,20 +99,9 @@ Run each pass over the scoped source. For each pass: start with the greps below
99
99
  Attempt only if the environment allows; NEVER let this phase break the audit — on any failure, fall back to static-only and record the limitation.
100
100
 
101
101
  1. Find the dev command (`package.json` scripts: `dev`/`start`/`storybook`). Install deps if needed, start it in the background, wait for the port to answer.
102
- 2. Capture screenshots in this explicit order stop at the first that works:
103
- 1. **Browser MCP/tool available in this session** (Playwright MCP, Chrome DevTools, Claude in Chrome) → use it directly: visit the main surfaces, capture screenshots of key screens and states (save under `docs/ux-audit/assets/`), tab through primary flows to verify focus order and visible focus, trigger error/empty states where cheap to do, spot-check computed colors/contrast of flagged elements, toggle reduced-motion emulation if possible.
104
- 2. **No browser tool/MCP available** you always have Bash, so shell out to the bundled Playwright capture script instead of skipping screenshots:
105
- ```bash
106
- npx playwright install chromium # one-time, skip if already installed
107
- node node_modules/@appfire-ux/audit-agent/scripts/ux-audit-capture.mjs \
108
- --url http://localhost:5173 \
109
- --out docs/ux-audit/assets \
110
- --routes /,/dashboard/teams
111
- ```
112
- This only covers screenshots (no focus/contrast/reduced-motion checks — note that limitation in the report). If the script errors (e.g. `playwright` not installed and install fails, or every route fails), fall through to 2.3.
113
- 3. **Both unavailable** → static-only. Record the limitation explicitly in the report appendix (Phase 6) instead of silently skipping runtime checks.
114
- 3. If Storybook exists, prefer it for isolated component states (still via the MCP tool if available, otherwise the same Playwright script pointed at the Storybook URL).
115
- 4. Attach evidence: reference screenshots in findings; runtime-confirmed findings get higher confidence. Screenshots captured via the Playwright script fallback are `verified-runtime` for visual findings only — accessibility findings that need interaction (focus order, keyboard reachability) stay `suspected` unless a browser MCP tool confirmed them.
102
+ 2. If a browser tool/MCP is available in this session (Playwright, Chrome DevTools, Claude in Chrome), visit the main surfaces and: capture screenshots of key screens and states (save under `docs/ux-audit/assets/`), tab through primary flows to verify focus order and visible focus, trigger error/empty states where cheap to do, spot-check computed colors/contrast of flagged elements, toggle reduced-motion emulation if possible.
103
+ 3. If Storybook exists, prefer it for isolated component states.
104
+ 4. Attach evidence: reference screenshots in findings; runtime-confirmed findings get higher confidence.
116
105
 
117
106
  ## Phase 5 — Synthesis & scoring
118
107
 
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Playwright fallback for the ux-auditor agent's Phase 4 (runtime verification).
4
- * Used when no browser MCP/tool is available in the session — the agent always
5
- * has Bash, so it can shell out to this script instead of skipping screenshots.
6
- *
7
- * Usage:
8
- * npx playwright install chromium # once, if not already installed
9
- * node scripts/ux-audit-capture.mjs --url http://localhost:5173 \
10
- * --out docs/ux-audit/assets --routes /,/dashboard/teams
11
- *
12
- * Requires the optional "playwright" dependency (see package.json).
13
- */
14
-
15
- 'use strict';
16
-
17
- import fs from 'node:fs';
18
- import path from 'node:path';
19
-
20
- function parseArgs(argv) {
21
- const opts = { url: null, out: null, routes: ['/'] };
22
- for (let i = 0; i < argv.length; i++) {
23
- const arg = argv[i];
24
- if (arg === '--url') opts.url = argv[++i];
25
- else if (arg === '--out') opts.out = argv[++i];
26
- else if (arg === '--routes') opts.routes = argv[++i].split(',').map((r) => r.trim()).filter(Boolean);
27
- }
28
- return opts;
29
- }
30
-
31
- function routeToFilename(route) {
32
- const slug = route === '/' ? 'root' : route.replace(/^\//, '').replace(/[/?#]+/g, '-');
33
- return `${slug}.png`;
34
- }
35
-
36
- async function main() {
37
- const { url, out, routes } = parseArgs(process.argv.slice(2));
38
-
39
- if (!url || !out) {
40
- console.error('[ux-audit-capture] Usage: --url <base-url> --out <dir> [--routes /,/foo,/bar]');
41
- process.exit(1);
42
- }
43
-
44
- let chromium;
45
- try {
46
- ({ chromium } = await import('playwright'));
47
- } catch {
48
- console.error('[ux-audit-capture] "playwright" is not installed. Run: npm install -D playwright && npx playwright install chromium');
49
- process.exit(1);
50
- }
51
-
52
- fs.mkdirSync(out, { recursive: true });
53
-
54
- const browser = await chromium.launch();
55
- const page = await browser.newPage();
56
-
57
- const results = [];
58
- for (const route of routes) {
59
- const target = new URL(route, url).toString();
60
- const file = path.join(out, routeToFilename(route));
61
- try {
62
- await page.goto(target, { waitUntil: 'networkidle', timeout: 15000 });
63
- await page.screenshot({ path: file, fullPage: true });
64
- results.push({ route, file, ok: true });
65
- console.log(`[ux-audit-capture] captured ${route} -> ${file}`);
66
- } catch (err) {
67
- results.push({ route, file: null, ok: false, error: err.message });
68
- console.error(`[ux-audit-capture] failed ${route}: ${err.message}`);
69
- }
70
- }
71
-
72
- await browser.close();
73
-
74
- const failed = results.filter((r) => !r.ok);
75
- if (failed.length === results.length) {
76
- console.error('[ux-audit-capture] all routes failed — falling back to static-only is recommended.');
77
- process.exit(1);
78
- }
79
- process.exit(0);
80
- }
81
-
82
- main();