npx claudepluginhub skobak/pixThis skill is limited to using the following tools:
User provides a Figma link. You implement it pixel-perfect. That's it.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
User provides a Figma link. You implement it pixel-perfect. That's it.
Tool names may vary based on your MCP configuration (e.g.,
figma__get_screenshotormcp__figma__get_screenshot). Run/mcpto see available tools.
| Tool | Cost | Use For |
|---|---|---|
get_metadata | Cheap | Node tree with child IDs, positions, sizes. No styling. |
get_variable_defs | Cheap | All design tokens (colors, spacing, radii) as name→value. |
get_code_connect_map | Cheap | Check which Figma nodes map to existing code components. |
get_screenshot | Medium | Visual image of a specific node. Target a nodeId to crop/zoom. |
get_design_context | Expensive | Full code + styling + assets. NEVER call on a large parent — call on individual sections. |
Core rule: Cheap calls first to build a map, then expensive calls only on the smallest necessary nodes.
Claude API limits images to 2000px per dimension when >20 images are in a conversation. Old images cannot be individually removed.
getComputedStyle for numerical properties — zero image cost/compact drops old images from context (see Recovery section)When the user provides a Figma link, extract fileKey and nodeId from the URL and immediately start working. If any MCP call or Chrome interaction fails, run the Doctor Check to diagnose and fix, then resume.
Call get_metadata(nodeId, fileKey):
<Frame id="45:1" name="Header" type="FRAME" x="0" y="0" width="1440" height="80">
<Component id="45:10" name="Logo" x="20" y="16" width="120" height="48"/>
<Frame id="45:15" name="NavLinks" x="400" y="20" width="600" height="40">
<Text id="45:16" name="Home" x="0" y="0" width="60" height="40"/>
</Frame>
</Frame>
Build a mental map:
nodeIdCall get_variable_defs(nodeId, fileKey). Save the result — do NOT call this again.
Call get_code_connect_map(nodeId, fileKey). For matched components, follow this priority:
Call get_screenshot(nodeId, fileKey) on the root selection. This is Image 1 of your budget — your layout reference. Do NOT retake it.
At this point you have NOT called get_design_context at all. You have a complete structural map, all tokens, reusable component info, and a visual reference — all from cheap calls.
Study the design deeply, memorize every detail, then code from memory.
Using the metadata tree, implement the outer layout:
The metadata + visual overview are usually sufficient. Only call get_design_context if you need specific properties you can't infer.
For each major section:
Figma Detail: get_screenshot(sectionNodeId, fileKey) — zoomed-in visual reference.
Design Context: get_design_context(sectionNodeId, fileKey) — text only, no image cost. If truncated, use child node IDs from get_metadata and fetch children individually.
Absorb every detail: fonts, sizes, weights, colors, spacing, borders, shadows, icon shapes. Burn it into memory.
Color sanity check: Compare get_design_context colors against the Figma screenshot. If the screenshot reveals opacity layering, overlapping fills, or gradients — the raw token values will be wrong. Use the visual truth, not the raw token.
No Chrome screenshots during this phase. You are studying, not checking.
Key rule: NEVER call get_design_context on the root selection. Always target the smallest meaningful node.
Implement everything using what you memorized:
.claude/rules, CLAUDE.md, and project instruction files. Follow established patterns for component structure, file placement, naming, and styling. Figma MCP output is a design representation — translate it into your project's conventions, don't paste it verbatim.Frontend only. Don't touch backend, API routes, or database unless the user explicitly asks. Use mock/placeholder data if APIs don't exist yet.
Minimize screenshots during coding. You studied the design — use what you memorized. But if you're missing crucial data for a specific element (exact icon shape, a nested layout you didn't drill into, a subtle gradient), take a targeted get_screenshot on that Figma node rather than guessing. Getting it right the first time is cheaper than a refinement round.
NEVER hardcode values. Sync to the project's design system:
tailwind.config.* if a token is missing. Never text-[#f3f3f3].:root. Never scatter magic values.Icons: Find a match in the project's existing icon library first — by name, then by visual shape. Match stroke-width and size exactly.
Fallback: If the layer name doesn't map, get_screenshot(iconNodeId) and identify visually. Match by shape, not name.
Images/illustrations: Download from the Figma MCP assets endpoint and save to the project's public/static folder. Don't create inline SVG blobs for complex illustrations. Don't import new icon packages without asking.
Before writing code for ANY element, verify ALL applicable properties:
Layout Principle: Avoid hardcoded sizes. With correct font-size, line-height, padding, and parent width, elements render correctly. Hardcoded dimensions are a symptom of wrong upstream layout.
Responsive: Consider how the component adapts to different screen sizes. Use the project's responsive approach (Tailwind breakpoints, media queries, container queries).
Never use approximate Tailwind classes (like text-zinc-500) when exact hex values are available from tokens.
You think you're done. Now prove it. Keep cycling until the result is perfect.
Step 1: Chrome screenshot (1 image)
First look at what you built. Compare against Figma screenshots in context. Be extremely picky:
Step 2: Numerical audit (zero images)
Run getComputedStyle on every element and compare against Figma values:
const el = document.querySelector('.target-element');
const s = getComputedStyle(el);
JSON.stringify({
padding: s.padding, margin: s.margin, gap: s.gap,
backgroundColor: s.backgroundColor, color: s.color,
fontSize: s.fontSize, fontWeight: s.fontWeight,
lineHeight: s.lineHeight, letterSpacing: s.letterSpacing,
borderRadius: s.borderRadius, borderWidth: s.borderWidth,
borderColor: s.borderColor, boxShadow: s.boxShadow
});
12px is not 10px. #f97316 is not #ff611c.
CSS specificity check: Icons inside wrapper components (Button, Link) often get wrong colors from parent overrides. Run getComputedStyle on the SVG itself. If the computed color doesn't match, use the Tailwind important modifier (prefix with !) to force it.
Step 3: Picky mismatch list
Combine visual + numerical issues into one list. No issue is too small. 2px off? List it.
Step 4: Fix everything
Batch all fixes. No screenshots between individual fixes.
Step 5: Repeat from Step 1
Exit condition: Retake get_screenshot on the Figma root node. Place side-by-side with your latest Chrome screenshot. Compare colors directly. Only move on when both screenshots match AND numerical audit shows zero mismatches.
If an icon looks wrong during any loop iteration:
get_screenshot(iconNodeId, fileKey) on the Figma iconCommon mismatches:
If it doesn't match: try another icon from the library, or use the Figma SVG inline.
This ALWAYS misses: 2-4px spacing differences, wrong icon variant, slightly wrong color, missing shadow, font weight mismatch.
RULE: Not done until zero visual mismatches AND zero numerical mismatches.
If you hit the image limit (or proactively after ~15 screenshots):
/compact — summarizes conversation, drops old images. Notes and progress are preserved.Repeatable: compact → retake 3 → continue → compact again if needed.
Stop and ask:
If the user provides a new link, re-run Phases 1-3 scoped to that selection.
Run this ONLY when something fails. Not at startup.
Figma MCP not working?
whoami to check authenticationChrome not responding?
Dev server not running?
package-lock.json (npm), yarn.lock (yarn), pnpm-lock.yaml (pnpm), bun.lockb (bun)package.json for dev command and portlsof -i :<PORT> — if not running, start in backgroundUnknown design system or icon library?
package.json: tailwindcss, styled-components, @emotion/*, @chakra-ui/*, @mui/*, @mantine/*lucide-react, @heroicons/react, react-icons, @radix-ui/react-icons, @fortawesome/*, @phosphor-icons/react, @tabler/icons-reactInvocation:
/pix
> Paste Figma link: https://figma.com/design/abc123/MyApp?node-id=42-100
What happens:
get_metadata + get_variable_defs + get_code_connect_map (0 images)get_screenshot on root (image 1)get_screenshot (image 2) + get_design_context (text). Memorize.get_screenshot (image 3) + get_design_context (text). Memorize.get_screenshot on Figma icon (image 5) — swap it.get_screenshot (image 8) side-by-side with Chrome → match.Bad patterns:
getComputedStyle gives for free/compact when approaching image limitget_design_context on root (token waste)get_variable_defs more than once (redundant)text-[#f3f3f3])w-[247px])