@fluentcommerce/ai-skills 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +14 -12
  2. package/bin/cli.mjs +29 -2
  3. package/content/cli/skills/fluent-connect/SKILL.md +57 -2
  4. package/content/cli/skills/fluent-profile/SKILL.md +35 -5
  5. package/content/dev/agents/fluent-backend-dev.md +2 -2
  6. package/content/dev/agents/fluent-dev.md +1 -1
  7. package/content/dev/skills/fluent-custom-code/SKILL.md +1 -1
  8. package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +5 -5
  9. package/content/dev/skills/fluent-event-api/SKILL.md +1 -1
  10. package/content/dev/skills/{fluent-source-onboard → fluent-module-convert}/SKILL.md +223 -24
  11. package/content/dev/skills/fluent-module-validate/SKILL.md +6 -6
  12. package/content/dev/skills/fluent-mystique-builder/SKILL.md +1 -1
  13. package/content/dev/skills/fluent-mystique-scaffold/SDK_REFERENCE.md +2 -2
  14. package/content/dev/skills/fluent-mystique-scaffold/SKILL.md +1 -1
  15. package/content/dev/skills/fluent-mystique-scaffold/TEMPLATES.md +1 -1
  16. package/content/dev/skills/fluent-retailer-config/SKILL.md +2 -2
  17. package/content/dev/skills/fluent-scope-plan/SKILL.md +1 -1
  18. package/content/dev/skills/fluent-transition-api/SKILL.md +1 -1
  19. package/content/dev/skills/fluent-ui-test/SKILL.md +8 -7
  20. package/content/dev/skills/fluent-workspace-tree/SKILL.md +2 -2
  21. package/content/knowledge/index.md +3 -3
  22. package/content/knowledge/platform/module-structure.md +5 -5
  23. package/content/knowledge/platform/mystique-routing.md +6 -3
  24. package/content/knowledge/platform/permissions-and-contexts.md +2 -2
  25. package/content/knowledge/platform/rule-test-patterns.md +1 -1
  26. package/docs/01-first-session.md +175 -0
  27. package/docs/02-prompt-guide.md +246 -0
  28. package/docs/03-use-cases.md +1179 -0
  29. package/docs/04-onboarding-plan.md +355 -0
  30. package/docs/05-getting-started.md +262 -0
  31. package/docs/06-dev-workflow.md +1040 -0
  32. package/docs/INDEX.md +40 -0
  33. package/docs/agents-and-skills-guide.md +199 -0
  34. package/docs/capability-map.md +165 -0
  35. package/docs/chrome-devtools-mcp-reference.md +400 -0
  36. package/docs/fluent-ai-skills-reference.md +1351 -0
  37. package/docs/manifest-safety.md +79 -0
  38. package/docs/mcp-servers.md +209 -0
  39. package/docs/workflow-reference.md +167 -0
  40. package/lib/fluent-brand.css +55 -0
  41. package/metadata.json +7 -6
  42. package/package.json +12 -3
@@ -0,0 +1,400 @@
1
+ # Chrome DevTools MCP Reference — Fluent Commerce UX Testing
2
+
3
+ > [!CAUTION]
4
+ > **🧪 EXPERIMENTAL — LABS PROJECT**
5
+ > This package is not production-ready. No stability guarantees, no support, no warranty. See [README](../README.md) for full disclaimer.
6
+
7
+ > **Version:** chrome-devtools-mcp@latest (v0.18.1+) | Last updated: 2026-03-04
8
+ >
9
+ > **Purpose:** Browser automation for Fluent Commerce UX app testing (Material UI React SPA with hash routing).
10
+
11
+ ---
12
+
13
+ ## Why Chrome DevTools MCP
14
+
15
+ Chrome DevTools MCP is the recommended browser automation for Fluent Commerce because:
16
+ - **DOM snapshots + screenshots** — deterministic element selection, no vision model needed, ~10x faster than pixel-based approaches
17
+ - **Token-optimized** — The `__fcTest` helper library (`content/dev/skills/fluent-ui-test/BROWSER_OPTIMIZATIONS.md`) replaces most `take_snapshot` calls (~30K tokens each) with `pageState()` (~150 tokens), `pageSummary()` (~500 tokens), MUI-aware finders (~50 tokens each), `diffState()` (~200 tokens for before/after), and programmatic login via `isLoggedIn()`/`loginForm()` — reducing browser interaction costs by ~90%. Login persistence via `--storage-state` eliminates re-login overhead entirely.
18
+ - **Material UI compatibility** — excellent accessibility markup means `take_snapshot` reliably finds elements
19
+ - **Hash routing support** — handles SPA routing correctly (no reload on hash change)
20
+ - **Headless mode** — CI/CD ready with `--headless`
21
+ - **Auto-configured** — installed by `npx @fluentcommerce/ai-skills install`
22
+
23
+ ### Alternatives (Not Recommended)
24
+
25
+ | Feature | Chrome DevTools MCP | Puppeteer MCP | Chrome MCP Extension |
26
+ |---------|:---:|:---:|:---:|
27
+ | Tool Count | 29 | 8 | 20+ |
28
+ | Headless Mode | Yes | Yes | No |
29
+ | Stability | High | Low (critical bugs) | Medium |
30
+ | CI/CD Ready | Yes | Yes | No |
31
+ | DOM Snapshots | Yes | No | No |
32
+ | Best For | Automated testing | (Not recommended) | Manual debugging |
33
+
34
+ **Puppeteer MCP** has critical communication bugs (#5 — server doesn't return data to client). Avoid.
35
+
36
+ **Chrome MCP Extension** (`mcp-chrome-bridge`) attaches to your existing Chrome with cookies/auth. Useful for manual debugging only. Add with `--with-chrome` flag.
37
+
38
+ ---
39
+
40
+ ## Setup
41
+
42
+ Your `.mcp.json` is auto-configured by the installer:
43
+
44
+ ```json
45
+ {
46
+ "chrome-devtools": {
47
+ "command": "npx",
48
+ "args": ["-y", "chrome-devtools-mcp@latest"],
49
+ "env": {
50
+ "FLUENT_UI_BASE_URL": "https://<account>.<env>.apps.engineering.fluentcommerce.com"
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ **First run:** Browser binaries auto-install (Chromium ~130MB).
57
+
58
+ ### Installer flags
59
+
60
+ | Flag | Purpose |
61
+ |------|---------|
62
+ | `--browser-url <url>` | Set `FLUENT_UI_BASE_URL` for a specific environment |
63
+ | `--no-browser` | Skip Chrome DevTools MCP setup (backend-only workflows) |
64
+ | `--save-video [resolution]` | Enable continuous video recording (default: 1920x1080) |
65
+ | `--with-chrome` | Add Chrome MCP Extension alongside (manual debugging) |
66
+
67
+ ### Hybrid setup (optional)
68
+
69
+ ```bash
70
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE --with-chrome
71
+ ```
72
+
73
+ Adds `chrome-manual` server. Requires Chrome extension from https://github.com/hangwin/mcp-chrome.
74
+ - `mcp__chrome-devtools__*` tools for automated tests
75
+ - `mcp__chrome-manual__*` tools for exploratory testing with existing sessions
76
+
77
+ ---
78
+
79
+ ## Common Testing Workflows
80
+
81
+ ### 1. Login to Fluent OMS
82
+
83
+ ```typescript
84
+ navigate_page({ url: "https://<account>.test.apps.engineering.fluentcommerce.com/oms" })
85
+ take_snapshot() // Find login form refs
86
+
87
+ fill_form({
88
+ fields: [
89
+ { ref: "username-input-ref", value: process.env.FLUENT_USERNAME },
90
+ { ref: "password-input-ref", value: process.env.FLUENT_PASSWORD }
91
+ ]
92
+ })
93
+ click({ ref: "login-button-ref" })
94
+ wait_for({ condition: "navigation complete" })
95
+ take_snapshot() // Verify dashboard loaded
96
+ ```
97
+
98
+ ### 2. Navigate with Hash Routing
99
+
100
+ ```typescript
101
+ // Direct URL navigation
102
+ navigate_page({ url: "https://<account>.test.apps.engineering.fluentcommerce.com/oms#/orders" })
103
+
104
+ // OR click navigation menu
105
+ click({ ref: "orders-menu-item-ref" })
106
+ take_snapshot() // Verify orders list
107
+ ```
108
+
109
+ ### 3. Search and Verify
110
+
111
+ ```typescript
112
+ take_snapshot()
113
+ type_text({ ref: "search-input-ref", text: "TEST-ORDER-001" })
114
+ press_key({ ref: "search-input-ref", key: "Enter" })
115
+ wait_for({ timeout: 5000 })
116
+ list_network_requests() // Verify GraphQL query fired
117
+ ```
118
+
119
+ ### 4. Fill Complex Forms (Material UI)
120
+
121
+ ```typescript
122
+ fill_form({
123
+ fields: [
124
+ { ref: "customer-autocomplete-ref", value: "John Doe" },
125
+ { ref: "order-type-select-ref", value: "HD" },
126
+ { ref: "order-ref-input-ref", value: "TEST-ORDER-123" }
127
+ ]
128
+ })
129
+ select_option({ ref: "retailer-select-ref", value: "YOUR_RETAILER" })
130
+ click({ ref: "submit-button-ref" })
131
+ ```
132
+
133
+ ### 5. Verify GraphQL API Calls
134
+
135
+ ```typescript
136
+ click({ ref: "refresh-button-ref" })
137
+ list_network_requests()
138
+ // Look for: url containing "graphql", method "POST", status 200
139
+ ```
140
+
141
+ **POST payload capture workaround** (payloads may not appear in network log):
142
+
143
+ ```typescript
144
+ evaluate_script({
145
+ code: `
146
+ window.__capturedRequests = [];
147
+ const originalFetch = window.fetch;
148
+ window.fetch = function(...args) {
149
+ const [url, options] = args;
150
+ if (options?.method === 'POST' && url.includes('graphql')) {
151
+ window.__capturedRequests.push({ url, body: options.body });
152
+ }
153
+ return originalFetch.apply(this, args);
154
+ };
155
+ `
156
+ })
157
+ // Later: evaluate_script({ code: `JSON.stringify(window.__capturedRequests)` })
158
+ ```
159
+
160
+ ### 6. Check Console for React Errors
161
+
162
+ ```typescript
163
+ list_console_messages()
164
+ click({ ref: "problematic-button-ref" })
165
+ list_console_messages() // Returns array of { level: "error", text: "..." }
166
+ ```
167
+
168
+ ### 7. Screenshots for Visual Regression
169
+
170
+ ```typescript
171
+ take_screenshot({ fullPage: true }) // Full page
172
+ take_screenshot({ ref: "order-card-ref" }) // Element-specific
173
+ ```
174
+
175
+ ### 8. Mobile Responsive Testing
176
+
177
+ ```typescript
178
+ browser_resize({ width: 390, height: 844 })
179
+ take_snapshot() // Verify mobile layout
180
+ ```
181
+
182
+ Or configure in `.mcp.json`: `"args": ["-y", "chrome-devtools-mcp@latest", "--device=iPhone 15"]`
183
+
184
+ ### 9. Persist Login Across Runs
185
+
186
+ Add `--storage-state` to `.mcp.json` args:
187
+ ```
188
+ "--storage-state=./chrome-session.json"
189
+ ```
190
+ First run: login saved to file. Subsequent runs: auto-logged in.
191
+
192
+ ---
193
+
194
+ ## Material UI Component Selectors
195
+
196
+ Chrome DevTools MCP uses **DOM snapshots**, not CSS selectors:
197
+
198
+ | Component | How to Select |
199
+ |-----------|---------------|
200
+ | TextField | Find by label: `"Order Reference"` |
201
+ | Button | Find by text: `"Submit"` |
202
+ | Select/Dropdown | Find by label: `"Order Type"` |
203
+ | Autocomplete | Find by input label: `"Customer"` |
204
+ | DataGrid | Find by role: `"grid"` |
205
+ | Dialog | Find by role: `"dialog"` |
206
+ | Menu | Find by role: `"menu"` |
207
+ | Tabs | Find by role: `"tab"` |
208
+
209
+ **Key insight:** Material UI has excellent accessibility markup, making `take_snapshot` highly reliable.
210
+
211
+ ---
212
+
213
+ ## Click Telemetry (Visual Click Highlights)
214
+
215
+ Chrome DevTools MCP clicks are programmatic — no visible cursor appears. Click Telemetry injects visual highlights around elements before interactions, making screenshots and screencasts self-documenting.
216
+
217
+ ### Quick Setup
218
+
219
+ Inject once at session start via `evaluate_script`:
220
+
221
+ ```javascript
222
+ (function() {
223
+ if (!document.getElementById('__fc-click-keyframes')) {
224
+ var s = document.createElement('style');
225
+ s.id = '__fc-click-keyframes';
226
+ s.textContent =
227
+ '@keyframes fcClickPulse{0%{box-shadow:0 0 0 0 rgba(233,69,96,0.6)}' +
228
+ '50%{box-shadow:0 0 0 8px rgba(233,69,96,0.2)}' +
229
+ '100%{box-shadow:0 0 0 0 rgba(233,69,96,0)}}';
230
+ document.head.appendChild(s);
231
+ }
232
+ })();
233
+ ```
234
+
235
+ ### Highlight Before Click
236
+
237
+ ```javascript
238
+ (function() {
239
+ var prev = document.getElementById('__fc-click-highlight');
240
+ if (prev) prev.remove();
241
+ var elem = document.querySelector('SELECTOR');
242
+ if (!elem) return 'not_found';
243
+ var rect = elem.getBoundingClientRect();
244
+ var h = document.createElement('div');
245
+ h.id = '__fc-click-highlight';
246
+ h.style.cssText = 'position:fixed;left:' + (rect.left-4) + 'px;top:' + (rect.top-4) +
247
+ 'px;width:' + (rect.width+8) + 'px;height:' + (rect.height+8) +
248
+ 'px;border:3px solid #e94560;border-radius:6px;z-index:2147483646;' +
249
+ 'pointer-events:none;animation:fcClickPulse 0.8s ease-in-out infinite';
250
+ var b = document.createElement('span');
251
+ b.style.cssText = 'position:absolute;top:-26px;left:0;background:#e94560;color:#fff;' +
252
+ 'padding:2px 10px;border-radius:4px;font:700 11px system-ui;text-transform:uppercase';
253
+ b.textContent = 'LABEL';
254
+ h.appendChild(b);
255
+ document.body.appendChild(h);
256
+ })();
257
+ ```
258
+
259
+ ### Full Click Sequence
260
+
261
+ 1. `evaluate_script` — inject highlight
262
+ 2. `wait_for` 300ms — let animation render
263
+ 3. `take_screenshot` — capture highlighted state
264
+ 4. `click` the element
265
+ 5. `wait_for` 500ms — let page settle
266
+ 6. `evaluate_script` — remove highlight: `var el = document.getElementById('__fc-click-highlight'); if (el) el.remove();`
267
+ 7. `take_screenshot` — capture post-click state
268
+
269
+ ### Action Timeline Tracker
270
+
271
+ ```javascript
272
+ window.__fcTimeline = {
273
+ actions: [], startTime: Date.now(),
274
+ log: function(action, target, label) {
275
+ this.actions.push({ seq: this.actions.length + 1,
276
+ elapsed: Date.now() - this.startTime,
277
+ action: action, target: target, label: label });
278
+ },
279
+ getReport: function() {
280
+ return JSON.stringify({ total: this.actions.length,
281
+ durationMs: Date.now() - this.startTime, timeline: this.actions });
282
+ }
283
+ };
284
+ ```
285
+
286
+ | Skill | Usage |
287
+ |-------|-------|
288
+ | `/fluent-ui-test` | Highlights each user action button during Phase 4 verification |
289
+ | `/fluent-ui-record` | Full highlight sequence for every interaction during recording |
290
+
291
+ ---
292
+
293
+ ## Troubleshooting
294
+
295
+ ### Common Issues
296
+
297
+ | Symptom | Cause | Fix |
298
+ |---------|-------|-----|
299
+ | "Element not found" | Element not in DOM yet (still loading) | `wait_for({ timeout: 5000 })` then `take_snapshot()` |
300
+ | Hash routing not working | Browser treated `#` as fragment | Use full URL: `https://...com/oms#/orders` (not just `#/orders`) |
301
+ | GraphQL mutation payload missing | POST bodies not always captured | Use `evaluate_script` with fetch interceptor (see above) |
302
+ | Flaky tests after navigation | No auto-wait after navigation | Always add `wait_for` after `navigate_page` |
303
+ | Bearer token truncated | Header parser limitation | Use `evaluate_script({ code: 'localStorage.getItem("authToken")' })` |
304
+ | Chrome DevTools MCP not starting | Stale browser lock file | `rm -rf ~/.cache/chrome-devtools-mcp/chrome-profile/SingletonLock` |
305
+ | Chrome DevTools MCP port conflict | Another Chrome instance using same profile | Use `--headless` or remove the full profile dir |
306
+
307
+ **NEVER use `taskkill //F //IM chrome.exe`** — this kills the user's personal browser tabs. Chrome DevTools MCP uses its own profile at `~/.cache/chrome-devtools-mcp/chrome-profile`. When the lock is stale, remove the `SingletonLock` file (not taskkill).
308
+
309
+ ### Performance Tips
310
+
311
+ 1. **Use `take_snapshot` not screenshots** — DOM snapshot (0.5s) is ~10x faster than screenshot + vision model (5-10s)
312
+ 2. **Batch fill operations** — one `fill_form` call instead of multiple `type_text` calls
313
+ 3. **Reuse storage state** — login once, save session (1s) vs login every run (10-15s)
314
+
315
+ ---
316
+
317
+ ## Advanced Configuration
318
+
319
+ ### Headless for CI/CD
320
+
321
+ ```json
322
+ { "args": ["-y", "chrome-devtools-mcp@latest", "--headless"] }
323
+ ```
324
+
325
+ ### Restrict Allowed Hosts
326
+
327
+ ```json
328
+ { "args": ["-y", "chrome-devtools-mcp@latest", "--allowed-hosts=<account>.test.apps.engineering.fluentcommerce.com"] }
329
+ ```
330
+
331
+ ### Enable Screencast Recording
332
+
333
+ ```json
334
+ { "args": ["-y", "chrome-devtools-mcp@latest", "--experimentalScreencast"] }
335
+ ```
336
+
337
+ FFmpeg optional — enables trim/convert `.webm` to `.mp4`, GIF previews.
338
+
339
+ ### Use Proxy
340
+
341
+ ```json
342
+ { "args": ["-y", "chrome-devtools-mcp@latest", "--proxy-server=http://proxy.example.com:8080"] }
343
+ ```
344
+
345
+ ### CI/CD Example (GitHub Actions)
346
+
347
+ ```yaml
348
+ name: Fluent UX E2E Tests
349
+ on: [push, pull_request]
350
+ jobs:
351
+ test:
352
+ runs-on: ubuntu-latest
353
+ steps:
354
+ - uses: actions/checkout@v4
355
+ - uses: actions/setup-node@v4
356
+ with: { node-version: '20' }
357
+ - name: Install browser binaries
358
+ run: npx chrome-devtools-mcp@latest --headless --help
359
+ - name: Run tests
360
+ run: |
361
+ echo '{ "chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest", "--headless"], "env": { "FLUENT_UI_BASE_URL": "${{ secrets.FLUENT_UI_BASE_URL }}" } } }' > .mcp.json
362
+ claude-code run test-fluent-ux.ts
363
+ - name: Upload screenshots
364
+ if: failure()
365
+ uses: actions/upload-artifact@v4
366
+ with: { name: test-screenshots, path: ./screenshots/ }
367
+ ```
368
+
369
+ ---
370
+
371
+ ## Tool Reference
372
+
373
+ | Tool | Purpose | Key Parameters |
374
+ |------|---------|----------------|
375
+ | `navigate_page` | Go to URL | `url` |
376
+ | `click` | Click element | `ref`, `button`, `modifiers` |
377
+ | `type_text` | Type text | `ref`, `text` |
378
+ | `press_key` | Press keyboard key | `ref`, `key` |
379
+ | `fill_form` | Fill multiple fields | `fields: [{ref, value}]` |
380
+ | `drag` | Drag and drop | `ref`, `targetRef` |
381
+ | `hover` | Hover over element | `ref` |
382
+ | `select_option` | Select dropdown value | `ref`, `value` |
383
+ | `file_upload` | Upload file | `ref`, `filePath` |
384
+ | `take_snapshot` | Get DOM snapshot | (returns structured JSON) |
385
+ | `take_screenshot` | Capture screenshot | `fullPage`, `ref` |
386
+ | `list_console_messages` | Get console logs | (returns array) |
387
+ | `list_network_requests` | Get network activity | (returns array) |
388
+ | `evaluate_script` | Run JavaScript | `code` |
389
+ | `handle_dialog` | Handle alert/confirm | `action`, `text` |
390
+ | `close_page` | Close browser tab | |
391
+ | `resize_page` | Change viewport | `width`, `height` |
392
+ | `wait_for` | Wait for condition | `timeout`, `condition` |
393
+
394
+ ---
395
+
396
+ ## References
397
+
398
+ - [Chrome DevTools MCP (npm)](https://www.npmjs.com/package/chrome-devtools-mcp)
399
+ - [Chrome MCP Extension (GitHub)](https://github.com/hangwin/mcp-chrome)
400
+ - [Model Context Protocol Docs](https://modelcontextprotocol.io)