Agent skill for designing UIs in Pencil (.pen files) and generating production code (React/Next.js + Tailwind v4 + shadcn/ui)
npx skills add https://github.com/chiroro-jr/pencil-design-skill --skill pencil-designCLI를 사용하여 이 스킬을 설치하고 작업 공간에서 SKILL.md 워크플로 사용을 시작하세요.
⚠️ Repository moved: This project is now maintained at
https://github.com/chiroro-jr/skills/pencil-design.Install it with:
npx skills add https://github.com/chiroro-jr/skills --skill pencil-design
An Agent Skills skill for designing production-quality UIs in Pencil and generating clean, maintainable code.
This skill helps AI agents work effectively with Pencil (.pen files) — a vector design tool that integrates into IDEs. It enforces best practices for:
npx skills add https://github.com/chiroro-jr/skills --skill pencil-design
git clone https://github.com/chiroro-jr/skills.git ~/.agents/skills/chiroro-skills
.skill-lock.json:"pencil-design": {
"source": "chiroro-jr/skills",
"sourceType": "github",
"sourceUrl": "https://github.com/chiroro-jr/skills.git",
"skillPath": "pencil-design/SKILL.md",
"skillFolderHash": "<latest-commit-hash>",
"installedAt": "<timestamp>",
"updatedAt": "<timestamp>"
}
Load this skill when:
.pen fileThis skill enforces 6 rules that prevent common agent mistakes:
Never recreate a component from scratch when one exists. Search for reusable components (reusable: true) and insert them as ref instances.
Never hardcode colors, border radius, spacing, or typography. Use design tokens and generate semantic Tailwind classes (bg-primary, not bg-[#3b82f6]).
Never allow content to overflow its parent. Set appropriate constraints, use fill_container widths, and verify with pencil_snapshot_layout(problemsOnly: true).
Never skip screenshots. Take pencil_get_screenshot after each section and analyze for alignment, spacing, and visual issues.
Never generate a new logo when one exists. Search the document and copy existing assets with C() instead of regenerating.
frontend-design SkillNever design without aesthetic direction. Load the frontend-design skill first to get bold, intentional design guidelines and avoid generic AI aesthetics.
0. Load `frontend-design` skill -> Get aesthetic direction
1. pencil_get_editor_state -> Understand file state
2. pencil_batch_get (reusable) -> Discover components
3. pencil_get_variables -> Read design tokens
4. pencil_get_guidelines -> Get design rules
5. pencil_batch_design -> Build the design
6. pencil_get_screenshot -> Verify visually
7. pencil_snapshot_layout -> Check for problems
frontend-design skillpencil_get_guidelines with topic "code" and "tailwind"pencil_get_variables to map tokens to Tailwind @themepencil_batch_getfrontend-design guidelines for typography, color, motionWhen generating code from Pencil designs, this skill targets:
@theme blocks, not tailwind.config.ts)cn() from @/lib/utilsforwardRef)pencil-design/
├── SKILL.md # Main skill file with 6 rules
└── references/
├── design-system-components.md # Rule 1: Component reuse workflow
├── variables-and-tokens.md # Rule 2: Variable usage and Tailwind mapping
├── layout-and-text-overflow.md # Rule 3: Overflow prevention
├── visual-verification.md # Rule 4: Screenshot verification
├── asset-reuse.md # Rule 5: Asset copying rules
├── design-to-code-workflow.md # Complete code generation guide
├── tailwind-shadcn-mapping.md # Quick-reference mapping tables
└── responsive-breakpoints.md # Multi-artboard responsive patterns
// Discover available components
const components = await pencil_batch_get({
filePath: "design.pen",
patterns: [{ reusable: true }]
});
// Read design tokens
const tokens = await pencil_get_variables({ filePath: "design.pen" });
// Insert a component instance
btn = I("parentId", { type: "ref", ref: "button-primary", width: "fill_container" });
// Customize it
U(btn + "/label", { content: "Submit" });
// Verify
await pencil_get_screenshot({ filePath: "design.pen", nodeId: btn });
// The skill guides code generation to produce:
// ❌ Never this:
<div className="bg-[#3b82f6] rounded-[6px] p-[24px]">
// ✅ Always this:
<div className="bg-primary rounded-md p-6">
MIT
Nyasha Chiroro (@chiroro-jr)