Protocol for creating UI/UX designs using Pencil, Figma MCP, and Playwright. Produces visual artifacts that web-dev and mobile-dev reference during implementation.
From ennam-dev-agent-teamnpx claudepluginhub en-nam/ennam-claude-agent-team --plugin ennam-dev-agent-teamThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
When you receive a design request, follow this protocol to produce visual design artifacts that the team can review and implement against.
Understand what needs to be designed AND deeply discover the user's visual preferences before creating anything. Use Socratic questioning (Ouroboros-style) to expose hidden assumptions about design direction.
docs/requirements/ for BA-produced
docs. Section 6 (UI/UX Requirements) is your primary input if it exists.Ask these questions using AskUserQuestion with 2-4 multiple choice options. Ask 1-2 questions at a time. Continue until you have clear answers for at least questions A-D below.
A. Brand Identity & Assets:
B. Color & Visual Direction:
C. Design Style Trend: Present current trending styles and ask which resonates most:
D. Interaction & Motion:
E. Reference Check (optional but valuable):
After discovery, create a Design Direction Summary:
Design Direction:
- Style: [chosen trend, e.g., "Soft Minimal with glassmorphism accents"]
- Colors: [primary, secondary, accent — derived from logo or user preference]
- Gradients: [yes/no, direction]
- Mode: [light/dark/both]
- Icons: [outlined/filled/emoji]
- Motion: [minimal/moderate/expressive]
- References: [user-provided apps/sites]
- Avoid: [styles user doesn't want]
Confirm this summary with the user before proceeding to Phase 2 Research.
Understand the existing codebase, design context, AND current industry trends.
src/components/ for existing React componentslib/ for existing widgets and themessrc/styles/ and tailwind.config.* for colors, typography, spacinglib/core/theme/ or lib/config/ for ThemeData, colors, text styles.pen files or Figma links in docs/designs/get_guidelines() with the appropriate topic (web-app, landing-page, etc.)get_style_guide_tags() to see available style tagsget_style_guide(tags) with 5-10 relevant tags for visual inspirationYou MUST complete steps 6, 7, and 10 below. Steps 8-9 are recommended. Skipping external research leads to generic, uninspired designs.
Use the Design Direction Summary from Phase 1 to focus your searches. Search terms should include the user's chosen style trend, color direction, and domain.
Find 5+ trending designs for the domain — Use WebSearch with targeted queries:
Deep-dive into top references with Playwright (REQUIRED on at least 3 different sites):
You MUST browse designs on at least 3 different design reference sites. Pick from:
For EACH design reference you visit, follow this deep-dive flow:
a. Navigate — browser_navigate to the design page URL (not just search results)
b. Take initial screenshot — browser_take_screenshot for the hero/first view
c. Scroll down — browser_press_key("PageDown") or browser_evaluate("window.scrollBy(0, 800)") to reveal more content
d. Take scroll screenshot — browser_take_screenshot again to capture:
browser_click on a specific design to open its detail page before screenshotting. Do NOT just screenshot the search results grid.Common patterns by site:
Save observations for each reference:
Check latest framework docs — Use context7 to:
resolve-library-id("tailwindcss") then query-docs for relevant new utilitiesresolve-library-id("shadcn-ui") then query-docs for component patternsresolve-library-id("radix-ui") then query-docs for accessible primitivesCheck if user's chosen style has specific implementation patterns:
Synthesize research into Design Direction — Create a comprehensive summary:
Create visual designs using available tools.
Pencil creates .pen files — JSON-based, git-tracked, machine-readable design files
that AI agents can read and write via MCP.
Step-by-step Pencil workflow:
get_guidelines(topic) for design rules
get_style_guide_tags() then get_style_guide(tags)open_document("new") or open existing .pen fileget_editor_state(include_schema=true) — REQUIRED on first use.
This returns the .pen file schema with exact property names and valid values.
Without this, you may use incorrect property names causing alignment/layout bugs.batch_design operations (max 25 per call):
batch_get to find available components)set_variables for reusable design tokensget_screenshot(nodeId) after each major design step
snapshot_layout only detects layout ENGINE problems (node tree clipping).
It does NOT detect visual quality issues. Never rely on it alone.snapshot_layout(problemsOnly=true) as secondary check onlybatch_get to read the problematic nodes' current properties
b. Use batch_design with U() operations to fix alignment, sizing, spacing
c. Take another get_screenshot to confirm the fix
d. Repeat until the screenshot looks correct
Pencil best practices:
batch_get(patterns=[{reusable: true}]) to discover available design kit componentsbatch_design calls to max 25 operations eachget_screenshot after creating screensfind_empty_space_on_canvas to position new frames without overlappingset_variables for consistent themingFollow these rules to avoid common visual issues in .pen files:
Text Alignment:
horizontalAlign: "center" AND textAlign: "center"horizontalAlign: "center", verticalAlign: "center"horizontalAlign: "center", verticalAlign: "center"Container Sizing:
width: "fill_container" over fixed pixel widths for responsive childrenwidth: "fill_container" within their row(container_width - padding*2 - gap*(N-1)) / NOverflow Prevention:
width: "fill_container" for each cell, NOT fixed sizesSpacing Consistency:
gap between elements (e.g., gap: 12)Use Figma MCP when the team already has a Figma design system:
If Pencil and Figma are unavailable:
docs/designs/DES-<NNN>-<desc>/prototype.htmlSave all design artifacts to:
docs/designs/DES-<NNN>-<short-description>/
├── README.md # Design brief, decisions, research findings, rationale
├── design.pen # Pencil design file (git-tracked, machine-readable)
├── desktop.png # Desktop screenshot (1440px)
├── mobile.png # Mobile screenshot (375px)
├── figma-link.md # Figma file/frame URL (if using Figma)
└── references/ # Competitor screenshots and inspiration images
README.md template:
# DES-<NNN>: <Screen/Component Name>
**Status**: Draft | Approved
**Created**: <YYYY-MM-DD>
**Design Tool**: Pencil (.pen) | Figma | HTML Prototype
## Brief
[Summary of what was designed and why]
## Design Decisions
- **Color palette**: [colors used and why]
- **Typography**: [fonts, sizes, hierarchy]
- **Layout**: [grid, spacing, responsive approach]
- **Key interactions**: [hover states, animations, transitions]
## Component Breakdown
| Component | Description | Web (Tailwind) | Mobile (Flutter) |
| --------- | -------------- | --------------------- | ------------------ |
| [name] | [what it does] | [utility classes] | [Widget name] |
## Research Findings
- **Competitor analysis**: [observations from competitor screenshots]
- **Design trends**: [current trends applicable to this design]
- **Framework support**: [relevant Tailwind/shadcn/Radix capabilities discovered via context7]
- **Reference URLs**: [links to inspiring designs found via WebSearch]
## Design Tokens
[If using Pencil, extract via get_variables and list here]
- Primary: #XXXXXX
- Secondary: #XXXXXX
- Background: #XXXXXX
- Text: #XXXXXX
- Font: [family], [sizes]
- Spacing: [scale]
## Design Files
- **Pencil**: `design.pen` (open with Pencil VS Code extension)
- **Figma**: [URL to Figma file/frame] (if applicable)
## Screen → Node ID Mapping
| Screen | Pencil Node ID | .pen File |
| ------ | -------------- | --------- |
| [Screen Name] | `[nodeId]` | `[path/to/file.pen]` |
## Screenshots
- desktop.png — 1440px viewport
- mobile.png — 375px viewport
Present the design and prepare for implementation.
Show the design — present screenshots to the user
Highlight key decisions — explain color, typography, layout choices
Iterate if needed — revise based on feedback
Update status — change README status from "Draft" to "Approved" after approval
Document Screen → Node ID Mapping — in the design README, fill in the "Screen → Node ID Mapping" table with every screen's Pencil node ID:
| Screen | Pencil Node ID | .pen File |
| ------ | -------------- | --------- |
| Home Dashboard | `F2P7Z` | `docs/designs/DES-001/design.pen` |
| Add Habit | `yxjyp` | `docs/designs/DES-001/design.pen` |
This table is the single source of truth for downstream agents (web-dev,
mobile-dev) to find exact design specs via batch_get(nodeIds: ["F2P7Z"]).
Update source requirement doc — if you received a requirement document
(e.g., docs/requirements/REQ-<NNN>.md), append a "Design References" section
at the end linking back to the design artifacts:
## 8. Design References
| Screen / Component | Design Doc | Pencil Node ID |
| ------------------ | ---------- | -------------- |
| Home Dashboard | `docs/designs/DES-001/README.md` | `F2P7Z` |
| Add Habit | `docs/designs/DES-001/README.md` | `yxjyp` |
This ensures anyone reading the requirement doc can immediately find the corresponding designs without searching.
Write memory handoff — update .serena/memories/ouroboros/agents/ui-designer/handoff.md
with your design session results, including the node ID mapping.
Report to caller — when reporting completion (to project-owner or user), you MUST include the full Screen → Node ID Mapping table in your response. This allows the caller to update their own documents.
Handoff instructions — tell the user:
Design approved and saved to
docs/designs/DES-<NNN>-<description>/.When developers implement this, they will reference:
design.pen— machine-readable design spec (via Pencil MCP for exact values)- Screen → Node ID Mapping table for direct
batch_getaccess- Component breakdown table for implementation classes/styles
- Design tokens for consistent theming
When designs are in .pen format, developers can use Pencil MCP to:
batch_get — read exact node properties (spacing, colors, typography, layout)get_variables — extract design tokens for styling configget_guidelines(topic="code") — get code generation guidelines from the designget_guidelines(topic="tailwind") — get Tailwind-specific implementation guidance (web projects)This eliminates guesswork — the coding agent reads the design spec directly instead of interpreting screenshots.
Apply these principles to all designs:
Design with implementation in mind:
get_guidelines(topic="tailwind") provides Tailwind v4 specifics