# OpenPencil Files

Inspects, edits and exports Figma .fig files and controls OpenPencil.

- Repository: https://github.com/open-pencil/open-pencil (9527 stars)
- Category: Design
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add open-pencil/open-pencil --skill open-pencil -g -a claude-code -y`
Codex: `npx skills add open-pencil/open-pencil --skill open-pencil -g -a codex -y`
Cursor: `npx skills add open-pencil/open-pencil --skill open-pencil -g -a cursor -y`
Gemini CLI: `npx skills add open-pencil/open-pencil --skill open-pencil -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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
```

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](https://openpencil.dev/reference/cli) and [MCP guide](https://openpencil.dev/programmable/mcp-server) 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`.

The rest: https://github.com/open-pencil/open-pencil/blob/HEAD/skills/open-pencil/SKILL.md
