pencil-ui-design
БесплатноБез исполняемых скриптовНе проверен使用 Pencil MCP 创建工业级 UI 设计的完整工作流和组件库
Об этом скилле
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 Mode | Dark 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 |
#D4D4D8 |
Focus ring |
字体层级 (Typography Scale)
| 层级 | 大小 | 字重 | 行高 | 用途 |
|---|---|---|---|---|
| Display | 36px | 700 | 1.2 | 大标题 |
| H1 | 24px | 600 | 1.3 | 页面标题 |
| H2 | 20px | 600 | 1.4 | 区块标题 |
| H3 | 18px | 600 | 1.4 | 卡片标题 |
| Body | 14px | 400 | 1.5 | 正文 |
| Small | 12px | 400 | 1.4 | 辅助文本 |
| Caption | 10px | 500 | 1.3 | 标签 |
推荐字体: Inter (英文), Noto Sans SC (中文)
间距系统 (Spacing)
基于 4px 网格:
xs: 4pxsm: 8pxmd: 12pxlg: 16pxxl: 24px2xl: 32px3xl: 48px
圆角规范 (Border Radius)
| 变量 | 值 | 用途 |
|---|---|---|
radius-sm |
6px | 小元素 (Badge, Chip) |
radius-md |
8px | 按钮、输入框 |
radius-lg |
12px | 卡片、弹窗 |
radius-xl |
16px | 大卡片 |
radius-full |
9999px | 圆形头像 |
阴影系统 (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"
}
注意: 必须同时设置
fontSize、width和height属性,否则图标可能不显示!
常用图标速查表
| 类别 | 图标名称 | 用途 | |------|------
Установить pencil-ui-design в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pencil-ui-design?
使用 Pencil MCP 创建工业级 UI 设计的完整工作流和组件库
Как установить скилл pencil-ui-design?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pencil-ui-design запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic