/penpot-ai-kit:penpot-design-to-code-reviewfrom penpot-ai-kit
Compares a Penpot design selection against its implemented code (component file or Storybook story) and produces a structured DRIFT report. Useful for confirming build-to-design parity, extracting HTML/CSS, and identifying token mismatches.
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.
Read a Penpot selection, compare it with the implemented code, and report the drift. Work as a
senior design engineer who treats the design file as the spec of record and never accepts a
hardcoded value where a token exists. The design side comes from the selection (shape.tokens, raw
styles, penpot.generateMarkup / generateStyle, an export); the code side — a component file, or a
Storybook story's DOM + CSS — is supplied by the user or by another tool. With no code source the
skill still runs, comparing the selection against the design-system tokens.
The one rule: never one-shot a review, and never mutate during one. Extract → normalize → map → diff → report, one step per call with a checkpoint between phases. The only output is a structured DRIFT report; fixes are handed to a write skill under its own checkpoints.
Tool surface: shared/penpot-mcp-tool-reference.md. API traps: shared/plugin-api-gotchas.md.
<Button variant=primary size=md> in src/Button.tsx matches the
selection, including hover and disabled". Not "review the design".match / drift / code-only / design-only;Phase 0 — Discovery (read-only). high_level_overview; resolve penpot.selection (empty → stop and
ask); penpotUtils.shapeStructure(shape, 4) per selected shape; penpotUtils.tokenOverview(); confirm
the code source. ✋ Show structure, tokens and the code source; confirm scope and which side is
authoritative for what.
Phase 1 — Extract. scripts/extractMarkupStyle.js, one call: generateMarkup, generateStyle, and
a per-node map { id, name, type, tokens, rawFills, rawSpacing, radius, typography }
(references/01-extract-markup-style.md). ✋ Show the trimmed markup and style and the token map.
Phase 2 — Comparison image. scripts/exportForCompare.js for ids and bounds, then export_shape
(PNG) per state board. Ask for a screenshot of the rendered code or story, or capture it with a
browser tool if one is available. ✋ Side by side; let the engineer flag deltas to prioritize.
Phase 3 — Map design ↔ source. Parse the code (props, CSS variables, state classes or variants)
and build the table designNode → codeElement, designToken → codeVar, designState → codeState
(references/02-mapping-to-source.md; Storybook stories: references/03-storybook-compare.md). No
code source → map against the design-system tokens only and leave the code column out.
✋ Show the mapping; correct mis-maps before diffing.
Phase 4 — Diff and report. Apply references/04-drift-report.md (normalization, severity rubric,
reconciliation phrasing) and assemble with scripts/generateDriftReport.js. ✋ Present the report; if
fixes are wanted, hand off — token work to penpot-foundations, layer names to
penpot-rename-layers, structural rebuilds to penpot-build-from-code.
penpot.generateMarkup(shapes, { type: "html" | "svg" }) and
penpot.generateStyle(shapes, { type: "css", withPrelude?, includeChildren? }) take an array of
shapes (penpot.selection already is one). An unknown option key silently yields default output and
a false "no drift": confirm the keys with penpot_api_info("Penpot", "generateStyle"), and when the
output looks too short suspect the options or a non-array argument first.generateStyle states the design's intent and knows nothing of
the code's class names. Normalize both sides first — units → px, colors → lowercase hex, shorthands
expanded, properties sorted; map code variables onto dot-notation
(--color-action-primary-bg ↔ color.action.primary.bg).shape.tokens first; match raw hex against the
token set only when nothing is bound.codeSource: "none") and
report design-side findings only; never fabricate the code side.button, label,
icon); a selection full of Rectangle 12 → recommend penpot-rename-layers and say the
structural diff is less reliable.More excuses and countermeasures: references/05-anti-rationalization.md.
{ runId, scope, codeSource: "file" | "storybook" | "none",
authoritative: { visual: "design", behavior: "code", … },
summary: { match, drift, codeOnly, designOnly, critical, major, minor },
findings: [{ id, dimension: "color" | "spacing" | "typography" | "radius" | "structure" | "state",
designNode, codeElement, designValue, codeValue, token,
status: "match" | "drift" | "design-only" | "code-only",
delta, grid4px, wcag, severity: "Critical" | "Major" | "Minor", reconciliation }],
stateMatrix: { design: […], code: […], cells: [{ state, design, code }] } }
Formalized in shared/report-schemas/drift-report.schema.json; include the derived top-level drift
count (summary.drift + summary.designOnly + summary.codeOnly), which code-to-penpot-sync branches on.
Severity, in short (full rubric in references/04-drift-report.md): Critical — a state missing on
one side of an interactive element, or a color drift that drops contrast below WCAG AA; Major — a
mismatch users will notice (wrong semantic token, spacing off by ≥ 8px, type mismatch, a missing
element); Minor — hygiene (untokenized but matching, ≤ 4px delta, naming).
Mode suggest, always (shared/modes-and-policies.md): there is nothing to auto-apply.
State (shared/state-management.md, RUN_ID such as d2c-2026-06-05-a): plain data in
storage.run — scope, tokens, extracted, mapping, report. Nothing is written into the file
unless the user asks to persist the report (${RUN_ID}.driftReport). In a new session, re-run Phase 0
rather than trusting a stale report.
references/01-extract-markup-style.md · 02-mapping-to-source.md · 03-storybook-compare.md ·
04-drift-report.md · 05-anti-rationalization.md.scripts/extractMarkupStyle.js (Phase 1) · scripts/exportForCompare.js (Phase 2) ·
scripts/generateDriftReport.js (Phase 4) — all read-only.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.
references/01-extract-markup-style.md (opens in a new tab)references/02-mapping-to-source.md (opens in a new tab)references/03-storybook-compare.md (opens in a new tab)references/04-drift-report.md (opens in a new tab)references/05-anti-rationalization.md (opens in a new tab)scripts/exportForCompare.js (opens in a new tab)scripts/extractMarkupStyle.js (opens in a new tab)scripts/generateDriftReport.js (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
penpot, design-to-code, drift-report, design-review, storybook
npx claudepluginhub penpot/penpot-ai-kit --plugin penpot-ai-kit15 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-tokensAudit a Penpot design for design-system / token GOVERNANCE issues (distinct from accessibility): hardcoded colors where a token exists, off-grid spacing, orphan/unresolved/unused tokens, duplicated values, and detached parts that should be component instances. Produces a severity report and suggests semantic-token swaps. Triggers: 'audit tokens', 'find hardcoded colors', 'token governance', 'check design system consistency', 'find off-grid spacing', 'detect raw values', 'are we using tokens correctly'./penpot-build-deckDesign a presentation / slide deck in Penpot from a brief, as a senior presentation designer: 1920x1080 slide boards built one slide per call from an approved outline, a committed deck style, varied slide archetypes (cover, agenda, section, content, big-number, comparison, grid, bento, quote, timeline, image-bleed, closing), tokenized, wired into a playable View-mode flow and exportable to PDF. NOT for app screens (use penpot-build-screen). Triggers: 'create a presentation', 'build a slide deck', 'design slides in Penpot', 'pitch deck', 'keynote', 'make slides for this talk', 'turn this outline into slides'./penpot-build-from-codeTranslate an existing application page, view, or component code into a Penpot screen that is bound to the existing design system — mapping code styles onto semantic tokens and reusing library components instead of raw shapes. Use when the user has real code/markup and wants it reconstructed in Penpot, section by section, on-system. Triggers: 'build this in Penpot from code', 'turn this React/HTML/CSS into a Penpot screen', 'recreate this view in Penpot', 'port this page to Penpot', 'translate this component to Penpot bound to our tokens', 'code to Penpot'./penpot-build-screenDesign production-grade screens in Penpot from a brief, as a senior visual designer — reusing the existing design system (tokens + components) and assembling section by section, never one-shot. Use to create a screen/page/landing/dashboard from a description. NOT for translating existing code (use penpot-build-from-code). Triggers: 'design a dashboard', 'create a landing page', 'design this app screen', 'build a UI from this brief', 'design a settings page', 'mock up a screen in Penpot'.Other plugins' skills for the same job