/sketch:sketch-design-from-referencefrom Sketch
Recreates UI designs in Sketch from a URL, screenshot, or source code using Sketch MCP tools for side-by-side fidelity validation.
Ships in Sketch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sketch-hq/agents --plugin sketchBuild or refine a Sketch design to match a reference. This skill is for design-in-Sketch work; the inverse workflow is sketch-design-to-code.
The goal is visual parity with the reference — not a plausible page with similar sections. Similar is not done. Do not stop when content exists; stop when side-by-side canvas checks pass the completion criteria in references/validation.md.
get_guide with topic: "mcp" — always; MCP prerequisites, run_code rules, failure handling, and visual verification.get_guide with topic: "use" — Sketch editing, stacks, symbols, styles, overrides, assets, and prototyping.get_guide with topic: "layout" — before creating or restructuring Frames, Groups, stacks, sizing, pins, or container types.get_guide with topic: "organization" — before placing new top-level Frames on a page, or working with pages or Sketch Sections (canvas groups of whole frames, not regions of a web page).Fetch guide subtopics on demand when the task needs them: troubleshooting, styling, symbols, assets, and prototyping.
If MCP is unavailable, stop and call get_guide with topic: "troubleshooting". Do not guess layout from memory while MCP is unreachable.
Follow these steps in order. The main flow should be enough for ordinary work; load a reference file only when the step needs more detail or examples.
get_document_info.For reference-specific extraction, read references/reference-extraction.md. For comparison and completion gates, read references/validation.md before Step 5.
Inspect before mutating. Start with read-only MCP tools:
get_document_info for pages, top-level Frames/Graphics, layer counts, and existing layout candidates.get_layer_tree_summary on candidate frames or relevant pages for hierarchy, IDs, names, dimensions, text snippets, symbol-instance override counts, and stack hints.get_design_assets and get_libraries for reusable symbols/components and library assets.run_code only when summaries do not expose the needed detail.Prefer editing an existing frame only when you are sure it maps to the requested design. Otherwise, create a new frame.
Apply the tree-summary caveats from the required use guide; never treat an unexpanded or truncated node as empty.
Define the layer plan before drawing:
Do not impose a default page template. Match the reference's information architecture.
For every structured region, decide the Sketch stack model before drawing: direction, gap, padding, alignment, sizing, wrapping, and intended visual order. Use stacks for rows, columns, nav bars, toolbars, cards, lists, forms, button groups, and repeated content unless there is a specific reason the region must be freeform. Use manual coordinates for page-level placement, pinned chrome, overlays, masks, or genuinely freeform artwork.
Create or match document Color Variables (document.swatches) and shared styles for background, border, text, brand, muted text, and important surfaces. Set the page/frame background intentionally and clear accidental fills from structural groups. For symbol details, call get_guide with topic: "symbols".
Use values from the reference: computed CSS, sampled screenshot colors, or code tokens. For styling details, call get_guide with topic: "styling".
Apply small, reversible run_code edits. One script should perform one small action.
Never build a whole page, top-level region, or multi-section layout in one script. Do not combine probing, creating, styling, and reordering in the same run. Keep scripts flat: bootstrap, find target by ID, perform one mutation, log JSON. Avoid deep helper functions, nested IIFEs, and long control-flow trees.
Build from outside in:
Build one top-level region at a time. After each region's content batch:
get_screenshot the frame at the reference anchor width.After structural edits, re-query with get_layer_tree_summary or run a canvas check on the frame. For safe reorder/reparent patterns, read references/editing-patterns.md.
Use existing document/library symbols before drawing repeated one-off layer groups. Repeated UI should normally become one symbol master with instances and overrides.
Before drawing detailed shapes, classify each non-text visual. Export/import photos, screenshots, illustrations, complex SVGs, product imagery, brand marks, detailed icons, gradients, and noise as SVG/PNG/image assets. Recreate only simple UI primitives, simple editable vectors, dividers, pills, and basic shapes in Sketch.
For icons/logos/images, establish layout with simple placeholders first, then import/assign real image assets once geometry and stack order are stable. Prefer symbol image overrides on dedicated layers for repeated assets.
For symbol override patterns, read references/symbols.md. For import/export details, call get_guide with topic: "assets".
When the user reports an issue or a canvas check shows a mismatch:
get_layer_tree_summary or a targeted probe before mutating.If layout breaks or layers are lost, say so immediately and tell the user to Undo/Revert before continuing.
Do not claim done until completion criteria pass — see references/validation.md → Completion criteria.
zoomToFitCanvas until the task is complete.Direction-specific rules for Sketch → design. Generic MCP/script rules come from get_guide with topic: "mcp" and Sketch content rules come from get_guide with topic: "use".
parent.layers = [...]; use layer.index for reorder and child.parent = newParent for reparent.parent.layers = [...] can delete children or duplicate object IDs. Use safe reorder patterns instead.get_guide with topic: "layout" and verify with a canvas check.For bridge/tool-call failures, parser errors, MCP connection problems, or get_screenshot failures, call get_guide with topic: "troubleshooting" before retrying.
For document-operation failures:
get_guide with topic: "layout".get_guide with topic: "organization".get_guide with topic: "symbols".get_guide with topic: "assets".get_screenshot is empty or wrong: re-resolve the frame/layer ID, then run a canvas check on the page or parent frame if needed.get_screenshot is refused as too large: move inward to a child frame instead — widening makes it worse → get_guide with topic: "troubleshooting".get_symbol_overrides, rebuild the override ID from commonOverrideIDPrefix + '_' + property, then run a canvas check.get_guide with topic: "mcp" — MCP tools, run_code, troubleshooting, visual verification, and completion rulesget_guide with topic: "use" — Sketch editing, stacks, symbols, styles, overrides, assets, and content verificationget_guide with topic: "layout" — stacks, sizing, pins, container types, reorder/reparent, and layout driftget_guide with topic: "organization" — pages, page placement of top-level frames, and Sketch Sectionsget_symbol_overrides in MCP)2 skills in this plugin
Other plugins' skills for the same job