pen-design
Guide for working with Pencil (.pen) design files. Use this skill for reading, creating, or modifying UI layouts, typography, or styling in .pen design files.
SKILL.md
Full skill instructions
PEN Design Format
Work with .pen design files efficiently.
Quick Reference
Root Structure
{
"version": "2.6",
"children": [...], // Design elements
"themes": {...}, // Theme definitions (e.g., Light/Dark)
"variables": {...} // Design tokens
}
Element Types
| Type | Purpose | Key Properties |
|---|---|---|
frame | Container/layout | layout, children, gap, padding, reusable |
text | Typography | content, fontFamily, fontSize, fontWeight |
rectangle | Basic shape | width, height, fill, cornerRadius |
path | Vector graphics | geometry (SVG path data) |
image | Raster graphics | url, mode |
ref | Component instance | ref (source ID), descendants (overrides) |
icon_font | Icon | iconFontName, iconFontFamily (e.g., "lucide") |
prompt | AI generation | model, content |
Token System
Tokens use $-- prefix:
- Colors:
$--primary,$--foreground,$--background,$--border - Semantic:
$--color-success,$--color-warning,$--color-error - Fonts:
$--font-primary,$--font-secondary - Radii:
$--radius-none,$--radius-m,$--radius-pill
Layout
| Property | Values |
|---|---|
layout | "none" (absolute), "horizontal", "vertical" |
justifyContent | start, center, end, space_between |
alignItems | start, center, end, stretch |
Sizing
- Fixed:
360 - Flex:
"fill_container"or"fill_container(360)" - Fit:
"fit_content"or"fit_content(717)"
Common Patterns
For detailed patterns and examples
For complete JSON schema
Manipulation Guidelines
- Generate unique IDs - 5 alphanumeric chars (e.g.,
"xCEfn") - Use tokens - Prefer
$--primaryover hardcoded colors - Component naming -
Category/Variant(e.g.,"Button/Large/Primary") - Reusable components - Add
"reusable": trueto source, usereffor instances - Override properties - Use
descendantsobject keyed by child ID
