/penpot-ai-kit:penpot-component-factoryfrom penpot-ai-kit
Builds Penpot design components with complete variant matrices covering sizes, hierarchies, and interactive states (default/hover/pressed/focus/disabled), all tokenized and correctly named.
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.
Build components and their full variant matrices as a senior component engineer: a base component as a flex Board with every value tokenized, one component per matrix cell, the cells grouped into a variant container with named axes, and a completeness check at the end.
The one rule: every interactive component ships every required state, and every value is a token.
No missing Hover / Pressed / Focus / Disabled unless the system says otherwise; no hardcoded
fill or spacing. Build one step at a time and checkpoint before grouping.
Tool surface: shared/penpot-mcp-tool-reference.md. API traps: shared/plugin-api-gotchas.md (the
#n below). Verify signatures with penpot_api_info("VariantContainer" | "Variants" | "LibraryComponent").
penpot-foundations), required axes.Property=Value naming.Before every ✋ checkpoint that shows visual work, run the export → look → fix loop of
shared/visual-self-review.md (max 2 self-fixes).
Phase 0 — Discovery. high_level_overview; read tokens (tokenOverview()), existing components,
and penpot.version (it decides Phase 3). Choose the axes (references/01-variant-axes.md).
✋ Confirm the axis matrix.
Phase 1 — Base. scripts/buildComponentBase.js: a flex Board with fill, radius, gap and padding
bound to tokens, registered with createComponent (references/02-flex-grid-layout.md). Missing
tokens come back in exceptions — propose them, do not hide them. ✋ Review the base export.
Phase 2 — One component per cell. scripts/createVariants.js clones the base for each cell,
detaches the clone (a clone of a main instance is a component copy — registering it as-is wraps it
in a layout-less board), registers it as its own component and applies that state's tokens
(tokens: { fill, text, stroke }). Tokens it cannot find come back in missingTokens: propose them.
A state that adds something the base lacks (a focus ring) is built by hand and reported. Verify
bindings in the next call. ✋ Review the cells.
Phase 3 — Group, name axes, organize. Version-gated (#12). scripts/createVariantGroup.js reads
penpot.version:
saveVersion("before variants — …")) and groups.{ halted: true } unless storage.cf.fileDuplicatedConfirmed === true (set it
only after the user duplicated the file and accepted the risk); otherwise use the fallback.It prefers penpotUtils.createVariantContainer([{ shape: mainInstance, properties }]) (path
"helper") and falls back to penpot.createVariantFromComponents + renameProperty / addProperty /
setVariantProperty (path "legacy"); references/03-variant-api.md. It clears the container's fill
(#11), gives it a flex layout, and returns { containerId, path, properties, components, restorePoint, validation, next }. In the next call read penpot.currentFile.validate() and each component's
variantError: anything non-empty → stop, report, offer the restore point. Once grouped, every variant
is simply named after the component — the Property=Value pairs live in variantProps. The standalone
base component from Phase 1 is now redundant: ask before removing it. ✋ Review the container.
Fallback (below 2.20, or a failed integrity check). Skip the container. Keep the Phase 2 cells as
standalone components named Component / Axis=Value, …, arranged in a labeled grid; Penpot groups
them by the / prefix and the user can convert them to variants in the UI.
Phase 4 — Validate. scripts/validateComponent.js reads the variants API (or Axis=Value names in
the fallback): every required state present, no raw fill / stroke / radius / gap / padding on a cell or
its children, PascalCase properties, no variantError, clean validate(); optionally scripts/switchVariantDemo.js. Then the structured report.
Default / Hover / Pressed / Focus / Disabled for every interactive component unless
the system says otherwise — a missing state is an acceptance failure, not a follow-up.color.action.primary.hover.bg), never a literal hex.shape.tokens[prop] !== tok.name)
— a clone inherits the base's bindings, so re-applying the same token to the Default cell would
remove it.validate() on ≥ 2.20; fallback or a
user-made duplicate below it. On ≤ 2.16 it corrupted files.Button); variants Property=Value in PascalCase (Size=Medium,
State=Hover); internal layers semantic (label, icon). A component created as Group / Name is
stored with name === "Name" — match on the last segment.createBoard, not createFrame); order children by append, size them through
layoutChild after appending (#4, #15); absolute positioning only with layoutChild.absolute and a
stated reason.Size = Small | Medium | Large, Hierarchy = Primary | Secondary | Tertiary, State = …, Icon = None | Left | Right.switchVariant(pos, value) takes
the property index, not its name. Do not use Board.combineAsVariants (listed, never verified).references/04-instance-swap-detach.md).More excuses and countermeasures: references/05-anti-rationalization.md. Failures and fixes:
references/06-error-recovery.md.
Mode review: component and variant restructuring and detach() are never auto-applied
(shared/modes-and-policies.md).
Ledger under RUN_ID (shared/state-management.md): phase, baseComponentId,
created: [{ variant: "Size=Medium,State=Hover", id }], restorePoints, exceptions. After
truncation, re-read the components before continuing.
01-variant-axes.md, 02-flex-grid-layout.md, 03-variant-api.md,
04-instance-swap-detach.md, 05-anti-rationalization.md, 06-error-recovery.md.execute_code) — buildComponentBase.js, createVariants.js (one
component per cell), createVariantGroup.js (version-gated), switchVariantDemo.js,
validateComponent.js.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-variant-axes.md (opens in a new tab)references/02-flex-grid-layout.md (opens in a new tab)references/03-variant-api.md (opens in a new tab)references/04-instance-swap-detach.md (opens in a new tab)references/05-anti-rationalization.md (opens in a new tab)references/06-error-recovery.md (opens in a new tab)scripts/buildComponentBase.js (opens in a new tab)scripts/createVariantGroup.js (opens in a new tab)scripts/createVariants.js (opens in a new tab)scripts/switchVariantDemo.js (opens in a new tab)scripts/validateComponent.js (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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-tokensOther plugins' skills for the same job