| name | ux-collab |
| description | Visual-first UI/UX collaboration loop using agent-browser (primary), Playwright MCP (alternative), Figma MCP (design system/specs), and Lucid (wireframes). Use when designing or iterating on UI, reviewing the live app visually, creating wireframes, making layout decisions, discussing design before building, or running a designโbuildโverify loop. Trigger phrases: 'let's work on the UI', 'show me what it looks like', 'create a wireframe', 'design the layout', 'take a screenshot', 'browser view', 'before we build let's decide'. |
| compatibility | Requires: agent-browser (brew/npm) OR Playwright MCP (mcp_playwright_*). ImageMagick for screenshot optimization. Optional: Lucid MCP (wireframes), Figma MCP (design tokens/component specs). |
| license | MIT |
| metadata | {"author":"kylebrodeur","version":"2.2"} |
UX Collaboration Skill
A structured loop for visual-first UI/UX design and implementation. Works with any web app running locally โ project-specific routes, surfaces, and brand tokens are configured per-project via .ux-collab.md (see Project Setup).
When to Use
- Any session where UI/UX decisions need to be made before or during coding
- When the user wants to see the live app, discuss layout, or compare before/after states
- When a design decision is unresolved and a wireframe would help
- When iterating on an existing surface
- When building from Figma designs with Code Connect
Prerequisites โ Check Before Starting
At session start, verify the required tools are available. agent-browser is preferred โ use Playwright MCP only when you need specific features it provides.
Quick check via npm (if ux-collab is installed as a package):
npm run check
Manual checks:
1. agent-browser (PRIMARY)
โ Check: agent-browser --version
โ Install if missing:
brew install agent-browser # macOS (fastest)
npm install -g agent-browser # any platform
โ First run: agent-browser install # Downloads Chrome for Testing
2. ImageMagick (screenshot optimization)
โ Check: which convert && which identify
โ Install:
brew install imagemagick # macOS
sudo apt install imagemagick # Ubuntu/Debian
3. Playwright MCP (ALTERNATIVE โ use when needed)
โ Try: mcp_playwright_browser_navigate { url: "about:blank" }
โ When to use Playwright instead of agent-browser:
* Need full accessibility tree with semantic roles
* Complex multi-page interactions with state
* Specific viewport/device emulation beyond agent-browser devices
* MCP ecosystem already configured and working
โ Fallback: if MCP unavailable, agent-browser handles all core needs
4. Figma MCP (OPTIONAL โ for design system alignment)
โ For pulling tokens, verifying components, Code Connect integration
โ Requires Figma Pro + API key
โ Use when: design system is in Figma with Code Connect
5. Lucid MCP (OPTIONAL โ for wireframes)
โ For ideation, simple wireframes, explanations
โ Falls back to Markdown wireframes when unavailable
โ See "Lucid vs Figma" section for when to use each
6. Dev server
โ Navigate to target URL; if unreachable, check Session Startup Checklist
Browser Tool Selection Guide
| Use agent-browser when | Use Playwright MCP when |
|---|
| Quick visual review | Need full accessibility tree with semantic roles |
| Token efficiency matters (~200-400 tokens vs 3000-5000) | Complex multi-page interactions with state |
| Headless, local development | Specific geolocation/permissions |
| CI/CD or terminal-only environments | Rich semantic element analysis |
| Screenshot + basic interaction needed | Viewport resizing via dynamic MCP tools |
Default workflow: Start with agent-browser. Switch to Playwright MCP if you hit limitations.
Related Skills
For browser automation, install the official agent-browser skill which teaches agents the full API:
npx skills add vercel-labs/agent-browser --skill agent-browser
This skill provides:
- Complete command reference (navigate, snapshot, interact, screenshot)
- Session and authentication workflows
- Diffing and evaluation capabilities
- Best practices for browser automation
When to use: Combine with ux-collab when you need deep browser automation beyond basic screenshots โ form filling, multi-step workflows, session persistence, or testing.
See all agent-browser skills: https://agent-browser.dev/skills
| Use agent-browser when | Use Playwright MCP when |
|---|
| Quick visual review | Need full accessibility tree with semantic roles |
| Token efficiency matters (~200-400 tokens vs 3000-5000) | Complex multi-page interactions with state |
| Headless, local development | Specific geolocation/permissions |
| CI/CD or terminal-only environments | Rich semantic element analysis |
| Screenshot + basic interaction needed | Viewport resizing via dynamic MCP tools |
Default workflow: Start with agent-browser. Switch to Playwright MCP if you hit limitations.
Design Tool Selection: Lucid vs Figma
Key insight from Code Connect article:
| Tool | Purpose | When to Use |
|---|
| Lucid | Ideation, simple wireframes, explanations | Early concept exploration, layout discussions, stakeholder communication, rough "what if" scenarios |
| Figma | Fine-tuning, design systems, component tracking | Component specification, token verification, design-code alignment, production-grade specs, Code Connect integration |
Decision tree:
- Is this a new rough idea where layout is uncertain? โ Lucid
- Are we specifying component behavior, tokens, or states? โ Figma
- Building from an existing design system? โ Figma MCP (pull tokens/components)
- Need to verify implementation matches design? โ Figma MCP (compare screenshot)
The Loop
SEE โ DISCUSS โ IDEATE โ SPECIFY โ BUILD โ VERIFY โ SYNC โ RECORD
โ___________โ___________________________โ
(Lucid) (Figma + Code Connect)
- SEE โ Screenshot live app with agent-browser or Playwright MCP
- DISCUSS โ Identify design questions and constraints
- IDEATE โ Rough wireframes in Lucid (or Markdown) for layout exploration
- SPECIFY โ Figma MCP + Code Connect for component/token specification
- BUILD โ Implement with real components and tokens
- VERIFY โ agent-browser + Figma MCP comparison for token compliance
- SYNC โ Update Figma with implementation notes (optional, future)
- RECORD โ Document decisions in design decisions file
Step 1 โ SEE (Browser Snapshot)
Open the live app and establish shared visual context.
Primary approach (agent-browser):
agent-browser open <target-url>
agent-browser snapshot -i
agent-browser screenshot page.png
./optimize-screenshot.sh
Alternative (Playwright MCP) when richer features needed:
Actions:
- mcp_playwright_browser_navigate โ target URL
- mcp_playwright_browser_take_screenshot { type: "png" }
- ./optimize-screenshot.sh
- mcp_playwright_browser_snapshot (full accessibility tree)
- mcp_playwright_browser_resize for responsive checks:
mobile: 390ร844
tablet: 768ร1024
desktop: 1440ร900
Screenshot optimization is mandatory before attaching any screenshot to chat. Raw screenshots can exceed 280KB. The optimize script resizes to max 1280px wide and converts to JPEG at 82% quality โ output reliably lands under 80KB.
./optimize-screenshot.sh
./optimize-screenshot.sh /path/to/screenshot.png
After capturing, state your observations in 3โ5 bullet points:
- Overall layout and visual hierarchy
- Empty states or placeholder content
- Interaction affordances (buttons, inputs, links)
- Spacing and alignment issues
- Anything that looks broken or unfinished
Step 2 โ DISCUSS
Synthesize observations into design questions. Ask exactly one focused question at a time.
Types of design questions (pick the right frame):
| Question type | When to use | Example |
|---|
| Layout | Structure or grid is unclear | "Should this stack vertically on mobile or stay side-by-side?" |
| Hierarchy | Content priority is ambiguous | "Is the headline or the CTA the primary element here?" |
| Pattern | Multiple valid UI patterns exist | "Would a stepped form or all-at-once scroll work better for this survey?" |
| State | Empty/error/loading states are missing | "What should appear when there are no results yet?" |
| Interaction | Click/hover/focus behavior is undefined | "Should filtering update results live or require a submit?" |
Check the project decisions doc (from .ux-collab.md โ decisionsDoc) before asking โ don't re-litigate resolved decisions.
Step 3 โ IDEATE (Lucid or Markdown Wireframes)
Purpose: Rough layout exploration, early concept communication
Use Lucid when:
- Exploring multiple layout options
- Communicating rough ideas to stakeholders
- Creating quick "what if" scenarios
- Layout structure is still uncertain
Use Markdown when:
- Lucid MCP is unavailable
- Quick textual representation suffices
- Developer handoff is immediate
With Lucid MCP:
Actions:
- mcp_lucid_lucid_create_diagram_from_specification โ generate wireframe
- mcp_lucid_lucid_create_document_share_link โ share
- mcp_lucid_lucid_export_image โ pull image back into conversation
- agent-browser open <lucidShareUrl> โ preview
Wireframe conventions:
- Label sections (Header, Hero, Sidebar, Main Content)
- Show grid/structure but not pixel-perfect spacing
- Mark content types (H1, Button, Card Grid)
- Indicate responsive breakpoints if layout changes
- Mark open decisions with
[?]
When NOT to use Lucid:
- Component specification (use Figma)
- Token verification (use Figma)
- Final design approval (use Figma)
Markdown Fallback:
## Wireframe: [Surface Name] โ [Viewport]
Layout: [describe grid, e.g., "2-col, 16px gap, max-w-4xl centered"]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ [HEADER] Logo Nav links โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ [HERO] โ
โ H1: Primary headline โ
โ Body: Supporting copy โ
โ [CTA Button โ brand-gold] โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโค
โ [SIDEBAR] โ [MAIN CONTENT] โ
โ Filter A โ Card grid (3-col) โ
โ Filter B โ ... โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโ
States needed: empty, loading, error, filled
Open decisions: [?] sidebar collapse behavior on mobile
Step 4 โ SPECIFY (Figma MCP + Code Connect)
Purpose: Component specification, token verification, design-code alignment
Prerequisites:
- Figma Pro account
- Figma MCP Server configured
- Code Connect set up in Figma (components linked to GitHub)
When to Use Figma MCP:
-
Before BUILD: Pull tokens and component specs
- mcp_figma_get_variable_defs โ Extract design tokens
- mcp_figma_get_design_context โ Code Connect snippet + variants + screenshot
- Verify all tokens exist in local CSS
-
During BUILD: Reference component specs
- mcp_figma_get_screenshot โ See exact design
- mcp_figma_get_variable_defs โ Verify token names match
-
After BUILD: Verify implementation
- mcp_figma_get_screenshot โ Capture design
- Compare to agent-browser screenshot
- Verify tokens match implementation
Component State Matrix (Document in .ux-collab.md):
Document expected component states for verification:
| Element | Property | Default | Hover | Active | Focus | Disabled |
|---------|----------|---------|-------|--------|-------|----------|
| Button (Primary) | Background | --bg-primary | --bg-primary-hover | --bg-primary-active | --bg-primary | --bg-disabled |
| Button (Primary) | Border | none | none | none | --border-focus | none |
| Button (Primary) | Text Color | --text-on-primary | --text-on-primary | --text-on-primary | --text-on-primary | --text-disabled |
MCP Instructions per Component:
Reference these from Code Connect UI to guide AI behavior:
- "Always use 'primary' variant for main CTAs, 'secondary' for supporting actions"
- "Text should be sentence case (not uppercase)"
- "Icons should use --icon-size-md (20px) for default size"
- "Disabled state uses reduced opacity (0.5), not grey background"
- "Transitions should use --ease-standard (--duration-fast: 150ms)"
Step 5 โ BUILD
Implement only what was agreed in Steps 2โ4. No scope creep.
Project-specific target files are in .ux-collab.md โ read it before touching any files.
If no .ux-collab.md exists, discover targets by:
find . -name "globals.css" -not -path "*/node_modules/*" | head -5
find . -name "tailwind.config*" -not -path "*/node_modules/*" | head -3
ls app/ components/ src/ 2>/dev/null | head -20
Universal Code Rules:
- All colors via design tokens only โ no inline hex values
- Use project's existing component system โ check
.ux-collab.md preferences.components.library
- Respect tech stack preferences from
.ux-collab.md:
- Framework: React/Vue/Svelte as specified
- Styling: Tailwind v4 vs v3, CSS modules, etc.
- Primitives: base-ui, Radix, Headless UI as specified
- Additional registries: @react-bits, @magicui, etc.
- No new dependencies without explicit discussion (except from approved registries)
- Accessibility semantics: correct heading levels, button vs. link, ARIA labels on interactive elements
- Match Figma tokens via mcp_figma_get_variable_defs when available
Design System Check (if Figma MCP available):
Before coding:
[ ] Read .ux-collab.md preferences section
[ ] mcp_figma_search_design_system โ Find matching component
[ ] mcp_figma_get_design_context โ Code Connect snippet + variants
[ ] Check component matches preferred primitives (base-ui vs Radix, from preferences)
[ ] Verify component exists in local codebase OR installable from approved registries
[ ] Check token names match local CSS
If component uses wrong primitive library:
โ Search additional registries listed in preferences
โ Consider building from scratch with preferred primitives
โ Document why in decisions file
If component missing or tokens mismatch:
โ Flag for design system update
โ Document in decisions file
Tech Stack Preferences (from .ux-collab.md):
Check preferences at start of BUILD:
preferences:
framework: react # Build React components, not Vue
components:
library: shadcn # Use shadcn/ui patterns
primitives: base-ui # NOT Radix โ use base-ui equivalents
styling:
solution: tailwindcss
version: "4" # Use Tailwind v4 patterns
quality:
strictTypes: true # Full TypeScript with strict mode
Implementation guidance based on preferences:
| Preference | Implementation Rule |
|---|
components.library: shadcn | Use npx shadcn add, not npm install |
components.primitives: base-ui | Import from @base-ui-components/react, not @radix-ui |
components.registry: [@react-bits] | Can install from these registries without asking |
styling.version: "4" | Use Tailwind v4 @import syntax, not v3 directives |
language: typescript | Full TypeScript types, no any |
framework: react | Use Server Components where appropriate |
Component installation priority:
- Does component already exist in local codebase? โ Use existing
- Is it in shadcn built-in registry? โ
npx shadcn add [component]
- Is it in approved additional registries? โ Install from that registry
- Neither? โ Build from preferred primitives (base-ui, not Radix)
Step 6 โ VERIFY (Browser + Figma Comparison)
After every code change, reload and verify implementation matches intent.
Screenshot comparison:
agent-browser open <target-url>
agent-browser screenshot implementation.png
mcp_figma_get_screenshot โ design.png
Token compliance check:
1. mcp_figma_get_variable_defs โ Extract expected tokens
2. Check computed styles in browser:
- agent-browser open <url>
- agent-browser click @element-ref
- agent-browser evaluate โ getComputedStyle(element)
3. Verify CSS properties match token values
4. Document any discrepancies
Visual diff callouts:
- โ
What matches design intent
- โ ๏ธ What's off but acceptable
- โ What needs fixing before RECORD
Responsive verification:
agent-browser --device "iPhone 12" open <url>
agent-browser screenshot mobile.png
agent-browser --device "iPad" open <url>
agent-browser screenshot tablet.png
Step 7 โ SYNC (Code-to-Figma)
Sync implementation to Figma for design documentation.
When to Use:
- Code-first development workflow
- Keeping Figma in sync with shipped code
- Generating design system from implementation
Workflow:
code-to-figma scan src/components/Button.tsx
code-to-figma plugin-output -i .figma -o plugin-data.json
Configuration
Add to .ux-collab.md:
codeToFigma:
enabled: true
outputDir: ".figma"
onBuild: true
See: code-to-figma skill for full documentation.
Step 8 โ RECORD
Update the project decisions doc (path in .ux-collab.md โ decisionsDoc, default: docs/DESIGN_DECISIONS.md).
Structure:
## Open Decisions
- [?] Mobile sidebar behavior still TBD
## Decided
**[Decision name]** โ [chosen option].
Rationale: [one sentence why].
Implementation notes: [link to PR or file]
Figma reference: [link to Figma frame]
Date: [YYYY-MM].
## Design Principles
- Always use semantic tokens, never primitives directly in components
- Button text is always sentence case
If Figma MCP was used during session:
- Link to Figma frames used
- Note any token mismatches discovered
- Document Code Connect status for new components
Minimal Mode โ Quick Visual Review
For lightweight sessions (no wireframe, no Figma, quick check):
agent-browser open <target-url>
agent-browser screenshot page.png
./optimize-screenshot.sh
Session Startup Checklist
[ ] agent-browser installed and working?
โ Check: agent-browser --version
โ Install: brew install agent-browser OR npm i -g agent-browser
โ First run: agent-browser install
[ ] Playwright MCP available (backup/alternative)?
โ Try: mcp_playwright_browser_navigate to "about:blank"
โ If agent-browser fails, use Playwright MCP
[ ] Figma MCP configured (optional)?
โ Check: .mcp.json for figma server
โ Verify FIGMA_API_KEY is set
โ Only needed for design token workflows
[ ] Dev server running?
โ Check: agent-browser open <target-url>
โ Start: run the project's dev task
[ ] Read .ux-collab.md (if present)
โ Sets: defaultUrl, decisionsDoc, brandTokens, targetFiles, surfaces, figmaFileUrl
[ ] Check if this is "IDEATE" or "SPECIFY" phase
โ Rough layout? IDEATE (Lucid)
โ Component specs? SPECIFY (Figma)
[ ] Take baseline screenshot
โ agent-browser open <url> + agent-browser screenshot + ./optimize-screenshot.sh
[ ] Confirm scope: which surface, which phase, which tools needed
Quick Reference
agent-browser (Primary)
brew install agent-browser
npm install -g agent-browser
agent-browser install
Navigate: agent-browser open <url>
Screenshot: agent-browser screenshot [path.png] [--full]
Optimize: ./optimize-screenshot.sh
Snapshot: agent-browser snapshot -i (accessibility tree with refs)
Click: agent-browser click @<ref> (from snapshot)
Scroll: agent-browser scroll <up/down/left/right> [px]
Evaluate: agent-browser eval "document.querySelector('...').style"
Close: agent-browser close
Devices: agent-browser --device "iPhone 12" open <url>
agent-browser --device "iPad" open <url>
agent-browser --device "Pixel 5" open <url>
Config: agent-browser.json (project root)
Playwright MCP (Alternative)
Navigate: mcp_playwright_browser_navigate { url }
Screenshot: mcp_playwright_browser_take_screenshot { type: "png" }
Snapshot: mcp_playwright_browser_snapshot (full a11y tree)
Click: mcp_playwright_browser_click { ref }
Resize: mcp_playwright_browser_resize { width, height }
Evaluate: mcp_playwright_browser_evaluate { script }
Scroll: mcp_playwright_browser_mouse_wheel { deltaY }
Figma MCP (Design System)
# Token & Component Access
Get variables: mcp_figma_get_variable_defs { fileKey }
Search components: mcp_figma_search_design_system { fileKey, query }
Get design context: mcp_figma_get_design_context { fileKey, nodeId } โ primary
Get screenshot: mcp_figma_get_screenshot { fileKey, nodeId }
# Code Connect
Get map: mcp_figma_get_code_connect_map { fileKey }
Suggest mappings: mcp_figma_get_code_connect_suggestions { fileKey }
Lucid (Wireframes)
Create: mcp_lucid_lucid_create_diagram_from_specification { title, description, ... }
Share: mcp_lucid_lucid_create_document_share_link { documentId, email }
Export: mcp_lucid_lucid_export_image { documentId }
Preview: agent-browser open <lucidShareUrl>
Updated .ux-collab.md Format
defaultUrl: http://localhost:3000
decisionsDoc: docs/DESIGN_DECISIONS.md
preferences:
framework: react
language: typescript
styling:
solution: tailwindcss
version: "4"
config: app/globals.css
components:
library: shadcn
primitives: base-ui
registry:
- @react-bits
- @magicui
- @aceternity
aliases:
components: "@/components"
utils: "@/lib/utils"
quality:
strictTypes: true
lintCommand: "npm run lint"
formatCommand: "npm run format"
figmaFileUrl: https://www.figma.com/design/ABC123/your-file
codeConnectEnabled: true
targetFiles:
tokens: app/globals.css
components: app/_components/
layouts: app/layouts/
brandTokens:
colors:
primary: --color-primary
secondary: --color-secondary
spacing:
sm: --space-4
md: --space-8
lg: --space-16
surfaces:
- name: Homepage
route: /
components: [Hero, FeatureGrid, Footer]
- name: Dashboard
route: /dashboard
components: [Sidebar, DataTable, Card]
openDecisions:
- Navigation pattern โ sidebar vs. top nav
- Mobile layout โ stacked vs. tabs
See Also