pencil basics
npx skills add https://github.com/gyejoon/pencil-plugin --skill Pencil Basics
Skill 文档
Pencil Basics
Pencil MCP ìë²ë¥¼ ì¬ì©íì¬ .pen íì¼ì ì½ê³ , ìì íê³ , ëìì¸ì ìì±íë ë°©ë²ì ì ê³µíë¤.
Core Concepts
.pen íì¼ êµ¬ì¡°
.pen íì¼ì ëìì¸ ë°ì´í°ë¥¼ ì ì¥íë ìí¸íë íìì´ë¤. ë°ëì Pencil MCP ëêµ¬ë§ ì¬ì©íì¬ ì ê·¼íë¤.
ì¤ì: Read, Grep, Write ëêµ¬ë¡ .pen íì¼ì ì§ì ì½ê±°ë ì°ì§ ìëë¤. íì Pencil MCP ë구를 ì¬ì©íë¤.
ë ¸ë íì
| Type | ì©ë | 주ì ìì± |
|---|---|---|
frame |
컨í ì´ë, ë ì´ìì | layout, gap, padding, fill |
text |
í ì¤í¸ ì½í ì¸ | content, fontSize, fontWeight, textColor |
rectangle |
ì¬ê°í ëí | fill, stroke, cornerRadius |
ellipse |
ì/íì | fill, stroke |
ref |
ì»´í¬ëí¸ ì¸ì¤í´ì¤ | ref (ì»´í¬ëí¸ ID 참조) |
image |
ì´ë¯¸ì§ íë ì | G() ì¤í¼ë ì´ì ì¼ë¡ ì ì© |
icon_font |
ìì´ì½ | icon, iconSize |
ë ì´ìì ìì¤í
Auto Layout ìì±:
layout: "horizontal" | "vertical" | "grid"
gap: number (ìì ê° ê°ê²©)
padding: number | [top, right, bottom, left]
alignItems: "start" | "center" | "end" | "stretch"
justifyContent: "start" | "center" | "end" | "space-between"
í¬ê¸° ì§ì :
width: number | "fill_container" | "hug_contents"
height: number | "fill_container" | "hug_contents"
Essential Tools
1. get_editor_state
íì¬ ìëí° ìíì ì íë ë ¸ë ì 보를 ê°ì ¸ì¨ë¤.
mcp__pencil__get_editor_state(include_schema: boolean)
ëìì¸ ìì ìì ì íì í¸ì¶íì¬ íì± íì¼ê³¼ ì í ìí를 íì¸íë¤.
2. batch_get
ë ¸ë를 ê²ìíê±°ë IDë¡ ì½ëë¤.
mcp__pencil__batch_get(
filePath: string,
patterns?: [{ reusable?: boolean, type?: string, name?: string }],
nodeIds?: string[],
readDepth?: number,
searchDepth?: number
)
ì¬ì© ìì:
- ì¬ì¬ì© ì»´í¬ëí¸ ëª©ë¡:
patterns: [{ reusable: true }] - í¹ì ë
¸ë ì½ê¸°:
nodeIds: ["nodeId1", "nodeId2"] - í
ì¤í¸ ë
¸ë ê²ì:
patterns: [{ type: "text" }]
3. batch_design
ëìì¸ ìì ì¤í¼ë ì´ì ì ì¤ííë¤.
mcp__pencil__batch_design(
filePath: string,
operations: string // JavaScript ì ì¬ êµ¬ë¬¸
)
4. get_screenshot
ë ¸ëì ì¤í¬ë¦°ì·ì ê°ì ¸ì ìê°ì ì¼ë¡ ê²ì¦íë¤.
mcp__pencil__get_screenshot(filePath: string, nodeId: string)
ëìì¸ ìì í íì ì¤í¬ë¦°ì·ì¼ë¡ 결과를 íì¸íë¤.
batch_design Operations
Insert (I)
ì ë ¸ë를 ì½ì íë¤.
// 기본 ì½ì
frame1=I("parentId", { type: "frame", layout: "vertical", gap: 16 })
text1=I(frame1, { type: "text", content: "Hello", fontSize: 16 })
// ì»´í¬ëí¸ ì¸ì¤í´ì¤ ì½ì
button=I("parentId", { type: "ref", ref: "ButtonComponentId" })
Update (U)
기존 ë ¸ëì ìì±ì ì ë°ì´í¸íë¤.
// ì§ì ì
ë°ì´í¸
U("nodeId", { fill: "#FF0000", padding: 16 })
// ì»´í¬ëí¸ ì¸ì¤í´ì¤ ë´ë¶ ë
¸ë ì
ë°ì´í¸
U("instanceId/labelId", { content: "New Label" })
Copy (C)
ë ¸ë를 ë³µì¬íë¤.
// ë¨ì ë³µì¬
copy1=C("sourceId", "parentId", { x: 100, y: 100 })
// ìì± ì¤ë²ë¼ì´ëì í¨ê» ë³µì¬
copy2=C("sourceId", "parentId", {
descendants: {
"labelId": { content: "Copied Label" }
}
})
Replace (R)
ë ¸ë를 ì ë ¸ëë¡ êµì²´íë¤.
newNode=R("oldNodeId", { type: "text", content: "Replaced" })
Delete (D)
ë ¸ë를 ìì íë¤.
D("nodeId")
Move (M)
ë ¸ë를 ë¤ë¥¸ ìì¹ë¡ ì´ëíë¤.
M("nodeId", "newParentId", 0) // indexë ì íì¬í
Generate Image (G)
íë ìì ì´ë¯¸ì§ë¥¼ ì ì©íë¤.
// AI ìì± ì´ë¯¸ì§
imgFrame=I("parentId", { type: "frame", width: 400, height: 300 })
G(imgFrame, "ai", "modern office workspace")
// ì¤í¡ ì´ë¯¸ì§
G("existingFrameId", "stock", "nature landscape")
Workflow Patterns
ì íë©´ ìì±
get_editor_stateë¡ íì¬ ìí íì¸batch_getì¼ë¡ ì¬ì© ê°ë¥í ì»´í¬ëí¸ íì¸get_guidelinesë¡ ëìì¸ ê°ì´ëë¼ì¸ ë¡ëget_style_guide_tags+get_style_guideë¡ ì¤íì¼ ìê° ì»ê¸°batch_designì¼ë¡ íë©´ 구ì±get_screenshotì¼ë¡ ê²°ê³¼ ê²ì¦
ì»´í¬ëí¸ ìì
batch_getì¼ë¡ ëì ë ¸ë 구조 íìbatch_designì U() ì¤í¼ë ì´ì ì¼ë¡ ìì± ìì get_screenshotì¼ë¡ ë³ê²½ì¬í íì¸
ë ì´ìì 문ì í´ê²°
snapshot_layoutì¼ë¡ ë ì´ìì 구조 ë¶ì- ì¤ë²íë¡ì°, í´ë¦¬í 문ì íì¸
batch_designì¼ë¡ ìì get_screenshotì¼ë¡ ê²ì¦
Best Practices
Do
- 매 batch_design í get_screenshotì¼ë¡ ê²ì¦
- ìì ë¨ìë¡ ì¤í¼ë ì´ì ì¤í (ìµë 25ê°)
- ë°ì¸ë© ì´ë¦ì ë§¤ë² ìë¡ ìì±
- ì»´í¬ëí¸ ìì ì ì¸ì¤í´ì¤ ê²½ë¡ ì¬ì© (instanceId/childId)
Don’t
- Read, Write, Grepì¼ë¡ .pen íì¼ ì§ì ì ê·¼
- í ë²ì ë무 ë§ì ì¤í¼ë ì´ì ì¤í
- ë°ì¸ë© ì´ë¦ ì¬ì¬ì©
- id ìì± ì§ì ì§ì (ìë ìì±ë¨)
Additional Resources
Reference Files
references/node-properties.md– 모ë ë ¸ë íì ì ìì¸ ìì±references/layout-examples.md– ë ì´ìì í¨í´ ìì