pen-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePencil Design
Pencil 设计
Create and manipulate design files using Pencil MCP tools.
.pen使用Pencil MCP工具创建和操作 设计文件。
.penWorkflow
工作流程
1. Orientation
1. 初始准备
get_editor_state → Check active file and selection
get_guidelines → Load topic-specific rules (landing-page, design-system, table, code, tailwind)
batch_get → Read file structure or find componentsget_editor_state → 检查活动文件和选中内容
get_guidelines → 加载特定主题规则(登录页、设计系统、表格、代码、tailwind)
batch_get → 读取文件结构或查找组件2. Design (if creating from scratch)
2. 设计(从零开始创建时)
get_style_guide_tags → Browse available visual styles
get_style_guide → Load style guide for inspiration
open_document → Create new file if neededget_style_guide_tags → 浏览可用的视觉样式
get_style_guide → 加载样式指南获取灵感
open_document → 如有需要创建新文件3. Build
3. 构建
batch_design → Insert, update, copy, replace, move, delete nodes (max 25 ops/call)
get_screenshot → Verify visual output after changes
snapshot_layout → Debug layout issues or find clipping problemsbatch_design → 插入、更新、复制、替换、移动、删除节点(每次调用最多25个操作)
get_screenshot → 修改后验证视觉输出
snapshot_layout → 调试布局问题或查找裁剪问题4. Refine
4. 优化
get_variables → Read design tokens and themes
set_variables → Update tokens for consistent styling
replace_all_matching_properties → Bulk property updatesget_variables → 读取设计令牌和主题
set_variables → 更新令牌以保持样式一致
replace_all_matching_properties → 批量更新属性Quick Reference
快速参考
Element Types
元素类型
| Type | Purpose | Key Properties |
|---|---|---|
| Container/layout | |
| Typography | |
| Shape | |
| Component instance | |
| Icon | |
| Vector | |
| 类型 | 用途 | 关键属性 |
|---|---|---|
| 容器/布局 | |
| 排版 | |
| 形状 | |
| 组件实例 | |
| 图标 | |
| 矢量图形 | |
Layout
布局
| Property | Values |
|---|---|
| |
| |
| |
| |
| |
| 属性 | 取值 |
|---|---|
| |
| |
| |
| |
| |
Tokens
令牌
Prefix:
$--| Category | Examples |
|---|---|
| Colors | |
| Semantic | |
| Typography | |
| Radii | |
前缀:
$--| 类别 | 示例 |
|---|---|
| 颜色 | |
| 语义化 | |
| 排版 | |
| 圆角 | |
Operations (batch_design)
操作(batch_design)
Operations use JavaScript-like syntax. Every Insert/Copy/Replace needs a binding.
| Op | Syntax | Use |
|---|---|---|
| I | | Insert node |
| U | | Update properties |
| C | | Copy node |
| R | | Replace node |
| M | | Move node |
| D | | Delete node |
| G | | Apply image fill |
操作采用类JavaScript语法。每个插入/复制/替换操作都需要绑定。
| 操作 | 语法 | 用途 |
|---|---|---|
| I | | 插入节点 |
| U | | 更新属性 |
| C | | 复制节点 |
| R | | 替换节点 |
| M | | 移动节点 |
| D | | 删除节点 |
| G | | 应用图片填充 |
Component Instances
组件实例
javascript
// Insert instance and override text
card=I(container, {type: "ref", ref: "CardComp"})
U(card+"/titleText", {content: "New Title"})
// Replace slot content
newContent=R(card+"/slot", {type: "text", content: "Custom"})javascript
// 插入实例并覆盖文本
card=I(container, {type: "ref", ref: "CardComp"})
U(card+"/titleText", {content: "New Title"})
// 替换插槽内容
newContent=R(card+"/slot", {type: "text", content: "Custom"})Critical Rules
重要规则
- IDs auto-generate — never set in node data
id - Bindings required — every I/C/R must have
name=... - Max 25 ops — split larger designs across calls
- Copy descendants — use property, not separate U() calls
descendants - Verify visually — call after modifications
get_screenshot
- ID自动生成 — 切勿在节点数据中设置
id - 必须绑定 — 每个I/C/R操作都必须有
name=... - 最多25个操作 — 大型设计需拆分到多个调用中
- 复制子节点 — 使用属性,而非单独的U()调用
descendants - 视觉验证 — 修改后调用
get_screenshot
Reference Files
参考文件
| File | When to Read |
|---|---|
| mcp-operations.md | Detailed operation syntax, examples, and edge cases |
| patterns.md | Element creation examples, styling patterns, theming |
| schema.json | Authoritative property definitions for validation |
| 文件 | 阅读场景 |
|---|---|
| mcp-operations.md | 详细的操作语法、示例和边缘情况 |
| patterns.md | 元素创建示例、样式模式、主题设置 |
| schema.json | 用于验证的权威属性定义 |