Write the penpot SKILL.md core workflow, token conventions and Tailwind translation table #215
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#215
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Complete
skills/penpot/SKILL.md: how to read aDESIGN.md, how to bootstrap the Penpot library from it (assets + imported components), the composition rules, the Tailwind → Penpot translation table, the four creation paths, and the lossy areas the agent must not promise. This is the judgement half of the feature — the extension guarantees valid payloads, the skill decides what to build.Background
Depends on: #213, #214
The skill is where an agent's discretion lives, and its value is that it encodes decisions already made rather than leaving them to be re-derived:
DESIGN.mdis not a schema. It is human-authored markdown, and the reference design system is Tailwind + shadcn/ui, so component recipes appear as Tailwind class strings that are not Penpot specs. The one machine-readable source is a Tailwind v4@themeblock in the project's CSS (--color-flip7-teal: #2BA8A2;…), which DESIGN.md may also embed. Read tokens deterministically from there; use the prose for semantics and layout intent.colour: "flip7-gold",typography: "h2") and the extension resolves ids, which is what makes an asset edit restyle every screen.This step also states the lossy areas plainly, because a skill that overpromises produces silent disappointment: gradients, coloured glows, dashed borders, pseudo-element constructions and all animation have no faithful Penpot equivalent.
Documentation Required
A separate process downloads these into the listed folders before this issue is implemented. Check the folders for the actual reference material before starting.
docs/reference/tailwindcss/@themedirective:--color-*,--font-*,--text-*,--spacing-*,--radius-*custom properties. This is the source for the token-reading instructions and for the translation table's numbers.@themesits relative to other directives, so the "find the token block" instruction is accurate in a real file.docs/reference/penpot-api/auto), which the composition rules and the translation table both depend on.docs/reference/svg/svg-raw).docs/reference/pi-coding-agent/Implementation Details
Extend
skills/penpot/SKILL.md(keeping the frontmatter and image → design section from the earlier step, and the Reference section pointing at the vendored docs). Sections to add:Design-system bootstrap (the shared prerequisite). Ordered steps:
DESIGN.md; if the project has CSS with a Tailwind v4@themeblock, read that for tokens (names, hex, type scale, radii) and treat DESIGN.md's prose as semantics;penpot_list_projects,penpot_get_file,penpot_list_library) before creating anything, so a re-run does not duplicate assets;penpot_create_color,penpot_create_typography), naming them exactly as the design system does;penpot_import_library), then link it (penpot_link_library) — state explicitly that an imported library is not usable until linked;Token conventions. A short, prescriptive table: DESIGN.md token → what the agent passes to the tools (e.g.
--color-flip7-teal→colour: "flip7-teal";--text-h2→typography: "h2"). Rule: never pass hex values when a matching asset exists.Component conventions. Components come from the library; screens use
penpot_instance_component. When no library component matches, compose primitives and name the frame so it can be promoted to a component later in the UI. Do not fake a component with a loose frame.Composition rules. One screen = one root frame; regions as child frames; layout frames wherever Tailwind would use flex (
row/column, gap, padding, align/justify) and absolute positioning only as a fallback; text always viapenpot_add_textwith a typography asset; assets matched against the existing library first (link_colorsin the SVG path); commit per screen (one commit = one revision); never write outside a designated target.Tailwind → Penpot translation table. Include at least:
rounded-fullrounded-lg/-xl/-2xlh-12,p-4,gap-2bg-gradient-to-br from-… to-…shadow-glow-goldborder-2 border-flip7-tealflex items-center gap-2font-extrabold tracking-widesthidden md:blockhover:/ CSS keyframesKeep the numbers consistent with Tailwind v4's spacing scale (1 unit = 4 px) and say so.
Creation paths. Four short sections: design system (bootstrap above), greenfield screen (from a prompt/spec: shell → regions → contents → styling, committing per screen), code → design (SVG: state the supported subset —
rect,circle,pathwithout arcs,text,g, fills, strokes,translate/scale/matrix— and that everything else lands assvg-rawwith a reported reason), and image → design (already written; link to it rather than repeating it).Lossy areas. A flat list stating what will not survive: gradients (single-colour fills or two-stop gradients only), coloured glows/shadows approximations, dashed/compound borders, pseudo-element constructions (folded ribbon tails, decorative overlays), all animation and interaction states, and any font the instance does not ship (naming the substitution policy). Each with the honest failure mode, not just the keyword.
Reference. Keep/extend the pointer index to the vendored
docs/files with one line each.Keep every instruction operational: name the tool, name the parameter, give the rule. Prefer short sections and tables over prose.
Acceptance Criteria
skills/penpot/SKILL.mdretains valid frontmatter and is listed by/skills.@theme-first token reading rule, the list-before-create rule, the import-then-link rule, and the no-silent-substitution rule.@themenames to the exact arguments the tools take, and forbids hex when a matching asset exists.svg-rawfallback stated, and the image path cross-referenced rather than duplicated.docs/files.Test Plan
Load and inspect the skill:
Cross-check every tool/parameter named in the skill against the registered tools:
Every name in the skill must appear in the extension (and vice versa: a tool not mentioned should be either intentional or a gap worth filling).
Dry-read the skill against one real
DESIGN.md(with an@themeblock): confirm the token names in the table can actually be derived from that file, and that following the bootstrap steps would not create duplicate assets on a second run.pi-loop opened and merged a pull request for this issue: #248