A skill for Claude Code
A Claude Code skill that drives a coded page onto its Figma design and proves it with numbers. It measures the height delta of every section, renders an overlay, fixes the CSS and repeats until the difference is gone. The designer gets a report instead of walking the site by hand.
pixel-perfect-coding.zip · version 1.1
Install
unzip pixel-perfect-coding.zip -d ~/.claude/skills/
Unzip into ~/.claude/skills for a personal install, or into .claude/skills inside a project. Claude Code picks the skill up in the next session; trigger it with "Pixel perfect coding: …".
The skill closes the loop between design and code and keeps it running until the two layers coincide:
The loop ends when every section is within ±1 px, or is named in the report as deliberately left alone.
Claude Code gets a Figma frame (or an attached PNG export) and the address of the running build. It handles the rest: sets up the config, runs the loop, checks the other breakpoints and hands back the report.
Pixel perfect coding: match https://figma.com/design/…?node-id=49-605 against the build running at http://localhost:3000.
What you get back:
| File | Role |
|---|---|
SKILL.md |
the method: capture → score → overlay → fix → repeat, then guard, then report |
scripts/capture.mjs |
full-page screenshot at an exact CSS width plus DOM geometry, via CDP |
scripts/score.py |
Δh, IoU and best vertical shift per section; writes score.json |
scripts/overlay.py |
red/green/yellow overlays per section |
scripts/widths.mjs |
sweeps 320 to 1920 px and fails on any horizontal scroll |
scripts/artifact.py |
the HTML audit; numbers from score.json, overlays inlined |
reference/ |
getting exact bands out of Figma, and the traps that each cost a full round of measuring |
templates/ |
annotated config, a filled example and the notes template for the report |
<br> to even out an overlay.1.1 — Report numbers come from score.json, never retyped. A check that the layout viewport matches the frame width (a missing viewport meta tag otherwise breaks mobile silently). An exact procedure for exporting from Figma with get_screenshot and maxDimension. English default labels in the report with optional translation. Optional chromeArgs for local domains with self-signed certificates. README and MIT licence in the package.
1.0 — First public release.