open-pencil
Work with Figma .fig design files and the running OpenPencil editor — inspect structure, query nodes, analyze design tokens, export PNG/SVG/PDF/JSX, and modify designs programmatically. Use when asked to open, inspect, export, analyze, or edit .fig files, or to control the running OpenPencil app.
What this skill does
# OpenPencil OpenPencil provides a CLI and MCP server for `.fig` design files and the running OpenPencil editor. Use two modes: - **App mode** — connect to the running OpenPencil editor by omitting the file argument. - **Headless mode** — work with `.fig` files directly by passing a file path. ```bash # App mode — operates on the document open in the editor openpencil tree # Headless mode — operates on a .fig file openpencil tree design.fig ``` Current reference version: OpenPencil `0.12.x`. The MCP server exposes 106 tools in `0.12.0`. ## Requirements ```bash # CLI bun add -g @open-pencil/cli # MCP server used by the desktop app and external MCP clients bun add -g @open-pencil/mcp ``` The desktop app starts `openpencil-mcp-http` automatically in production Tauri builds when `@open-pencil/mcp` is installed globally and exposes automation on: - HTTP/RPC: `http://127.0.0.1:7600` - WebSocket bridge: `ws://127.0.0.1:7601` - MCP Streamable HTTP: `http://127.0.0.1:7600/mcp` ## CLI Commands ```bash openpencil --help ``` Commands in `0.12.x`: - `info` — document overview: pages, node counts, fonts - `tree` — print hierarchy with types and sizes - `pages` — list pages - `node` — detailed node properties by ID - `selection` — current selection from the running app - `find` — find nodes by name/type - `query` — XPath selectors for node search - `variables` — list variables and collections - `export` — export PNG/JPG/WEBP/SVG/PDF/JSX/.fig - `convert` — convert between supported document formats - `analyze` — colors, typography, spacing, repeated clusters - `lint` — consistency, structure, and accessibility checks - `formats` — supported document/export formats - `eval` — execute JavaScript with the Figma Plugin API ### Inspect ```bash openpencil info design.fig openpencil tree design.fig openpencil tree --page "Components" --depth 3 # app mode openpencil pages design.fig openpencil node design.fig --id 1:23 openpencil node --id 1:23 # app mode openpencil selection --json openpencil variables design.fig openpencil variables --collection "Colors" --type COLOR ``` ### Search and XPath query ```bash openpencil find design.fig --name "Button" openpencil find --type FRAME # app mode openpencil find design.fig --type TEXT --page "Home" openpencil find design.fig --name "Card" --type COMPONENT --limit 50 openpencil query design.fig "//FRAME" openpencil query design.fig "//FRAME[@width < 300]" openpencil query design.fig "//TEXT[contains(@name, 'Button')]" openpencil query design.fig "//COMPONENT[@stackMode]" openpencil query design.fig "//COMPONENT//FRAME//TEXT" openpencil query "//FRAME[@width > 1000]" # app mode ``` Common node types: `FRAME`, `TEXT`, `RECTANGLE`, `ELLIPSE`, `VECTOR`, `GROUP`, `COMPONENT`, `COMPONENT_SET`, `INSTANCE`, `SECTION`, `LINE`, `STAR`, `POLYGON`, `SLICE`, `BOOLEAN_OPERATION`. ### Export and convert ```bash openpencil export design.fig -o hero.png openpencil export -o hero.png # app mode openpencil export design.fig --node 1:23 -s 2 -o [email protected] openpencil export design.fig -f jpg -q 85 -o preview.jpg openpencil export design.fig -f svg --node 1:23 -o icon.svg openpencil export design.fig -f pdf -o page.pdf openpencil export design.fig -f fig -o roundtrip.fig openpencil export design.fig -f jsx -o component.jsx openpencil export design.fig -f jsx --style tailwind -o component.tsx openpencil export design.fig --thumbnail --width 1920 --height 1080 openpencil export --page "Components" -o components.png openpencil convert design.fig -o design.pen openpencil formats ``` ### Analyze and lint ```bash openpencil analyze colors design.fig openpencil analyze colors --similar --threshold 10 # app mode openpencil analyze typography design.fig --group-by size openpencil analyze spacing design.fig --grid 8 openpencil analyze clusters design.fig --min-count 3 openpencil lint design.fig openpencil lint design.fig --json ``` ### Eval (Figma Plugin API) Execute JavaScript against the document using a Figma Plugin API-compatible runtime: ```bash openpencil eval design.fig -c 'figma.currentPage.findAll(n => n.type === "TEXT").length' # App mode — modifies the live document in the editor openpencil eval -c ' const buttons = figma.currentPage.findAll(n => n.name === "Button"); buttons.forEach(b => { b.cornerRadius = 8 }); buttons.length + " buttons updated" ' # Modify and save to the same file openpencil eval design.fig -w -c ' const texts = figma.currentPage.findAll(n => n.type === "TEXT"); texts.forEach(t => { t.fontSize = 16 }); ' # Save to a different file openpencil eval design.fig -o modified.fig -c '...' # Read code from stdin echo 'figma.currentPage.children.map(n => n.name)' | openpencil eval design.fig --stdin ``` Every command that reports structured data supports `--json` when appropriate. ## MCP Server ### Stdio MCP clients Use Bun by default: ```json { "mcpServers": { "open-pencil": { "command": "bunx", "args": ["openpencil-mcp"] } } } ``` If `@open-pencil/mcp` is installed globally, direct binaries also work: ```json { "mcpServers": { "open-pencil": { "command": "openpencil-mcp" } } } ``` ### HTTP / Streamable HTTP ```bash export PORT=7600 export OPENPENCIL_MCP_AUTH_TOKEN=secret # optional auth for /mcp export OPENPENCIL_MCP_CORS_ORIGIN="*" # optional CORS export OPENPENCIL_MCP_ROOT=/path/to/files # enables/scopes open_file/save_file paths openpencil-mcp-http # or: bunx openpencil-mcp-http ``` ### MCP workflow 1. **Open/create a document** — `open_file { path }` when `OPENPENCIL_MCP_ROOT` is configured, or `new_document {}`. 2. **Query** — `get_page_tree`, `find_nodes`, `query_nodes`, `get_node`, `list_pages`, `get_current_page`. 3. **Inspect** — `get_jsx`, `diff_jsx`, `describe`, `export_image`, `export_svg`, `export_pdf`. 4. **Modify** — `render`, `batch_update`, `update_node`, `set_fill`, `set_layout`, `create_shape`, `import_svg`, etc. 5. **Navigate** — after creating or editing visible canvas content, call `select_nodes` and `viewport_zoom_to_fit { id }` (or `node_bounds` + `viewport_set`) so the user can see the result in the running editor. 6. **Save/export** — `save_file`, `export_image`, `export_svg`, `export_pdf`, or CLI `export`. ## MCP Tools in 0.12.0 (106 total) **Read and selection (17):** `get_selection`, `get_node`, `find_nodes`, `get_page_tree`, `get_current_page`, `list_pages`, `select_nodes`, `query_nodes`, `get_components`, `switch_page`, `page_bounds`, `list_fonts`, `list_available_fonts`, `get_jsx`, `diff_jsx`, `describe`, `node_tree` **Create and import (12):** `render`, `create_shape`, `create_component`, `create_instance`, `create_page`, `create_vector`, `create_slice`, `import_svg`, `search_icons`, `insert_icon`, `fetch_icons`, `stock_photo` **Modify (24):** `update_node`, `batch_update`, `set_layout`, `set_layout_child`, `set_radius`, `set_fill`, `set_stroke`, `set_text`, `set_text_properties`, `set_effects`, `set_opacity`, `set_font`, `set_visible`, `set_constraints`, `set_rotation`, `set_minmax`, `set_font_range`, `set_text_resize`, `set_blend`, `set_locked`, `set_stroke_align`, `set_image_fill`, `set_variable`, `bind_variable` **Structure (16):** `delete_node`, `reparent_node`, `node_resize`, `clone_node`, `node_move`, `rename_node`, `group_nodes`, `ungroup_node`, `flatten_nodes`, `node_to_component`, `node_bounds`, `node_ancestors`, `node_children`, `node_bindings`, `node_replace_with`, `arrange` **Variables (9):** `list_variables`, `list_collections`, `get_variable`, `find_variables`, `create_variable`, `delete_variable`, `get_collection`, `create_collection`, `delete_collection` **Vector and viewport (15):** `boolean_union`, `boolean_subtract`, `boolean_intersect`, `boolean_exclude`, `path_get`, `path_set`, `path_scale`, `path_flip`, `path_move`, `viewport_get`, `viewport_set`, `viewport_zoom_to_fit`, `export_svg`, `export_
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.