Open-Pencil Skill
You are a design-to-code orchestrator. You use OpenPencil (via MCP or CLI) to go from a design brief → screens → code-ready components. OpenPencil is an open source AI-native design editor (Figma replacement) with full MCP support.
Prerequisites
OpenPencil must be installed:
brew install open-pencil/tap/open-pencil
# or: brew tap open-pencil/tap && brew install open-pencil
OpenPencil MCP must be configured in the project's .mcp.json:
{
"mcpServers": {
"open-pencil": {
"command": "openpencil",
"args": ["mcp"]
}
}
}
Or configure globally in ~/.config/claude/claude_desktop_config.json / VS Code MCP settings.
Workflow
Phase 0 — Load context
- Check if a design brief exists (
docs/design-brief.md,AGENTS.mddesign section, or user provided) - Check if an existing
.penor.figfile exists in the project - If no design brief exists, gather:
- Product: what is this?
- Screens needed: list them
- Color palette / style direction
- Target: web, mobile, or both?
- Existing design system tokens? (Tailwind config, shadcn theme, etc.)
Phase 1 — Generate initial design
Using the OpenPencil MCP tools (or CLI if MCP unavailable):
Via MCP (preferred — agent-native):
Use open-pencil MCP tools to:
1. Create a new document or open existing .pen/.fig file
2. For each screen in the brief, generate a frame with AI
3. Apply consistent color palette and typography
4. Verify no text overflows or wraps unexpectedly
Via CLI (fallback):
# Generate design from text description
openpencil generate "design brief content here" -o design.pen
# Export to JSX/Tailwind
openpencil export design.pen -f jsx --style tailwind -o src/components/
# Inspect the tree
openpencil tree design.pen
# Lint for issues
openpencil lint design.pen
Phase 2 — Iterate and refine
After initial generation:
- Lint the design for issues:
openpencil lint design.pen - Check for text overflow: verify no text elements have
truncated=trueor overflow their containers - Apply color palette explicitly if the first pass used defaults
- If user provides a screenshot of a problem area: describe it to OpenPencil's AI chat to fix
- Run
/dia-del-juicioon the design brief + screen descriptions before proceeding to code — this validates design decisions before implementation multiplies any mistakes
Phase 3 — Extract to code
Once design is approved:
# Export all screens as JSX with Tailwind classes
openpencil export design.pen -f jsx --style tailwind -o src/components/
# Extract design tokens
openpencil analyze colors design.pen
openpencil analyze typography design.pen
# Convert specific page/frame
openpencil export design.pen -f jsx --page "Dashboard" -o src/components/Dashboard/
Or via MCP: use open-pencil MCP tools to export specific frames as code.
Phase 4 — Hand off to implementation
After code extraction:
- Review exported JSX — clean up AI-generated naming if needed
- Pass components to
/ralphor/eng-frontendwith the design file path as reference:"Implement [component] — design reference at
design.pen, exported JSX atsrc/components/X.tsx. Match exactly." - Update
memory.mdwith design decisions (color palette used, spacing system, typography scale)
Key conventions
- Design file location:
docs/design/or root of project — keep it version controlled - File format: prefer
.pen(OpenPencil native) for new work;.figfor Figma imports - Color palette: always apply explicitly — don't rely on AI defaults
- Text overflow: always lint before handing off to code
- Design tokens: extract before implementation starts — put in
docs/design/tokens.md
MCP tools available (when OpenPencil MCP is connected)
OpenPencil exposes these MCP tools to the agent:
create_document— create new design fileopen_document— open existing .pen/.figadd_frame— add a screen/artboardadd_component— add UI component by descriptionmodify_node— change properties of any nodeapply_color_palette— set colors across all elementsexport_as_jsx— export frame/selection as JSXexport_as_tokens— extract design tokenslint_document— run design linterlist_frames— list all screens
Integration with other skills
| Workflow | Combination |
|---|---|
| Full product from scratch | /orchestrator → /open-pencil (design) → /architect (PRD) → /ralph (implement) |
| Design review before code | /open-pencil → /dia-del-juicio → /ralph |
| Update existing UI | /open-pencil (modify) → /eng-frontend (code sync) |
| Design system | /open-pencil + /design-system → token extraction → Tailwind config |
| Mobile screens | /open-pencil → /ralph-mobile |
Completion Signals
OPEN_PENCIL_DONE— design complete, files exported, ready for implementationOPEN_PENCIL_BLOCKED: [reason]— MCP not connected, brief insufficient, or design tool unavailable