/craft:craft-syncfrom craft
Syncs design tokens and components between code and design tools (Figma, Penpot, Paper). Imports code's design system into the tool or exports tool changes back to code as a reviewed diff.
Ships in craft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When a design system already lives in code, the design tool should mirror it, not reinvent it.
A small file at the project root, design-sync.json, remembers what was last synced. Code stays the source of truth until the person says otherwise: changes are drawn first in the tool and land in code through an approved export.
craft-setup and craft hand off to this.craft-system (create mode).design-sync.json for that name, say what it affects.DESIGN.md (Brand says where the system lives) and design-sync.json if they exist.references/adapters/ (paper.md, pen.md, figma.md, penpot.md, html.md). If no adapter matches your tool, do the same verbs in your tool and say which you mapped by hand. With no design tool at all, build in HTML (html.md). If an image is all you have, say that values read from it are estimates.design-sync.json{
"source": "packages/ui/tokens.css",
"tool": "paper: file 'Fieldnote', page 'Guide'",
"naming": "CSS custom property names as written in the source",
"synced": "2026-11-15",
"tokens": { "--color-accent": "#2e6b57", "--radius-md": "10px" },
"components": { "Button": "drawn", "Badge": "drawn", "Input": "in code only" }
}
tokens holds the values both sides agreed on at the last sync, and only those.components entry.Detect with the signals. Find the source of truth for values (the token source, not a generated output) and the naming rule the tool will use. Two UI packages → list both and ask which is the source.
Inventory, then stop. Use the inventory format:
Ask which components to draw now, suggesting 3–6 for the next screens, and how to settle each conflict. Never draw everything by default.
Build in the tool after the answers:
drawn / in code only), with variants filled in once drawn;Self-check. Render the guide. If the code can render the component (Storybook, a demo page), compare at the same size. Otherwise say the values were read from code, unrendered.
Record:
design-sync.json (all token values now equal on both sides, plus component statuses);DESIGN.md, Brand gets "Design system source: <path>; the guide mirrors it", and the Decisions log gets a dated import line;DESIGN.md, create one whose first line is <!-- sync record only: run craft-setup for the brief --> with just Brand and the Decisions log. craft treats a DESIGN.md without a Product section as missing.craft)The person already agreed to mirror the system, so there's no inventory stop:
components entry to drawn;tokens alone.If the tool has no guide yet, or the person never agreed to an import (or declined it), ask once: "Input exists only in code. Import it into the guide first?"
Read the guide's values (adapter) and the code's values, by name.
Classify every name with design-sync.json and the diff format:
With no design-sync.json, list every difference and ask the direction for each.
Propose the edits to the source files (never a generated output): file and line, what each affects, and the contrast for colours. "Proposed" states and substituted fonts aren't changes to export. Stop.
Apply only what was approved, update the guide for anything decided in the code's favour, and run the project's checks (lint, typecheck, tests, visual tests), or say there are none.
Record:
design-sync.json with the values now equal on both sides;DESIGN.md › Decisions log;| Rule | Why |
|---|---|
| Same names in code and tool, by one written naming rule | One name per decision; no mapping to drift |
design-sync.json records only agreed values | Without the last agreed value, "who changed it?" is a guess |
| Inventory and pick before drawing; conflicts listed there | Big packages and existing tool tokens need the person's say |
| Values from code, never from screenshots | Screenshots round colours and sizes |
| Missing states drawn as "proposed" | The guide must not claim the code does what it doesn't |
| Export proposes, then stops; edits the source, not generated output | Code ships to users; a generated file is overwritten by the next build |
| Both changed → ask | Overwriting either side loses someone's decision |
| Code is the source of truth until the person says otherwise | Matches "code beats a stale brief" |
design-sync.json and DESIGN.md written.design-sync.json updated, conflicts decided or open.| Thought | Reality |
|---|---|
| "The code has the system, so setup only needs the brief" | Offer the import, or the tool never gets a guide and screens drift from the code. |
| "I'll build foundations and an index, components later" | Show the inventory and ask which components to draw now. |
"I'll rename --sand-200 to a role name while importing" | Keep the code's name; propose a role as an open question. |
"The tool already has --color-accent, I'll update it" | That's a conflict for the inventory stop, not a silent overwrite. |
| "Guide and code differ, so the guide is out of date" | Check design-sync.json: it may be the person's unexported change. |
| "The diff is tiny, I'll just apply it" | Propose, stop, then apply and run the project's checks. |
references/adapters/figma.md (opens in a new tab)references/adapters/html.md (opens in a new tab)references/adapters/paper.md (opens in a new tab)references/adapters/pen.md (opens in a new tab)references/adapters/penpot.md (opens in a new tab)references/detect.md (opens in a new tab)references/export-diff.md (opens in a new tab)references/inventory.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/craftUse when asked to design, create, mock up or redesign one or more pages, screens, flows or UI elements, or when the person runs /craft (/craft:craft in the Claude Code plugin)./craft-critiqueUse when asked to review, critique, refine or polish a design or screen, when something "feels off", "looks busy" or "isn't good yet", after finishing a screen and before showing it, or before handing a design to code./craft-exploreUse when asked for options, alternatives, variations, directions or "a few ideas" for a screen, flow or element, when the person rejects a design or says they don't like it, or says "rethink this", "try something else" or "design both so I can pick".npx claudepluginhub diego3g/craft --plugin craftOther plugins' skills for the same job