
Paper Flex
Skill通过 Paper MCP 把 Paper 画布中绝对定位的设计节点改成 flex 自动布局:先读取截图与计算样式算出间距,用 x-paper-clone 保留 SVG 与图片原样,处理层级顺序与阴影,最后对比截图确认与原稿一致。需要 Paper 设计工具及其 MCP。
name: paper-flex
description: Use when converting Paper canvas or design nodes from absolute positioning to flex or auto-layout. Covers Paper MCP absolute-to-flex restructuring, x-paper-clone preservation, clone z-order, computed spacing, shadow cleanup, SVG/image fidelity, layered cards, and screenshot verification.
Paper Flex
You convert Paper layouts from absolute positioning into flex structure without losing the original pixels.
Hard rule: preserve existing visual nodes first. Recreate only plain layout wrappers or simple text/div surfaces whose computed styles are fully known.
RED/GREEN Intent
This skill closes failures seen without Paper-specific guidance:
- Using generic move/relative positioning instead of
x-paper-cloneplusupdate_styles - Losing SVG path data, image fills, crops, or exact shadows by rebuilding nodes
- Breaking z-order because Paper appends
x-paper-clonenodes after normal divs - Leaving cloned absolute
left/topoffsets inside flex flow - Letting shadows or filters become visible/inherited after restructuring
GREEN outcome: the converted node has a readable flex hierarchy, original SVG/image fidelity, verified z-order, and a screenshot that still matches the source.
Required First Pass
Before writing or deleting anything:
- Call
get_guide({ topic: "paper-mcp-instructions" }). - Call
get_basic_infoandget_selectionto confirm target artboard/node scope. - Call
get_screenshoton the target and keep it as the visual baseline. - Call
get_tree_summary(depth=10)andget_childrenon the target. - Call
get_computed_stylesfor the target and every direct visual child. Recordleft,top,width,height, colors, fonts, shadows, filters, radii, and image fills. - If text styling will be created or changed, call
get_font_family_infobefore writing typography.
Do not start conversion from memory or screenshot alone. The computed styles are the source of truth for flex math.
Source Preservation Rules
- Keep the original nodes until the converted layout has passed screenshot comparison.
- Use
<x-paper-clone node-id="...">for SVGs, images, complex vectors, icons, masks, and styled shapes. - Never hand-redraw an SVG, image, logo, or complex decorative layer. No exceptions for "simple enough."
- After cloning into flex flow, batch
update_stylesto setleft: "0px"andtop: "0px"on every flow clone. - After cloning anything that must remain overlaid, batch
update_stylesto set the requiredposition,left, andtop. Inline styles on<x-paper-clone>are not enough.
Conversion Workflow
- Map the absolute children into semantic groups: background, header row, text stack, media, card, controls, overlays.
- Compute spacing from coordinates:
gap = next.top - (current.top + current.height)
leftPadding = first.left - container.left
topPadding = first.top - container.top
- Use Paper-compatible layout:
display: flex,flex-direction,align-items,justify-content,gap, and wrapperpadding. - Do not rely on margins. Use
gap, padding wrappers, or explicit spacer frames for non-uniform spacing. - Build incrementally. Each
write_htmlcall should add one visual group or wrapper. - Use separate
write_htmlcalls whenever clone z-order matters:
1. write_html container shell
2. write_html decorative/background clones into shell
3. write_html content wrappers/divs into shell
4. update_styles cloned positions and flow offsets
- Delete original children only after the converted children exist, positions are verified, and the screenshot matches. Verify the final child list with
get_children.
Paper-Specific Traps
| Trap | Why It Breaks | Correct Move |
|---|---|---|
Setting position styles on <x-paper-clone> | Paper ignores clone position overrides at insertion time | Clone first, then call update_styles |
Mixing clones and divs in one write_html | Paper appends clones after divs, changing z-order | Insert decorative clones in an earlier write |
| Leaving original clone coordinates | Absolute offsets push flow items away from their flex slots | Reset flow clones to left: "0px", top: "0px" |
Using position: relative for overlapped cards | Paper stacks instead of overlapping in fixed wrappers | Use absolute cards inside a fixed-size wrapper |
| Keeping hidden source shadows | Flex order can reveal shadows that were covered before | Remove boxShadow on clones whose shadow was hidden by a later opaque sibling |
Applying filter to a flex parent | Filters inherit and affect children unintentionally | Apply filters only to leaf nodes that need them |
| Cloning reference SVGs blindly | Some SVG clones contain empty text children | Inspect with get_tree_summary; delete empty Text children |
Layered Cards
Open references/layered-cards.md when the design has back cards, floating badges, corner marks, or overlapping elements.
Default card stack rules:
- Card stack wrapper is a plain fixed-size frame, not a flex container.
- Back card is the first child.
- Front card uses
position: absolute; left: 0px; top: 0px. - Floating badges, labels, and corner marks are inside the stack wrapper as last children.
Good And Bad Patterns
Bad: Delete an imported SVG, write a new <svg>, put it in a flex row, and eyeball the icon.
Good: Clone the original SVG with x-paper-clone, place it in the flex row, reset its flow offsets with update_styles, then compare screenshots.
Bad: One write_html call containing a background clone and content divs.
Good: Write the shell, insert background clones in a separate call, then insert content so Paper's clone ordering cannot place backgrounds on top.
Before Marking Complete, You MUST:
- Verify the original screenshot and converted screenshot match.
- Verify no SVG, image, logo, mask, or complex shape was recreated instead of cloned.
- Verify every flow clone has
left: "0px"andtop: "0px"viaget_computed_styles. - Verify every absolute overlay clone has its intended
position,left, andtopviaget_computed_styles. - Verify decorative/background clones appear earlier than content with
get_children. - Verify overlapping badges/labels are last children of their stack/wrapper.
- Verify hidden shadows are removed where flex restructuring would reveal them.
- Verify filters are on leaf nodes only.
- Call
finish_working_on_nodeswhen done.
Do not skip any step. A skipped step means visual corruption.
相关资源

Figma Use
SkillFigma 官方技能:教 agent 用 use_figma 执行 Plugin API 脚本,直接在画布上创建和修改节点、组件、变量与自动布局,调用 use_figma 前必须先加载。需要 Figma 账号并连接远程 MCP 服务器。
figma/mcp-server-guide2.2k
Reconcile Paper Sync
Skill当由 Paper 设计稿实现的应用看起来「有点不对」时,以本地 paper-sync 项目为基准核对修复:先移植真实字体,再从 .canonical 导出文件读取精确的字号、颜色与装饰,对运行中的应用与对应画板截图比对,并区分转换偏差与设计版本变化。
millionco/skills34
Taste Skill
Skill让 agent 生成的前端摆脱模板感:先判断设计方向,再用布局变化、动效强度、信息密度三个参数调节效果;另含改版审计、极简与粗野主义风格及设计参考图生成等技能。
Leonxlnx/taste-skill113k
Stitch Design Skills
SkillGoogle Stitch 配套技能合集:由文字或图片生成界面、从代码提取 DESIGN.md,并把设计稿转成 React 或 React Native 组件。Google Labs 出品但非 Google 正式支持产品,需先配置 Stitch MCP。
google-labs-code/stitch-skills8.7k
Figma Skills (mcp-server-guide)
SkillFigma 官方技能合集:把设计稿还原成代码、用 Code Connect 映射组件、从代码生成设计系统组件库、在画布上搭建页面和 FigJam 图表。需连接 Figma MCP 服务器;写入画布目前处于 Beta 阶段,暂时免费。
figma/mcp-server-guide2.2k
figma-generate-design
Skill把代码里的页面、弹窗、侧栏等界面或文字描述,搭建成 Figma 画布上可编辑的设计稿,优先复用文件里已发布设计系统的组件与变量。Figma 官方维护,需连接 Figma 远程 MCP 服务器,并同时安装 figma-use 技能。
figma/mcp-server-guide2.2k