open-pencil
Fungsinya
Skill ini memungkinkan AI Anda bekerja dengan berkas desain .fig dan editor OpenPencil, termasuk membaca strukturnya, mengekspor gambar, dan mengubah desain. Ditujukan untuk desainer dan pengembang yang bekerja dengan berkas ini.
Kapan dipakai
- βSaat Anda meminta AI Anda membuka atau memeriksa berkas desain .fig.
- βSaat Anda ingin sebuah desain diekspor sebagai PNG, SVG, PDF, atau JSX.
- βSaat Anda ingin token desain dianalisis atau sebuah desain diubah dari skrip.
Link skill
https://github.com/open-pencil/open-pencil/blob/master/skills/open-pencil/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βEkspor frame Login dari berkas desain ini sebagai SVG.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill bekerja dengan dua cara. Ia dapat terhubung ke aplikasi OpenPencil yang sudah terbuka, atau bekerja langsung pada berkas .fig yang Anda sebutkan. Skill memakai alat baris perintah OpenPencil dan server MCP-nya untuk membaca serta mengubah desain.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
.figfiles 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, fontstreeβ print hierarchy with types and sizespagesβ list pagesnodeβ detailed node properties by IDselectionβ current selection from the running appfindβ find nodes by name/typequeryβ XPath selectors for node searchvariablesβ list variables and collectionstokensβ 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/.figconvertβ convert between supported document formatsanalyzeβ colors, typography, spacing, repeated clusterslintβ consistency, structure, and accessibility checksformatsβ supported document/export formatsevalβ execute JavaScript with the Figma Plugin APItoolβ list, describe, and call any MCP tool from the shell, in app or headless modedocumentsβ list, open, create, save, close, and activate documents in the running appundo/redoβ step back through your own (automation) changes in the running appsettingsβ 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 --
Pertanyaan umum
Apakah aplikasinya harus terbuka?
Tidak. Anda dapat memberikan jalur berkas untuk bekerja langsung pada berkas, atau tidak memberikannya untuk memakai aplikasi yang terbuka.
Bisakah ia mengubah desain saya?
Bisa. Ia dapat memodifikasi desain secara terprogram, jadi periksa hasilnya setelah perubahan.
Di mana saya bisa mempelajari perintahnya?
Skill mengarahkan ke bantuan dan referensi baris perintah OpenPencil untuk versi yang Anda pasang.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 9.5k
- Peringkat
- #12225
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill serupa
canvas
394kMemungkinkan agent Anda menampilkan widget visual yang di-hosting di panel Mac yang terhubung, lalu menyembunyikan panel atau memindahkannya ke halaman lain.
control-ui
394kMembantu agent Anda mengatur dan memecahkan masalah OpenClaw Control UI, termasuk sesi, dasbor, dan Gateway yang terhubung.
diagram-maker
394kMembantu agent Anda membuat diagram yang jelas sebagai SVG, HTML, atau Excalidraw yang dapat diedit untuk proses, arsitektur sistem, dan sketsa papan tulis.