本文へスキップ
Skillpedia
インターフェース(UI/UX)9.5k · #12225

open-pencil

できること

このスキルは、AIが.figのデザインファイルとOpenPencilエディタで作業できるようにします。構造の読み取り、画像の書き出し、デザインの変更を含みます。対象は、これらのファイルを扱うデザイナーや開発者です。

使う場面

  • ✓AIに.figのデザインファイルを開いたり調べたりしてほしいとき。
  • ✓デザインをPNG、SVG、PDF、JSXとして書き出したいとき。
  • ✓デザインのトークンを分析したり、スクリプトからデザインを変えたりしたいとき。

スキルのリンク

https://github.com/open-pencil/open-pencil/blob/master/skills/open-pencil/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/open-pencil/open-pencil/blob/master/skills/open-pencil/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“このデザインファイルのログインのフレームを、SVGとして書き出してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルは、二つの方法で動きます。すでに開いているOpenPencilアプリに接続するか、あなたが名指しした.figファイルを直接扱うかです。OpenPencilのコマンドラインツールとそのMCPサーバーを使って、デザインを読み、変えます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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.
# App mode — operates on the document open in the editor
openpencil tree

# Headless mode — operates on a .fig file
openpencil tree design.fig

Use openpencil --help, per-command help, and the connected MCP server’s tool schemas to check the installed version’s capabilities. See the CLI reference and MCP guide for current documentation.

Variable formulas

Inside eval, use openpencil.setVariableFormula('Spacing', 'large', '{base} * 2') for numeric formulas or openpencil.setVariableFormula('State', 'visible', '{viewport} > 1024 and not {loading}') for Boolean formulas, which use and, or, not and number comparisons. Collections and variables must already exist. An optional fourth argument selects a mode by name; otherwise the default mode is edited. The call validates before mutation and returns the resolved value. Length formulas use stored pixels. The CSS stylesheet writes number formulas as calc(); design-token files hold the result with the formula in $extensions.

Variables follow Figma's plugin API: figma.variables.getLocalVariables(), createVariable(name, collection, type), variable.setValueForMode(modeId, value), and node.setBoundVariable(field, variable) with Figma's field names (characters, width, paddingLeft) and types; paint colours bind through figma.variables.setBoundVariableForPaint. To bind as the layer panel does, use openpencil.bindVariable(node, field, variable) and openpencil.unbindVariable(node, field) with OpenPencil names (text, visible, opacity, fills/0/color): text content takes a text or number variable, shown as text; visibility a boolean or text one. openpencil also sets layout and text direction (setLayoutDirection, setTextDirection), OkHCL paint colors (setFillOkHCL, setStrokeOkHCL), writes styled text from Markdown (setTextMarkdown(text, markdown), or set_text with markdown: true), exposes instance swaps (exposeInstanceSwap), and reports font availability (getFontStatus()); booleans and flattening are Figma's figma.union, subtract, intersect, exclude and figma.flatten.

Requirements

# 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

openpencil --help

Common commands:

  • 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
  • tokens — variables as a CSS custom-property stylesheet, a Tailwind v4 theme, or W3C design token files (--format dtcg --out <folder>)
  • 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
  • tool — list, describe, and call any MCP tool from the shell, in app or headless mode
  • documents — list, open, create, save, close, and activate documents in the running app
  • undo / redo — step back through your own (automation) changes in the running app
  • settings — read and change editor settings in the running app

Inspect

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 --
よくある質問

アプリを開いておく必要がありますか?

いいえ。ファイルのパスを渡せばファイルを直接扱えます。省くと、開いているアプリを使います。

私のデザインを変えられますか?

はい。プログラムでデザインを変えられるので、変更後は結果を確認してください。

コマンドはどこで学べますか?

スキルは、インストールされている版のOpenPencilのコマンドラインのヘルプとリファレンスを示します。

詳細

作者による元の説明

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.

repo: open-pencil/open-pencil

人気

GitHubのスター
9.5k
ランキング
#12225
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

似ているスキル