/debug-bridge:test-design-modefrom debug-bridge
Automated end-to-end testing suite and subagent protocol for validating Agent Bridge Design Mode across mobile (phone) and desktop viewports, testing toolbar visibility, tool switching, info popovers, AI quick render, manual tweaks, and batch submissions.
Ships in debug-bridge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
This skill provides an automated, reproducible end-to-end test suite and subagent delegation protocol for validating Agent Bridge Design Mode across mobile (Developer Mode device simulation) and desktop viewports.
┌────────────────────────┐
│ Orchestrator Agent │
└───────────┬────────────┘
│ spawns via invoke_subagent
▼
┌────────────────────────┐ Runs Suite ┌────────────────────────┐
│ Browser Tester Subagent│ ─────────────────────► │ Playwright Test Runner │
└────────────────────────┘ └───────────┬────────────┘
│
┌─────────────────────────┴─────────────────────────┐
▼ ▼
┌───────────────────────┐ ┌───────────────────────┐
│ Mobile Viewport │ │ Desktop Viewport │
│ (Phone 375x667) │ │ (Desktop 1280x850) │
├───────────────────────┤ ├───────────────────────┤
│ • Toolbar fits screen │ │ • Full toolbar pills │
│ • Overflow-x scroll │ │ • Canvas annotations │
│ • Popover max-widths │ │ • Resize re-anchoring │
│ • AI Quick Render │ │ • Multi-item batch │
│ • Manual Tweaks │ │ • High-res screenshot │
└───────────────────────┘ └───────────────────────┘
| Category | Item Tested | Verification Method |
|---|---|---|
| Responsive Viewports | Phone Surface (375x667) | Ensures palette is constrained (max-width: calc(100vw - 16px)), horizontally scrollable (overflow-x: auto), and no buttons clip. |
| Responsive Viewports | Desktop Surface (1280x850) | Full-width display with tool group, prompt input, render wraps, tweaker, batch, and copy buttons. |
| Dynamic Resizing | DevTools Mode Toggle | Resizes viewport from desktop to mobile and back; verifies .box-layer and canvas reposition without drift. |
| Tool Palette | Mode Switching | Cycles through interact, select, pen, region, arrow; verifies snapshot updates. |
| Target Selection | Element Pick & Highlight | Picks target element (button[data-testid="logout-btn"]), checks @e1 badge and selection box. |
| Info Popovers | AI Quick Render Info (?) | Opens AI info popover; verifies title "Quick Render (AI)", "TypeSafe AI • Jev" badge, and viewport bounds. |
| Info Popovers | Manual Quick Render Info (?) | Opens Manual info popover; verifies title "Quick Render (Manual)", "Inspector" badge, and viewport bounds. |
| Instant Preview | AI Quick Render (Jev) | Synthesizes CSS from prompt, injects <style id="__agent_bridge_live_preview__">, verifies computed styles. |
| Instant Preview | Manual Quick Render (Tweaker) | Opens inspector, adjusts style properties (e.g. padding), injects live CSS overrides, verifies computed styles. |
| Batch Workflow | Batch Review & Send | Inspects batch summary, triggers ➤ Send, verifies submission transition state. |
| Visual Annotations | Canvas Drawing | Draws pen lines, region boxes, and arrows; verifies snapshot marks count. |
| Visual Artifacts | Screenshots | Captures full page screenshots for mobile and desktop surfaces. |
| React Reflection | Fiber & Prop Inspection | Extracts component hierarchy (App, Home, etc.) and prop keys via __reactFiber$ and __reactProps$. |
| Per-Element Crops | Bounding Box Screenshots | Captures tight cropped screenshots per element in batch (surface-...-crop-...-screenshot.png). |
| CMUX Line 1 Parity | Multimodal Prompt Format | Emits line 1 <crop0> <text> <crop1> <crop2>, Page: <url>, and Details: <context.json>. |
| Structured Handoff | Tokenized Prompt Array | Populates prompt: [{ selection: 0 }, { text: ... }, ...] and context.json schema matching cmux. |
| Dock Liveness Pill | Agent Connection State | Displays 🟢 ● Agent Ready when bridge is listening, 🟠 ○ Offline (Copy) when disconnected; morphs to ⚙ Working and ✓ Done. |
| DOM Target Shimmer | Visual Working Feedback | Selected element receives .shimmer-working cyan pulse and ⚡ Working tag while agent processes; flashes green on completion. |
| Feedback Loop Runner | Automated Loop Verification | Runs node scripts/verify-feedback-loop.mjs to assert liveness pill states and element shimmer in headless browser. |
Run the test suite directly in the project workspace:
# Ensure browser package is built
pnpm --filter debug-bridge-browser build
# Run comprehensive test suite
node scripts/test-design-mode-suite.mjs
Environment variables:
TARGET_URL: Defaults to http://localhost:5173.ARTIFACT_DIR: Defaults to /tmp. Set to the session artifact directory to automatically export screenshot artifacts.Example with custom artifact path:
ARTIFACT_DIR="/tmp/test-artifacts" node scripts/test-design-mode-suite.mjs
When the orchestrator agent tests Design Mode, spawn a dedicated tester subagent:
{
"typeName": "self",
"role": "Browser Tester Subagent",
"Prompt": "You are the Tester Subagent validating Agent Bridge Design Mode across mobile (developer mode / phone size), desktop viewports, and CMUX parity.\n\nInstructions:\n1. Execute the comprehensive test suite:\n `node scripts/test-design-mode-suite.mjs`\n2. Verify that all 23 test steps across Phase 1 (Mobile Surface), Phase 2 (Desktop Surface), and Phase 3 (CMUX Parity Multi-Item Batch, Crops & Fiber) pass with code 0.\n3. Verify that the two verification screenshots are generated:\n - /tmp/test-design-mode-phone.png\n - /tmp/test-design-mode-desktop.png\n4. Report back with the test results summary, toolbar scroll metrics, computed styles before vs after AI/manual render, React Fiber components detected, cropped element screenshots, and screenshot paths."
}
The skill includes a dedicated inbox watcher script at scripts/watch-inbox.mjs.
When working interactively with a developer in the browser:
node .agents/skills/test-design-mode/scripts/watch-inbox.mjs
status: 'submitted' in .debug-bridge/feedback/), the watcher processes the newest one immediately upon startup and hands control to the agent.ws://127.0.0.1:4000/ws) and filesystem (.debug-bridge/feedback/) for incoming submissions.The test suite is maintained at scripts/test-design-mode-suite.mjs.
Key assertions:
assert(paletteMetrics.left >= 0);
assert(paletteMetrics.right <= paletteMetrics.windowWidth + 2);
assert.equal(paletteMetrics.overflowX, 'auto');
assert(popoverRect.left >= 0);
assert(popoverRect.right <= windowWidth + 2);
const styleTag = page.locator('#__agent_bridge_live_preview__');
await styleTag.waitFor({ state: 'attached' });
assert(boxAlignment.diffX <= 2 && boxAlignment.diffY <= 2);
assert.ok(Array.isArray(sel0.react_components));
assert.ok(sel0.react_components.includes('App') || sel0.react_components.includes('Routes'));
assert.ok(sel1.react_components.includes('Home'));
const expectedLine1 = `${cropPaths[0]} ${requestedText} ${cropPaths[1]} ${cropPaths[2]}`;
assert.equal(promptLines[0], expectedLine1);
assert.equal(promptLines[2], `Page: ${cmuxPage.url()}`);
assert.equal(promptLines[3], `Details: ${contextJsonPath}`);
assert.deepEqual(tokens[0], { selection: 0 });
assert.deepEqual(tokens[1], { text: requestedText });
assert.deepEqual(tokens[2], { selection: 1 });
assert.deepEqual(tokens[3], { selection: 2 });
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/agentic-e2e-testFull-stack agentic end-to-end test suite and dual-agent delegation runbook for Agent Bridge. Validates live app spin-up, AI Quick Render style synthesis, human developer simulation (selecting elements, drawing annotations, prompt batch submission), and reactive agent feedback loops (dock status pill, target DOM shimmer, agent broadcast completion)./debug-bridgeZero-instrumentation browser sidecar, visual feedback annotation, and in-browser Design Mode for AI agentsOther plugins' skills for the same job
npx claudepluginhub stevengonsalvez/agent-bridge --plugin debug-bridge