From Sketch
Recreates UI designs in Sketch from a reference URL, screenshot, or source code using Sketch MCP. Use when designing or reproducing a page/screen in Sketch.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sketch:sketch-design-from-referenceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build 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`.
Build 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 screenshot comparison passes 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, page placement, sizing, pins, or container types.Fetch guide subtopics on demand when the task needs them: troubleshooting, layout, 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.
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 swatches/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 screenshot 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 screenshot comparison 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.
get_screenshot at the reference anchor width.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 screenshot.For bridge/tool-call failures, parser errors, MCP connection problems, or screenshot failures, call get_guide with topic: "troubleshooting" before retrying.
For document-operation failures:
get_guide with topic: "layout".get_guide with topic: "symbols".get_guide with topic: "assets".get_screenshot is empty or wrong: re-resolve the frame/layer ID, then screenshot the page or parent frame if needed.get_symbol_overrides, rebuild the override ID from commonOverrideIDPrefix + '_' + property, then screenshot.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, page placement, sizing, pins, container types, reorder/reparent, and layout driftget_symbol_overrides in MCP)npx claudepluginhub sketch-hq/agentsGenerates UI code from Sketch designs with 1:1 visual fidelity by inspecting layers, symbols, and overrides via Sketch MCP, then maps them to reusable components and validates against screenshots.
Implement UI from design sources (Figma, Sketch, MasterGo, etc.) into production-ready frontend components. Reuses existing components, maps design tokens, ensures accessibility and type safety.
Generates live HTML/CSS visual direction proposals on scaffolded project dev server for side-by-side comparison and iterative refinement to select final UI design.