Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

pencil-design铅笔设计

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

29,376

周安装

1,155

GitHub Stars

13

下载量

9,408
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pencil-design(铅笔设计)
来源仓库:https://github.com/chiroro-jr/pencil-design-skill
仓库路径:skills/pencil-design
安装命令:
npx skills add https://github.com/chiroro-jr/pencil-design-skill --skill pencil-design
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/chiroro-jr/pencil-design-skill --skill pencil-design

简介

在 Pencil 中设计生产 UI 并从设计文件生成干净的代码。

  • 强制设计系统重用、变量驱动样式和布局正确性,以防止不一致、不可维护的设计
  • 通过 Tailwind v4 语义类和 shadcn/ui 组件映射,支持 React、Next.js、Vue、Svelte 和 HTML/CSS 的设计到代码工作流程
  • 需要在每个部分之后通过屏幕截图和布局快照进行视觉验证,以捕获溢出、对齐和间距问题,然后再继续
  • 必须加载前端设计
  • 技能与铅笔工作一起确保独特的美学并避免通用的人工智能设计模式
  • 提供超过 12 个 MCP 工具,用于读取/写入设计令牌、管理组件、生成图像以及跨文档审核属性

SKILL.md

Pencil Design Skill

Design production-quality UIs in Pencil and generate clean, maintainable code from them. This skill enforces best practices for design system reuse, variable usage, layout correctness, visual verification, and design-to-code workflows.

When to Use This Skill

  • Designing screens, pages, or components in a .pen file
  • Generating code (React, Next.js, Vue, Svelte, HTML/CSS) from Pencil designs
  • Building or extending a design system in Pencil
  • Syncing design tokens between Pencil and code (Tailwind v4 @theme, shadcn/ui tokens)
  • Importing existing code into Pencil designs
  • Working with any Pencil MCP tools (pencil_batch_design, pencil_batch_get, etc.)

Critical Rules

These rules address the most common agent mistakes. Violating them produces designs that are inconsistent, hard to maintain, and generate poor code.

Rule 1: Always Reuse Design System Components

NEVER recreate a component from scratch when one already exists in the design file.

Before inserting any element, you MUST:

  1. Call pencil_batch_get with patterns: [{reusable: true}] to list all available reusable components
  2. Search the results for a component that matches what you need (button, card, input, nav, etc.)
  3. If a match exists, insert it as a ref instance using I(parent, {type: "ref", ref: "<componentId>"})
  4. Customize the instance by updating its descendants with U(instanceId + "/childId", {...})
  5. Only create a new component from scratch if no suitable reusable component exists

See references/design-system-components.md for detailed workflow.

Rule 2: Always Use Variables Instead of Hardcoded Values

NEVER hardcode colors, border radius, spacing, or typography values when variables exist.

Before applying any style value, you MUST:

  1. Call pencil_get_variables to read all defined design tokens
  2. Map your intended values to existing variables (e.g., use primary not #3b82f6, use radius-md not 6)
  3. Apply values using variable references, not raw values
  4. When generating code, use Tailwind v4 semantic utility classes (e.g., bg-primary, text-foreground, rounded-md). NEVER use arbitrary value syntax (bg-[#3b82f6], text-[var(--primary)], rounded-[6px])

See references/variables-and-tokens.md for detailed workflow.

Rule 3: Prevent Text and Content Overflow

NEVER allow text or child elements to overflow their parent or the artboard.

For every text element and container:

  1. Set appropriate text wrapping and truncation
  2. Constrain widths to parent bounds, especially on mobile screens (typically 375px wide)
  3. Use "fill_container" for width on text elements inside auto-layout frames
  4. After inserting content, call pencil_snapshot_layout with problemsOnly: true to detect clipping/overflow
  5. Fix any reported issues before proceeding

See references/layout-and-text-overflow.md for detailed workflow.

Rule 4: Visually Verify Every Section

NEVER skip visual verification after building a section or screen.

After completing each logical section (header, hero, sidebar, form, card grid, etc.):

  1. Call pencil_get_screenshot on the section or full screen node
  2. Analyze the screenshot for: alignment issues, spacing inconsistencies, text overflow, visual glitches, missing content
  3. Call pencil_snapshot_layout with problemsOnly: true to catch clipping and overlap
  4. Fix any issues found before moving to the next section
  5. Take a final full-screen screenshot when the entire design is complete

See references/visual-verification.md for detailed workflow.

Rule 5: Reuse Existing Assets (Logos, Icons, Images)

NEVER generate a new logo or duplicate asset when one already exists in the document.

Before generating any image or logo:

  1. Call pencil_batch_get and search for existing image/logo nodes by name pattern (e.g., patterns: [{name: "logo|brand|icon"}])
  2. If a matching asset exists elsewhere in the document (another artboard/screen), copy it using the C() (Copy) operation
  3. Only use the G() (Generate) operation for genuinely new images that don't exist anywhere in the document
  4. For logos specifically: always copy from an existing instance, never regenerate

See references/asset-reuse.md for detailed workflow.

Rule 6: Always Load the frontend-design Skill

NEVER design in Pencil or generate code from Pencil without first loading the frontend-design skill.

The frontend-design skill provides the aesthetic direction and design quality standards that prevent generic, cookie-cutter UI. You MUST:

  1. Load the frontend-design skill at the start of any Pencil design or code generation task
  2. Follow its design thinking process: understand purpose, commit to a bold aesthetic direction, consider differentiation
  3. Apply its guidelines on typography, color, motion, spatial composition, and visual details — both when designing in Pencil and when generating code from Pencil designs
  4. Never produce generic AI aesthetics (overused fonts, cliched color schemes, predictable layouts)

This applies to both directions:

  • Pencil design tasks: Use the skill's aesthetic guidelines to inform layout, typography, color, and composition choices in the.pen file
  • Code generation from Pencil: Use the skill's guidelines to ensure the generated code includes distinctive typography, intentional color themes, motion/animations, and polished visual details — not just a mechanical translation of the design tree

Design Workflow

Starting a New Design

0. Load `frontend-design` skill   -> Get aesthetic direction and design quality standards
1. pencil_get_editor_state        -> Understand file state, get schema
2. pencil_batch_get (reusable)    -> Discover design system components
3. pencil_get_variables           -> Read design tokens
4. pencil_get_guidelines          -> Get relevant design rules
5. pencil_get_style_guide_tags    -> (optional) Get style inspiration
6. pencil_get_style_guide         -> (optional) Apply style direction
7. pencil_find_empty_space_on_canvas -> Find space for new screen
8. pencil_batch_design            -> Build the design (section by section)
9. pencil_get_screenshot          -> Verify each section visually
10. pencil_snapshot_layout        -> Check for layout problems

Building Section by Section

For each section of a screen (header, content area, footer, sidebar, etc.):

  1. Plan - Identify which design system components to reuse
  2. Build - Insert components as ref instances, apply variables for styles
  3. Verify - Screenshot the section + check layout for problems
  4. Fix - Address any overflow, alignment, or spacing issues
  5. Proceed - Move to the next section only after verification passes

Design-to-Code Workflow

See references/design-to-code-workflow.md for the complete workflow. See references/tailwind-shadcn-mapping.md for the full Pencil-to-Tailwind mapping table. See references/responsive-breakpoints.md for multi-artboard responsive code generation.

Summary:

  1. Load the frontend-design skill for aesthetic direction
  2. Call pencil_get_guidelines with topic "code" and "tailwind"
  3. Call pencil_get_variables to map design tokens to Tailwind @theme declarations
  4. Read the design tree with pencil_batch_get
  5. Map reusable Pencil components to shadcn/ui components (Button, Card, Input, etc.)
  6. Generate code using semantic Tailwind classes (bg-primary, rounded-md), never arbitrary values
  7. Apply frontend-design guidelines: distinctive typography, intentional color, motion, spatial composition
  8. Use CVA for custom component variants, cn() for class merging, Lucide for icons

MCP Tool Quick Reference

ToolWhen to Use
pencil_get_editor_stateFirst call - understand file state and get.pen schema
pencil_batch_getRead nodes, search for components (reusable: true), inspect structure
pencil_batch_designInsert, copy, update, replace, move, delete elements; generate images
pencil_get_variablesRead design tokens (colors, radius, spacing, fonts)
pencil_set_variablesCreate or update design tokens
pencil_get_screenshotVisual verification of any node
pencil_snapshot_layoutDetect clipping, overflow, overlapping elements
pencil_get_guidelinesGet design rules for: code, table, tailwind, landing-page, design-system
pencil_find_empty_space_on_canvasFind space for new screens/frames
pencil_get_style_guide_tagsBrowse available style directions
pencil_get_style_guideGet specific style inspiration
pencil_search_all_unique_propertiesAudit property values across the document
pencil_replace_all_matching_propertiesBulk update properties (e.g., swap colors)
pencil_open_documentOpen a.pen file or create a new document

Common Mistakes to Avoid

MistakeCorrect Approach
Creating a button from scratchSearch for existing button component, insert as ref
Using fill: "#3b82f6"Use the variable: reference primary or the corresponding variable
Using cornerRadius: 8Use the variable: reference radius-md or the corresponding variable
Generating bg-[#3b82f6] in codeUse semantic Tailwind class: bg-primary
Generating text-[var(--primary)] in codeUse semantic Tailwind class: text-primary
Generating rounded-[6px] in codeUse semantic Tailwind class: rounded-md
Using var(--primary) in classNameUse semantic Tailwind class: bg-primary or text-primary
Not checking for overflowCall pencil_snapshot_layout(problemsOnly: true) after every section
Skipping screenshotsCall pencil_get_screenshot after every section
Generating a new logoCopy existing logo from another artboard with C()
Building entire screen, then checkingBuild and verify section by section
Ignoring pencil_get_guidelinesAlways call it for the relevant topic before starting
Using tailwind.config.tsUse CSS @theme block (Tailwind v4)
Using Material Icons in codeMap to Lucide icons (<Search />, <ArrowRight />, etc.)
Skipping frontend-design skillAlways load it before designing in Pencil or generating code
Generic AI aesthetics (Inter font, purple gradients)Follow frontend-design guidelines for distinctive, intentional design

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.26%
按下载量换算3,317

Claude

29.26%
按下载量换算2,753

Cursor

17.99%
按下载量换算1,692

Gemini CLI

7.94%
按下载量换算747

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills