Author and commit the component library artifact under skills/penpot/assets #206
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#206
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
Author the project component library once in the Penpot UI, export it with the extension's export tool, and commit it to the repo as
skills/penpot/assets/<name>.penpotwith a short authoring/refresh note — so the skill can import a reproducible, reviewable library instead of hand-authoring components over the API.Background
Depends on: #205
Component creation over the API (
add-component, with itsmainInstanceId/mainInstancePagemarking) is deliberately out of scope: it is the single riskiest thing to build against an undocumented schema, and Penpot's UI is the right tool for designing components anyway. The strategy is library-as-artifact:.penpotfile withpenpot_export_library;penpot_import_library, then link it (penpot_link_library) so consuming files can see its components.The exported artifact is inspectable (
manifest.json,files/<id>.json,colors/,typographies/), so a committed library is diffable in review — a reviewer can see that a component's geometry or a colour changed.The library must be authored for a real design system, not a generic one: use the palette and typography conventions from a project
DESIGN.md(the reference design system used during validation is a Tailwind/shadcn-style one whose palette lives in a@themeCSS block). Record whichDESIGN.mdthe artifact was authored from, so it can be regenerated when that design system changes.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/penpot-api/includeLibraries,embedAssets) and what each carries.docs/reference/tailwindcss/@themedirective: how a project's design tokens are expressed as--color-*custom properties, i.e. the machine-readable palette this artifact must reflect.@themealongside other directives, for locating the token block in a real project's CSS.docs/reference/pi-coding-agent/Implementation Details
DESIGN.md(and its@themeCSS block where present). Extract: the colour palette (names + hex), the typographic scale (family, sizes, weights, line heights), radii, and the component recipe list.h1…h3,body,label, …) using a font the instance actually ships (record any substitution);Button(with primary/secondary variants if variants are easy),Card,Badge,ProgressBar— each built with auto-layout, real text objects, and fills linked to the colour assets rather than local colours;penpot_export_libraryfor the library file, then commit the resulting ZIP toskills/penpot/assets/with a stable, descriptive filename. Addskills/penpot/assets/README.mdrecording: the sourceDESIGN.md(+ its location or revision), the Penpot version used, the font substitutions made, the component inventory with names, and the exact steps to regenerate the artifact.penpot_import_library, and confirm the components and assets arrive with the expected names. Then link it and confirm the next milestone's instancing step will be able to reach the components.Acceptance Criteria
.penpotartifact is committed underskills/penpot/assets/with a stable filename.skills/penpot/assets/README.mdrecords the source design system, the Penpot version, font substitutions, the component inventory, and regeneration steps.DESIGN.md/@themeblock, named identically..penpotarchive is inspectable (manifest.json,files/*.json,colors/*,typographies/*) and contains no unnecessary embedded raster data.add-componentis not used anywhere in the extension.Test Plan
Inspect the committed artifact:
Re-import into a throwaway project via
penpot_import_libraryand open it in the Penpot UI:Link the imported library to a consumer file (
penpot_link_library) and confirm the components are visible to the extension's read tools — this is the hand-off the instancing step depends on.Open a component in the UI, edit the main instance's fill, and confirm the change is a library-level change (i.e. these are real components, not loose frames).
pi-loop opened and merged a pull request for this issue: #239