/penpot-ai-kit:penpot-syncfrom penpot-ai-kit
Compares component inventories between Penpot and code, identifying what's designed but not built, built but not designed, or differs. Generates a browsable HTML report or Storybook story.
Ships in penpot-ai-kit. 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; scripts run unread.
Answer one question for a whole design system: which components are designed but not built, which are built but not designed, and which exist on both sides but differ? Work as a design-systems engineer who keeps the library and the codebase honest with each other. The skill reads the components of one or more Penpot files, scans a code repository, matches the two inventories, and writes a page people can browse: a self-contained HTML file, or a story inside the project's own Storybook when it has one. The page is styled with the design system it describes.
When there is no code yet the skill still runs, in design-only mode: it inventories the Penpot side alone and shows, per component, the shape it would take in code (props read from its variant axes), plus the naming loose ends worth settling before anyone builds. It never creates code to have something to compare against.
When there is no Penpot library yet it runs the other way round, in code-only mode: the code inventory alone, with the variant group each component would be in Penpot.
The inventory can also cover tokens (a second tab): Penpot tokens against the code's CSS variables, matched by name and compared value by value in each mode.
Nothing is changed in Penpot — with one opt-in exception, at the very end: writing the decisions into the components' annotations (Phase 6). The other writes are local files, in the folder the user approves.
The one rule: a status is evidence or a recorded decision — never a guess. "In both" needs a real match (a name, an alias the user confirmed, or a story that declares what it mirrors). "Penpot only" and "planned" are decisions a person made, stored with their reason in the config file. Everything else is reported as it is: missing in code, code only, ambiguous. A coverage number built on optimistic matching is worse than no number.
Tool surface: shared/penpot-mcp-tool-reference.md. API traps: shared/plugin-api-gotchas.md.
The Node tools live next to this file in tools/ and need no install (Node ≥ 18).
penpot-sync.config.json if this is a refresh.Phase 0 — Scope (read-only). high_level_overview. Confirm with the user:
penpot.currentFile.name), and whether more files belong
to the inventory. For several files, either the user opens each one in turn, or — only if they ask
for it — navigate with penpotMgmt. With more than one Penpot server connected, ask which.src/components,
a packages/ui…). Without a scope, pages and app shells are scanned too. No repository at all →
design-only mode: say so, skip Phase 2, and do not scaffold code to fill the gap. No Penpot
library → code-only mode: skip Phase 1, and do not draw components to fill the gap either..storybook/, @storybook/* in package.json, *.stories.*).
Present → propose a story inside it; absent → propose an HTML file. The user can always ask
for the HTML. Agree the output folder (default: penpot-sync/ at the repo root; in Storybook, a
penpot-sync/ folder inside the stories directory).✋ Confirm files, code scope, output kind and folder.
Phase 1 — Penpot inventory. scripts/exportPenpotComponents.js in one execute_code call per
file (references/01-penpot-inventory.md). Save each result verbatim as
penpot-components.<file-slug>.json in the output folder. A variant group is one entry with its
axes and values; every entry carries the board to link to.
Phase 1b — Penpot tokens (optional). scripts/exportPenpotTokens.js, one call in the file that
holds the tokens; save it as penpot-tokens.<file-slug>.json. Each token comes resolved in every mode.
Phase 2 — Code inventory (skipped in design-only mode). From the repo:
node <skill>/tools/scan-code.mjs --root <repo> [--include <dir>]… [--storybook-index <url|file>] --out <folder>/code-inventory.json
(references/02-code-inventory.md). Pass Storybook's own index.json when it is reachable — it gives
the real story ids. Then read the result: it is static analysis. Spot-check a few components
against their source, and note what it could not see (components built by factories, props typed
elsewhere, stories with a dynamic mapping). For the Tokens tab, also run
node <skill>/tools/scan-tokens.mjs --root <repo> [--include <styles dir>] --out <folder>/code-tokens.json
— CSS custom properties per selector, Sass variables and token JSON. Tokens generated at build time
are invisible to it: point --include at the built CSS.
Phase 3 — Theme. The report must look like the design system (references/04-report-and-theme.md):
scripts/exportSyncTheme.js in the Penpot file that holds the tokens, review its
suggested role mapping against the token list, and write penpot-sync.theme.json.
A role the system does not cover keeps the report's neutral fallback. Never fill it with a made-up
colour, and never take a brand colour from memory.Phase 4 — Match and build.
node <skill>/tools/build-sync.mjs --penpot <manifest>… --code <code-inventory.json> [--penpot-tokens <tokens.json> --code-tokens <code-tokens.json>] --config <repo>/penpot-sync.config.json --theme <theme.json> (--out-html <file> | --out-storybook <dir>) [--storybook-url <url>] [--name "<design system>"]
(references/03-matching-and-status.md). It prints a summary: counts, and everything that needs a
person — missing, ambiguous, unknownMappings, variantDiffs, codeOnlyWithoutNote, and the
theme's contrastWarnings. Design-only mode: leave --code out. The summary then carries
design instead — the families it folded (components named by path that are one component in code),
the naming style, and the hints per component (default axis names, single-value axes, mixed naming).
Code-only mode: leave --penpot out; rows are the code components, grouped by folder, with the
variant axes their props imply. Every inventory is titled Penpot Sync, followed by the design
system's name (--name). When a previous penpot-sync.data.json is in the output folder, the build
diffs against it and the report opens with what is new, removed or changed status since then.
✋ Decisions checkpoint. Show the counts and walk the user through that list:
drift
with a sentence that says what differs.planned, penpotOnly). Point out anything the tool
cannot see but you can: a misspelt variant value, two axes that say the same thing.tokens.missing (in Penpot, no variable) and tokens.valueDiffs (same token, different
value, per mode). A value difference is a fact, not a lead — but which side is right is the user's
call. A naming scheme the matcher cannot bridge goes in tokenPrefix / tokenAliases.
Write the answers to penpot-sync.config.json and run the build again. Repeat until nothing in the
list is unexplained — or the user says the remaining items stay open, in which case the report shows
them as they are.Phase 5 — Verify and hand over. Open the result: for the HTML, read it back and check that the
data block and the theme block are present; in Storybook, load the story (its URL is
?path=/story/<title>--overview) when a browser tool is available, and otherwise say the visual check
is the user's. Compare three or four rows by hand against Penpot and the source. Offer the optional
gate: node <skill>/tools/check-sync.mjs <data.json> exits 1 when a Penpot component has neither code
nor a recorded decision — suitable for CI. Then the structured report (AGENTS.md §12).
Phase 6 — Record the decisions in Penpot (optional, opt-in). Offer it; never do it unasked.
scripts/writeSyncAnnotations.js writes each decision into the component's annotation as one marked
line ([Penpot Sync] Planned for code — <reason>), so designers see it in the file. It is the only
step that changes Penpot, and it is Apply-with-review:
penpot-sync.annotations.json and DRY_RUN = true; show the plan;DRY_RUN = false — it takes a restore point first;unchanged.
The next inventory reads those lines back, so a decision recorded in Penpot survives without the
config file (the config wins when both speak). CLEAR = true removes exactly what was written.component.annotation, after a dry run, an explicit yes and a restore point.penpot-sync.config.json, each with its reason, proposed by you and
approved by the user. It is the file that makes the next run reproduce this one; commit it.size prop has no value for Large", not "Large is not implemented". Interaction states (hover,
pressed, focus) are CSS in code and are never reported as missing props.config.groups, or automatically from 8 siblings up) instead of reporting 40 "missing" rows.More excuses and countermeasures: references/05-anti-rationalization.md.
| Status | Means | Comes from |
|---|---|---|
| Penpot + code | designed and built | a match (rule 2) |
| Missing in code | designed, no counterpart found, no decision | nothing matched |
| To build | the same, when no code was analysed (design-only mode) | no --code |
| To design | a code component, when no Penpot library was read (code-only mode) | no --penpot |
| Planned for code | designed, code still to be written | config.planned, or a Penpot annotation that says so |
| Penpot only | design-only on purpose | config.penpotOnly, with the reason |
| Code only | built, not designed | an unmatched code component in scope |
| Drift (extra pill) | on both sides, structure differs | config.drift, with what differs |
| Variants differ (extra pill) | on both sides, variant values differ | the tool's comparison — a lead |
Mode suggest (shared/modes-and-policies.md): nothing on the canvas is applied. The annotation
write-back is the one Apply-with-review step — documentation metadata on library components, never
automatic.
Writing the local files happens after the Phase 0 checkpoint named their folder; overwriting an
existing report or story asks first (build-sync.mjs keeps an existing story unless told otherwise).
State lives in the output folder, not in the Penpot file: the manifests, code-inventory.json,
penpot-sync.theme.json, penpot-sync.data.json, and the decisions in penpot-sync.config.json. A
refresh re-runs Phases 1, 2 and 4 with the same config and theme into the same folder: the build
compares with the previous penpot-sync.data.json, shows the differences at the top of the report,
and returns them as changes — include them in your final message.
01-penpot-inventory.md, 02-code-inventory.md, 03-matching-and-status.md
(config reference), 04-report-and-theme.md (roles, theme file, the two outputs),
05-anti-rationalization.md.execute_code) — read-only: exportPenpotComponents.js,
exportPenpotTokens.js, exportSyncTheme.js. Mutating, opt-in: writeSyncAnnotations.js.scan-code.mjs, scan-tokens.mjs, build-sync.mjs,
check-sync.mjs.penpot-sync.report.js (framework-free renderer),
penpot-sync.css, report.template.html, and Storybook wrappers for React, Vue 3 and HTML /
web-components renderers.Doctrine paths. shared/… and policies/… resolve inside this bundle in native installs (vendored by the installer); in a Claude Code plugin install they live at the plugin root — ${CLAUDE_PLUGIN_ROOT}/shared/…, two directories up from this file.
assets/penpot-sync.css (opens in a new tab)assets/penpot-sync.report.js (opens in a new tab)assets/report.template.html (opens in a new tab)assets/storybook/PenpotSync.stories.html.txt (opens in a new tab)assets/storybook/PenpotSync.stories.react.txt (opens in a new tab)assets/storybook/PenpotSync.stories.vue3.txt (opens in a new tab)references/01-penpot-inventory.md (opens in a new tab)references/02-code-inventory.md (opens in a new tab)references/03-matching-and-status.md (opens in a new tab)references/04-report-and-theme.md (opens in a new tab)references/05-anti-rationalization.md (opens in a new tab)scripts/exportPenpotComponents.js (opens in a new tab)scripts/exportPenpotTokens.js (opens in a new tab)scripts/exportSyncTheme.js (opens in a new tab)scripts/writeSyncAnnotations.js (opens in a new tab)tools/build-sync.mjs (opens in a new tab)tools/check-sync.mjs (opens in a new tab)tools/scan-code.mjs (opens in a new tab)tools/scan-tokens.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
15 skills in this plugin
/penpot-anti-slopOpt-in layer that keeps Penpot designs from looking generically AI-generated: a direction step before building, a scored 0–100 slop check of a screen or deck (tree probes + visual review), and reviewed fixes. Triggers: 'avoid the AI look', 'does this look AI-generated', 'anti-slop check', 'make it feel less generic', 'evitar estética IA', '¿parece hecho por IA?'./penpot-audit-accessibilityAudit a Penpot design against WCAG 2.1/2.2 AA (optionally AAA) and produce a structured severity report: color contrast, touch/target sizes, text alternatives, heading hierarchy, and keyboard/focus order. Proposes fixes — does not auto-apply. Also serves as the Evaluator in the brief-to-screen and brief-to-deck loops (scope:deck = slide contrast rules). Triggers: 'check accessibility', 'accessibility audit', 'WCAG check', 'contrast audit', 'a11y review', 'check color contrast', 'is this accessible'./penpot-audit-tokensnpx claudepluginhub penpot/penpot-ai-kit --plugin penpot-ai-kitOther plugins' skills for the same job