openpencil-design-files
БесплатноБез исполняемых скриптовНе проверенBuild real .fig design files headlessly via OpenPencil CLI.
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
OpenPencil headless design files
When Figma's API is blocked or out of MCP quota, produce a genuine .fig file by script instead of a screenshot. OpenPencil's eval runs the Figma plugin API headlessly and persists the file — no desktop app, no login.
Standing spec for Do's mobile mock screens
Use these numbers unless he states otherwise; he re-checks them every iteration.
| Item | Value |
|---|---|
| Frame | 390 × 844 (iPhone 13) |
| Font | Plus Jakarta Sans |
| Page title | 24 px, ExtraBold |
| Section title | 18 px, SemiBold |
| Body | 14 px, Medium |
| Label / caption | 12 px |
| Card radius | 16 px |
| Side padding | 20 px |
| Icons | 24 × 24, inline SVG, 1.8 stroke |
Keep one dummy identity across every screen and revision. He asks for the same person repeatedly and counts drift as a defect: Graceia / +12 3456 789 / avatar GR. Do not invent a new name or number per mock, and do not "fix" the number to +62 — it is placeholder data on purpose.
Deliver the .fig plus a 2× PNG preview, and QA the PNG by looking at it (bottom-nav overlap, invisible white-on-white chip text, a value printed twice in one row) before sending.
Setup
mkdir -p ~/op && cd ~/op && npm init -y && npm i @open-pencil/cli
./node_modules/.bin/openpencil --help
Commands: import, eval, export, info, lint.
Working recipe
- Bootstrap an empty document (no
newcommand works offline):printf '<html><body><div style="width:390px;height:844px"></div></body></html>' > blank.html ./node_modules/.bin/openpencil import blank.html -f fig -o base.fig - Write the design as plugin-API JS (frames, text, gradients,
figma.createNodeFromSvgfor icons) inbuild.js, then:
Clear the page first (./node_modules/.bin/openpencil eval base.fig --stdin -w < build.jsfor (const c of [...page.children]) c.remove()) andreturn {...}a small summary — the CLI prints the returned JSON. - Verify visually:
openpencil export base.fig -f png -s 2 -o check.png, then actually look at the PNG.openpencil info base.figprints node/font census. - Ship the
.figplus the PNG preview.
If he specifically wants the screen inside Figma, this file is not enough on its own: Figma's MCP is quota-gated per seat/plan, so check that before promising a canvas write — see mcp-server-integration. A .fig from this CLI opens in OpenPencil and is importable into Figma, but do not claim the Figma import was verified unless it was.
Pitfalls (each cost a failed run)
figma.listAvailableFontsAsync()returns[]headless. Never derive styles from it:pick()returnsundefinedand the loader throwsCannot read properties of undefined (reading 'toLowerCase'). Hardcode{family, style}andawait figma.loadFontAsyncdirectly — it works for system fonts.- Non-default fonts must be installed on the machine: TTF into
~/.local/share/fonts+fc-cache -f. Family and style must match exactly (Plus Jakarta Sans,SemiBold,ExtraBold). gradientTransformmust be{m00,m01,m02,m10,m11,m12}, not a 2×3 array — nodes build fine, then encoding fails withMissing required field "m00".- Alpha in SOLID fills is dropped (
{...rgb(hex), a:0.14}renders opaque, so white text vanishes). Pre-blend to an opaque hex. - Do not
importa finished HTML page. Absolute layouts collapse, gradients and SVG icons vanish, nav jumps to the top. HTML import is only for bootstrap; fidelity comes fromeval. - After a failed save, re-import
blank.htmlbefore retrying —base.figis left half-written.
Установить openpencil-design-files в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл openpencil-design-files?
Build real .fig design files headlessly via OpenPencil CLI.
Как установить скилл openpencil-design-files?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openpencil-design-files запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic