Skip to content
Skills Library
Design & UX · Conversion & formats

prepare-figma-design

/prepare-figma-design

Use when you have a figma.com link or a local .fig export, and someone needs to build that design — including when you will build it yourself. One command turns it into the design's structure, its materials named as your own design tokens, the text of every node and the bitmaps it uses, as three files to commit. No Dev Mode seat: a read-only personal access token, or no credential at all from a .fig. Hand those files to implement-figma-design, which needs no Figma access.

Author
pixiv ↗
Repository
charcoal ↗
Licence
Apache-2.0
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
9
Scripts
8
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What to check before installing
  • 8 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: bin/design.mjs, bin/fetch-design.mjs, bin/fetch-design.test.ts, bin/fig.mjs, bin/fig.test.ts, bin/figma.mjs, bin/kiwi.mjs, bin/tokens.mjs

What it does and when to use it

Use when you have a figma.com link or a local .fig export, and someone needs to build that design — including when you will build it yourself. One command turns it into the design's structure, its materials named as your own design tokens, the text of every node and the bitmaps it uses, as three files to commit. No Dev Mode seat: a read-only personal access token, or no credential at all from a .fig. Hand those files to implement-figma-design, which needs no Figma access.

Original author description

Use when you have a figma.com link or a local .fig export, and someone needs to build that design — including when you will build it yourself. One command turns it into the design's structure, its materials named as your own design tokens, the text of every node and the bitmaps it uses, as three files to commit. No Dev Mode seat: a read-only personal access token, or no credential at all from a .fig. Hand those files to implement-figma-design, which needs no Figma access.

How it works

  1. Do this
  2. Then hand it over
  3. Every file it touches
  4. What you are handing over
Original SKILL.md headings · 166 lines, 1,323 words
SKILL.md preview
---
name: prepare-figma-design
description: Use when you have a figma.com link or a local .fig export, and someone needs to build that design — including when you will build it yourself. One command turns it into the design's structure, its materials named as your own design tokens, the text of every node and the bitmaps it uses, as three files to commit. No Dev Mode seat: a read-only personal access token, or no credential at all from a .fig. Hand those files to implement-figma-design, which needs no Figma access.
---

# Getting a Figma design out of Figma, once, for everyone

A design link holds two different things: where everything sits, and what everything is
made of. What an implementer wants is both, joined, with your own token names on the
materials — and nothing else. This emits exactly that, from Figma's free REST API.

It is deliberately a separate step from building the screen, because the two jobs need
different things. This one needs a Figma credential and access to the file. Building the
screen needs neither.

```mermaid
flowchart LR
    subgraph prep["prepare-figma-design — the only step that touches Figma"]
        link[Figma link<br>--url, needs a token] -->|fetch-design.mjs| pack[design.md<br>spec.json<br>assets/]
        fig[".fig export<br>--fig, needs nothing"] -->|fetch-design.mjs| pack
    end
    subgraph impl["implement-figma-design — needs no Figma access"]
        build[Build the screen] --> check{check-design.mjs}
        check -->|what is off| build
        check -->|matches| done[Done]
    end
    pack -->|commit, hand over| build
```

Run this once and commit what it writes. Whoever builds the screen — a teammate, an
agent, you tomorrow — works from those files and never needs the token, the file
permission, or a seat.

If you also have Figma's MCP and a Dev Mode seat, **still do not hand over
`get_design_context`.** It returns reference markup, and building from markup means
transliterating it: the implementer rewrites someone else's DOM instead of building the
design, and inherits a structure that was never meant to be code — wrapper divs that
exist for Figma's layout engine, absolute positioning where the design means a gap.

## Do this

There are two ways in, and they produce the same three files. Use the link if you can
reach the file; use a `.fig` when you have no token, when Figma is unreachable, or when
you want a pack rebuildable from something committed.

### From a link

A read-only personal access token is enough, created at Figma Settings → Security →
Personal access tokens. No Dev Mode seat is needed.

The token is read from `FIGMA_TOKEN` in the environment. Ask whoever is running this to
put it there — a shell profile, a `.env` the project already loads, whatever they use for
credentials. Do not paste it into the command: an inline assignment lands in shell
history and in the environment of every process started from that shell.

```bash
node <this-skill>/bin/fetch-design.mjs \
  --url "https://www.figma.com/design/<key>/<name>?node-id=36-6579" \
  --tokens node_modules/@charcoal-ui/theme/src/json \
  --assets design/assets \
  --spec design/spec.json \
  > design/design.md
```

`<this-skill>` is wherever this skill was installed:
`${CLAUDE_PLUGIN_ROOT}/skills/prepare-figma-design` under the Claude Code plugin,
`.claude/skills/prepare-figma-design` or `.agents/skills/prepare-figma-design` under
`npx skills`.

### From a `.fig`

File → Save local copy in Figma writes a `.fig`: the whole document, and every bitmap in
it. Reading one needs no token, no network and no access to the original file — the
bitmaps come straight out of the archive instead of being downloaded.

```bash
node <this-skill>/bin/fetch-design.mjs \
  --fig design.fig \
  --node 110-8609 \
  --tokens node_modules/@charcoal-ui/theme/src/json \
  --assets design/assets \
  --spec design/spec.json \
  > design/design.md
```

`--node` is required here and takes the `node-id` from the frame's link, because a
`.fig` holds the whole file and there is no one frame to default to. Right-click the
frame in Figma → Copy link to get it.

Two things to know. It needs Node 22.15 or newer, because a recent export compresses its
document with zstd. And it reads the design as the export froze it, so a `.fig` taken
last month describes last month's design however current the link looks.

### Either way

`--tokens` points at your design system's Style Dictionary JSON. Without it values come
out literally; with it, every value the system has a token for is named as that token. A
path that holds no tokens is an error rather than a pack full of raw hex.

`--theme light|dark` picks which theme file to resolve against, defaulting to `light`.
The other theme's values are left out entirely, so a light design never gets named with
a dark token.

`--assets` downloads the design's bitmaps and names each on the box that paints it,
together with the `object-fit` its crop implies. Leave it out and the pack describes the
boxes without the images.

`--spec` writes the same design as facts a script can compare a render against. Pass it:
it is what lets the implementer check their own work, and it costs nothing to produce
here. Without it they can build the screen but cannot tell when they are done.

## Then hand it over

Commit all three — `design/design.md`, `design/spec.json`, `design/assets/` — and point
whoever is building at `implement-figma-design`. They are the complete input. Nothing
else from Figma is needed, and no part of this step has to be repeated until the design
itself changes.

Say which frame it is and which theme you resolved against. `--theme dark` and
`--theme light` produce different token names for the same drawing, and nothing in the
pack records which you picked.

**Re-run this when the design changes, not when the implementation does.** The pack is a
snapshot of one frame as the designer drew it; a stale pack is worse than none, because
the check loop will keep reporting a screen as wrong when it is the design that moved.

## Every file it touches

Nothing is written anywhere you did not name. There is no cache, no temp directory, and
nothing is ever written inside `node_modules` — the outputs describe _your_ screen, so
they belong in your repository next to the code they explain, where a reviewer can see
what the implementation was built from.

| Path                        | R/W   | What                                                                                                                                                             |
| --------------------------- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `FIGMA_TOKEN` (environment) | read  | The credential, for `--url` only. Read only when a request is about to be made, never stored. Never read on the `--fig` route.                                   |
| `--fig <file>`              | read  | A local Figma export. The only input the `--fig` route has: no network call is made at all.                                                                      |
| `--tokens <dir>`            | read  | Your design system's Style Dictionary JSON. For charcoal: `node_modules/@charcoal-ui/theme/src/json`. Read-only; one `*.json` per theme plus the shared palette. |
| stdout                      | write | The pack. Redirect it where you want it — the examples use `design/design.md`.                                                                                   |
| `--spec <path>`             | write | The same design as facts `check-design.mjs` can compare a render against. Only written when the flag is given.                                                   |
| `--assets <dir>/`           | write | The design's bitmaps, one file per image, named from its Figma reference. The directory is created if it is missing. Only written when the flag is given.        |

Why the tokens come from the JSON rather than charcoal's generated `light.css`: the CSS
keeps each token as a reference to another token (`var(--charcoal-color-light-blue-50)`)
where this needs the literal a Figma color can be matched against, and it flattens
`text/on-primary/default` into `text-on-primary-default`, losing the `/` boundaries that
tell a role from a state from a palette entry.

## What you are handing over

```
- instance "Icon Button" 32×32 at (296, 8) — `Size=S, Type=Default, State=Default`
  flex-direction: row; padding: var(--charcoal-space-10); border-radius: var(--charcoal-radius-oval)
  - instance "24 / Close" 24×24 at (300, 12) — `24 / Close`
    - vector "Shape" 14×14 at (305, 17)
      color: var(--charcoal-color-icon-tertiary-default)
```

Each line is one element: its box, then its materials, then the component and variant it
came from. `implement-figma-design` explains how to read it; what matters here is that
it is complete without Figma, and that there is no markup in it on purpose.

A fill the design system cannot name — a gradient, a pattern — is written as what it
is, `background: linear gradient /* ... */`, rather than left out. A box painted with a
gradient must not read like a box painted with nothing.

If the pack comes out full of raw hex, `--tokens` is pointing at the wrong directory —
fix that before handing it over, because a literal reads as "the design system has no
word for this" and sends the implementer looking for one that does not exist.
Files in this package (9)
  • SKILL.md 9 KB
  • bin/design.mjs 15 KB
  • bin/fetch-design.mjs 12 KB
  • bin/fetch-design.test.ts 18 KB
  • bin/fig.mjs 19 KB
  • bin/fig.test.ts 5 KB
  • bin/figma.mjs 6 KB
  • bin/kiwi.mjs 6 KB
  • bin/tokens.mjs 15 KB

Versions

The database has no other skills named prepare-figma-design.

Database snapshot: 13.11.2026 · package version b2a830d6dc7f (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100implement-figma-design
    Use when building a screen from a prepared Figma design pack — a design.md, a spec.json and an assets/ directory produced by prepare-figma-design — and when checking that what you built matches it. Needs no Figma access, no token and no Dev Mode seat. If there is no pack yet,…
  • 100fig-to-html
    This skill should be used when the user asks to "convert this .fig to HTML", "build HTML from this Figma file", "turn these Figma frames into a page", "read this .fig", "make the handoff from the Figma export", or otherwise supplies a Figma `.fig` export (or a folder it was…
  • 100figma-fetch
    Extract frame/component structure and all visible text from a Figma design URL. Use whenever a prompt or a fetched issue contains a figma.com/design or figma.com/file link.
  • 100figma
    Use when working with Figma as the design source for a design system — including Variables, Dev Mode, Code Connect, the REST API, and MCP-based design-to-code workflows. USE FOR: Figma Variables, Figma Dev Mode, Code Connect, Figma REST API, Tokens Studio plugin, Figma MCP…
  • 100open-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.
  • 100open-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.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.