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

pencil-ui-design铅笔用户界面设计

Agent Skill

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

总安装

3,434

周安装

146

GitHub Stars

75

下载量

1,203
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/allenai2014/pencil-ui-design --skill pencil-ui-design

简介

pencil-ui-design 用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。

  • 它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。
  • 使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。
  • 安装命令为 npx skills add https://github.com/allenai2014/pencil-ui-design --skill pencil-ui-design。
  • 当前分类为研究检索,适用于 Codex、Claude、Cursor、Gemini CLI。

SKILL.md

Pencil MCP 工业级 UI 设计 Skills

本 Skills 提供了一套工业级标准的 UI 设计规范,用于 Pencil MCP 设计工作。

快速开始

1. 初始化设计系统变量

在开始设计前,先设置设计系统变量:

mcp_pencil_set_variables({
  filePath: "<your-file.pen>",
  variables: {
    // 参考 design-tokens.json 中的完整变量定义
  }
})

2. 创建可复用组件

使用 reusable: true 创建组件,通过 ref 复用:

// 创建组件
buttonPrimary=I(document, {type: "frame", reusable: true, name: "Button/Primary", ...})

// 使用组件
btn1=I(someParent, {type: "ref", ref: "buttonPrimary"})

设计系统规范

颜色系统 (Color Tokens)

变量名Light ModeDark Mode用途
--background#FAFAFA#09090B页面背景
--foreground#18181B#FAFAFA主文本
--card#FFFFFF#18181B卡片背景
--card-foreground#18181B#FAFAFA卡片文本
--muted#F4F4F5#27272A次要背景
--muted-foreground#71717A#A1A1AA次要文本
--border#E4E4E7#27272A边框
--primary#18181B#FAFAFA主按钮
--primary-foreground#FAFAFA#18181B主按钮文本
--secondary#F4F4F5#27272A次按钮
--accent#FCD34D#FCD34D强调色
--destructive#EF4444#EF4444危险操作
--ring#18181B#D4D4D8Focus ring

字体层级 (Typography Scale)

层级大小字重行高用途
Display36px7001.2大标题
H124px6001.3页面标题
H220px6001.4区块标题
H318px6001.4卡片标题
Body14px4001.5正文
Small12px4001.4辅助文本
Caption10px5001.3标签

推荐字体: Inter (英文), Noto Sans SC (中文)

间距系统 (Spacing)

基于 4px 网格:

  • xs: 4px
  • sm: 8px
  • md: 12px
  • lg: 16px
  • xl: 24px
  • 2xl: 32px
  • 3xl: 48px

圆角规范 (Border Radius)

变量用途
radius-sm6px小元素 (Badge, Chip)
radius-md8px按钮、输入框
radius-lg12px卡片、弹窗
radius-xl16px大卡片
radius-full9999px圆形头像

阴影系统 (Shadows)

{
  "shadow-sm": {
    "type": "shadow",
    "shadowType": "outer",
    "color": "#0000000D",
    "blur": 2,
    "offset": {"x": 0, "y": 1}
  },
  "shadow-md": {
    "type": "shadow",
    "shadowType": "outer",
    "color": "#0000000A",
    "blur": 6,
    "offset": {"x": 0, "y": 4}
  },
  "shadow-lg": {
    "type": "shadow",
    "shadowType": "outer",
    "color": "#00000014",
    "blur": 15,
    "offset": {"x": 0, "y": 8}
  }
}

组件规范

Button 按钮

Primary Button

{
  "type": "frame",
  "name": "Button/Primary",
  "reusable": true,
  "height": 40,
  "layout": "horizontal",
  "padding": [16, 10],
  "gap": 8,
  "alignItems": "center",
  "justifyContent": "center",
  "fill": "#18181B",
  "cornerRadius": 8,
  "effect": {
    "type": "shadow",
    "shadowType": "outer",
    "color": "#0000001A",
    "blur": 2,
    "offset": {"x": 0, "y": 1}
  }
}
// 文本: fill="#FFFFFF", fontFamily="Inter", fontSize=14, fontWeight=500

Secondary Button

{
  "fill": "#F4F4F5",
  "stroke": "#E4E4E7",
  "strokeThickness": 1,
  "cornerRadius": 8
}
// 文本: fill="#18181B"

Ghost Button

{
  "fill": "transparent",
  "cornerRadius": 8
}
// Hover: fill="#F4F4F5"

Destructive Button

{
  "fill": "#EF4444",
  "cornerRadius": 8
}
// 文本: fill="#FFFFFF"

Card 卡片

{
  "type": "frame",
  "name": "Card",
  "reusable": true,
  "layout": "vertical",
  "padding": 16,
  "gap": 12,
  "fill": "#FFFFFF",
  "stroke": "#E4E4E7",
  "strokeThickness": 1,
  "cornerRadius": 12,
  "effect": {
    "type": "shadow",
    "shadowType": "outer",
    "color": "#0000000A",
    "blur": 4,
    "offset": {"x": 0, "y": 2}
  }
}

Input 输入框

{
  "type": "frame",
  "name": "Input",
  "reusable": true,
  "height": 40,
  "layout": "horizontal",
  "padding": [12, 10],
  "gap": 8,
  "alignItems": "center",
  "fill": "#FFFFFF",
  "stroke": "#E4E4E7",
  "strokeThickness": 1,
  "cornerRadius": 8
}
// Focus 状态: stroke="#18181B", strokeThickness=2

Avatar 头像

{
  "type": "frame",
  "name": "Avatar",
  "reusable": true,
  "width": 40,
  "height": 40,
  "cornerRadius": 9999,
  "fill": "#F4F4F5",
  "layout": "vertical",
  "alignItems": "center",
  "justifyContent": "center"
}

Badge 徽章

{
  "type": "frame",
  "name": "Badge",
  "reusable": true,
  "height": 22,
  "layout": "horizontal",
  "padding": [6, 8],
  "alignItems": "center",
  "justifyContent": "center",
  "fill": "#F4F4F5",
  "stroke": "#E4E4E7",
  "strokeThickness": 1,
  "cornerRadius": 6
}
// 文本: fontSize=10, fontWeight=500

图标规范

⚠️ 重要: Pencil MCP 使用 Material Symbols Rounded 图标字体,不是 Lucide!

基本用法

{
  "type": "icon_font",
  "iconFontFamily": "Material Symbols Rounded",
  "iconFontName": "home",
  "fontSize": 24,
  "width": 24,
  "height": 24,
  "fill": "#71717A"
}
注意: 必须同时设置 fontSizewidthheight 属性,否则图标可能不显示!

常用图标速查表

类别图标名称用途
导航home, menu, arrow_back, arrow_forward, close导航和菜单
操作add, edit, delete, search, settings常用操作
状态check_circle, error, warning, info状态提示
媒体headphones, mic, volume_up, play_arrow, pause音频视频
社交person, group, share, favorite, star社交功能
文件folder, description, menu_book, article文件文档
通信mail, chat, notifications, send消息通知
游戏extension, sports_esports, military_tech游戏奖励
学习school, lightbulb, timer, assignment教育学习

图标尺寸规范

尺寸用途
XS16px辅助小图标、徽章内
SM20px按钮内图标、列表图标
MD24px标准图标、导航图标
LG32px大按钮、空状态图标
XL48px特殊强调、卡片主图标

完整示例

// 创建一个带图标的按钮
iconBtn=I(parent, {
  type: "frame",
  width: 48,
  height: 48,
  layout: "vertical",
  alignItems: "center",
  justifyContent: "center",
  fill: "#1E2A2F",
  cornerRadius: 9999
})
icon=I(iconBtn, {
  type: "icon_font",
  iconFontFamily: "Material Symbols Rounded",
  iconFontName: "add",
  fontSize: 24,
  width: 24,
  height: 24,
  fill: "#FFFFFF"
})

图片素材处理

使用 G() 操作生成图片

Pencil MCP 提供 G() 操作来生成或获取图片,支持两种方式:

AI 生成图片 (推荐用于插画、头像、图标)

// 先创建一个 frame 容器
avatar=I(parent, {type: "frame", width: 48, height: 48, cornerRadius: 9999})
// 使用 AI 生成图片填充
G(avatar, "ai", "cute cartoon boy avatar, friendly smile, warm colors, children illustration style")

Stock 图片 (推荐用于真实照片)

// 获取 Unsplash 图片
heroImg=I(parent, {type: "frame", width: 400, height: 300})
G(heroImg, "stock", "modern office workspace laptop natural light")

Prompt 编写技巧

类型好的 Prompt不好的 Prompt
头像"cute cartoon boy, round face, brown hair, warm yellow background, simple illustration""boy"
图标"isometric cloud server icon, soft gradients, minimalist""server"
背景"abstract gradient purple blue, soft blur, dreamy atmosphere""background"

图片使用注意事项

  1. 没有 image 节点类型 - 图片只能作为 frame/rectangle 的填充
  2. 先创建容器 - 必须先用 I() 创建 frame,再用 G() 应用图片
  3. 设置正确尺寸 - frame 的 width/height 决定显示尺寸
  4. 圆角裁剪 - 设置 cornerRadius: 9999 可实现圆形图片

文本处理规范

防止文本溢出

当文本内容较长时,必须设置以下属性防止溢出:

{
  "type": "text",
  "content": "这是一段很长的文本内容...",
  "width": "fill_container",
  "textGrowth": "fixed-width",
  "lineHeight": 1.5
}

textGrowth 属性说明

说明适用场景
"auto"文本根据内容自动调整宽度(默认)短文本、标签
"fixed-width"固定宽度,超出自动换行段落、描述文本
"truncate"固定宽度,超出显示省略号列表项标题

常见文本样式

// 段落文本 (自动换行)
paragraph=I(parent, {
  type: "text",
  content: "这是一段较长的描述文本,需要自动换行显示。",
  width: "fill_container",
  textGrowth: "fixed-width",
  fontSize: 14,
  lineHeight: 1.5,
  fill: "#71717A"
})

// 标题文本 (单行)
title=I(parent, {
  type: "text",
  content: "标题文本",
  fontSize: 18,
  fontWeight: 600,
  fill: "#1E2A2F"
})

设计工作流

第一步:设置设计系统

  1. 打开或创建.pen 文件
  2. 使用 mcp_pencil_set_variables 设置颜色变量
  3. 创建可复用组件

第二步:创建页面结构

  1. 创建页面 Frame (390x844 for iPhone)
  2. 设置背景色 #FAFAFA
  3. 使用垂直布局 layout: "vertical"

第三步:使用组件构建 UI

  1. 通过 ref 引用可复用组件
  2. 使用 U() 覆盖特定属性
  3. 保持设计一致性

第四步:验证设计

  1. 使用 mcp_pencil_get_screenshot 截图检查
  2. 验证对齐、间距、颜色
  3. 检查字体和图标一致性

第五步:迭代优化

  1. 根据反馈调整细节
  2. 确保无视觉错误
  3. 输出最终设计稿

批量更新样式

使用 mcp_pencil_replace_all_matching_properties 批量替换属性:

mcp_pencil_replace_all_matching_properties({
  filePath: "design.pen",
  parents: ["pageId1", "pageId2"],
  properties: {
    "fillColor": {"#FFF9F2": "#FAFAFA"},
    "fontFamily": {"Fredoka": "Inter"},
    "cornerRadius": {24: 12}
  }
})

质量检查清单

  • 所有页面背景统一 (#FAFAFA)
  • 所有卡片有边框 (1px #E4E4E7)
  • 阴影效果一致 (blur 2-6px)
  • 按钮圆角统一 (8px)
  • 字体统一 (Inter)
  • 图标库统一 (Lucide)
  • 字体层级正确 (12/14/16/18/20/24px)
  • 间距遵循 4px 网格

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Claude

32.32%
按下载量换算389

Codex

32.02%
按下载量换算385

Cursor

17.59%
按下载量换算212

Gemini CLI

9.07%
按下载量换算109

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

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

安装前确认

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

来源信息

继续浏览同类 Skills