From ui-color-palette
Translate Sketch layers into production-ready code with 1:1 visual fidelity using Sketch MCP tools (`run_code`, `get_selection_as_image`) for live design context, screenshots, and asset export. Use when implementing or updating UI from an open Sketch document, current selection, or specific Sketch layer IDs.
npx claudepluginhub a-ng-d/claude-ui-color-paletteThis skill uses the workspace's default tool permissions.
Implement UI from Sketch with high visual fidelity by querying live document data
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Implement UI from Sketch with high visual fidelity by querying live document data
through Sketch MCP. Use run_code to inspect and export data, and
get_selection_as_image as the visual source of truth.
http://localhost:31126/mcp.get_selection_as_image.Follow these steps in order. Do not skip steps.
If Sketch MCP calls fail:
Use these approaches in priority order:
https://sketch.com/s/<document-share-uuid>/f/<canvas-frame-uuid>: extract
the /f/<canvas-frame-uuid> value, find that layer, and select it. Prefer
this target over current selection or name-based matching.run_code to locate matching
layers and ask for confirmation.Use run_code with the find function and this pattern when a share link is provided:
const sketch = require('sketch')
const frameId = '4A2E31FF-56BD-4C29-92D2-829548D19C1D'
const frame = find(`#${frameId}`)
if (frame) sketch.getSelectedDocument().selectedLayers = [frame]
When multiple matches exist, stop and ask which layer to implement.
run_codeRun run_code to collect design data for the selected root layer (and relevant descendants):
Always start scripts with:
const sketch = require('sketch')
Pass a short title argument to run_code and keep scripts minified unless the
user asks otherwise.
If output is too large:
get_selection_as_imageCall get_selection_as_image on the same selected target. Use this image as the primary visual
reference for implementation and validation.
If selection is empty, stop and ask the user to select the intended layer/frame in Sketch.
run_codeExport icons, bitmaps, and other assets from Sketch instead of inventing placeholders.
Rules:
sketch.export, always pass both output and filename (with extension).Example:
const sketch=require('sketch');const d=sketch.getSelectedDocument()
const l=d.selectedLayers.layers[0]
sketch.export(l,{
output:'/tmp/sketch-assets',
filename:`${l.id}.png`,
formats:['png']
});console.log('ok')
Treat Sketch data as design intent, then map to project standards:
Aim for visual parity with the Sketch screenshot and context:
Validate implemented UI against the screenshot and design context checklist:
If mismatch remains, re-query with run_code for the affected subtree and iterate.
Empty selection from get_selection_as_imageCause: Nothing selected in Sketch. Fix: Ask the user to select the target layer/frame, then retry.
No document from MCP toolsCause: No open Sketch document or Sketch not running. Fix: Open the document in Sketch and retry.
run_code output is too large or truncatedCause: Selection tree is too large. Fix: Query shallow tree first, then fetch detailed context by subtree.
Cause: Invalid export options or relative output path.
Fix: Use absolute paths and pass both output and filename.
Cause: Incomplete context capture or token mismatch.
Fix: Re-capture screenshot and inspect exact node values via run_code.