/bytedesk-designer:bytedesk-designer-translatefrom bytedesk-designer
Turn an approved mockup image into a pixel-accurate HTML/CSS surface, and keep an implementation pixel-identical to that surface. Claude measures the mockup on a ruler grid and directs; Codex writes the markup; a screenshot-and-diff loop converges in as few rounds as possible. Use this whenever someone has a generated or drawn mockup (a codex render, a Figma export, a screenshot of another app) and wants it built for real, whenever they say the implementation 'doesn't match the mockup', 'isn't pixel perfect', or 'drifted from the design', and whenever a surface must be proven against a live URL rather than eyeballed. Requires the Codex CLI installed and signed in, and node with the Playwright CLI reachable through npx.
Ships in bytedesk-designer. 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.
A mockup image is direction, not a pixel source. Image models redraw every rendering, garble text and invent chrome; a Figma export flattens to its own pixel grid. So "pixel perfect against the PNG" is not a number that reaches zero, and chasing it burns rounds. What can reach zero is the gap between a token-accurate HTML surface and the implementation that adopts its stylesheet. This stage makes both gaps small, in that order, with the least work: measure once, build once, diff, patch only what the diff names.
Two numbers, two meanings — never swap them:
| comparison | number | ceiling | what it gates |
|---|---|---|---|
| surface ↔ mockup PNG | layoutScore (coarse luminance grid, tolerant of text and grain) | ~0.97 on a good translation; it never reaches 1.0 | "this surface is the mockup" |
| surface ↔ implementation URL | pixelDiff (strict per-pixel) | 0.0 — achievable because both load the same stylesheet | "the app has not drifted" |
Reporting a pixelDiff against a generated PNG as if it were the gate is the failure this stage exists to prevent. It punishes the surface for the model's garbled microcopy and tells the operator nothing they can act on.
Claude has the eye and the ruler; Codex has the hands. Claude measures, decides what a region's numbers are, hands Codex a brief with numbers in it, renders the result, looks, and names the next change. Codex writes and rewrites the HTML. Codex never measures a mockup (it cannot see the grid the way Claude does) and Claude never types the markup (that is what produced 8/12 generic-interface tells when the orchestrator did it inline).
Preflight once per session, from ${CLAUDE_PLUGIN_ROOT}/references/codex-handoff.md:
command -v codex && codex --version
echo "Reply with exactly: OK" | timeout 60 codex exec --skip-git-repo-check -s read-only -
npx --yes playwright --version
Use ${CLAUDE_PLUGIN_ROOT}/scripts/codex-exec.sh in text mode for every Codex call.
direction/images/ or a mockups run; the prompt beside it tells you what is real and
what the model invented.${CLAUDE_PLUGIN_ROOT}/scripts/authority-doctor.sh.
Vendor its CSS adapter into surfaces/tokens/ with a .source-sha exactly as the
surface stage does. The surface loads it; it carries no hex of its own.<link> the implementation's global sheet (which itself imports the tokens) rather than
vendoring the authority's tokens alone. Two sheets that are merely similar leave a
pixelDiff floor that no patch round can remove; one shared sheet makes zero reachable,
and every remaining difference is then a markup or rule difference the app can adopt.Read references/loop.md before the first round; it carries the prompt shapes and the
stopping rules. The shape:
translate/SPEC.mdnode ${CLAUDE_PLUGIN_ROOT}/skills/bytedesk-designer-translate/scripts/grid.mjs <mockup.png> translate/grid-<state>.png --logical 1280
Read the gridded copy. Orange lines are 100 logical px, blue 20, thick white ticks 500. Write the spec as numbers, not adjectives: column widths and their ratio, outer and inner insets, row heights, control sizes, type sizes (cap height ≈ 0.7 × font size), radii, which elements are lit and which are matte. Twenty to forty lines. Also write down what the mockup invented — a title bar, hollow thumbnail slots, a stat panel — so it is not built. Decide "invented" against what the product actually is, not against the picture: read the state's brief, the requirements, or the app's own source when you have it, and ask when you have none. A panel that describes something other than the state's subject (image metadata behind a project dialog, a language/licence block on a design tool) is the model filling space; a control the state genuinely needs but the mockup omitted is a gap to fill, not an invention to copy. A measurement written down once saves a round for every state that shares the layout, which is why the spec is per layout, not per state.
Type sizes are the measurement most often wrong, and the most expensive when wrong: a
mono size 0.5px too large wraps a line the mockup keeps on one, and every row below it
shifts. So for every text block, record a wrap check alongside the size: the longest
line's character count and the column width it sits in. chars × 0.6 × size ≤ width for
mono (≈0.5 for sans) is the arithmetic; if it fails, the size is wrong, not the column.
Two minutes here is the cheapest round you will ever not run.
Hand Codex the spec, the vendored token sheet's custom-property names, the state's content,
and the rules from the surface stage (no hex, no rgb, var(--…) only, and the product-scope
attribute the authority's own stylesheet uses on the root — read the sheet; ByteDesk's is
data-bd-product, a scaffolded authority's is data-product). Text mode; artifact only.
Save to surfaces/<state>.html.
The spec must carry the copy as well as the numbers — every label, every row of list content, every line of prose the state shows. A spec that says "a transcript" gets Codex inventing one, and an invented transcript is a round spent removing it.
If the state contains an illustration or a stage image, mask its rect on both sides
(--mask x,y,w,h, repeatable) — the mockup's fog is not the surface's fog, and without the
mask every hotspot lands on it while the chrome you can actually fix goes unranked.
${CLAUDE_PLUGIN_ROOT}/skills/bytedesk-designer-translate/scripts/shoot.sh surfaces/<state>.html translate/shots/<state>-r1.png 1280x800
node ${CLAUDE_PLUGIN_ROOT}/skills/bytedesk-designer-translate/scripts/compare.mjs <mockup.png> translate/shots/<state>-r1.png translate/diff/<state>-r1
Read the screenshot and diff.png. The report's hotspots are the grid cells that
differ most, as logical rects. They are the work list — nothing else is.
For each hotspot (top three or four, never all eight), look at that region in both images and decide the number that is wrong: "left column 340px, surface has 380"; "thumbnail cards 110×110 with the label inside, surface has 96×64 below". Hand Codex the current file and those numbered changes; ask for the whole file back with only those rules changed. A round that changes five unrelated things teaches nothing when it fails.
Stop when the top hotspot's lumDiff is under 0.04 and the layoutScore has moved less
than 0.005 since the last round — the remaining difference is text and grain, and another
round is a coin flip. Three rounds is the ceiling. If round three still has a structural
hotspot, the spec is wrong, not the prompt: re-measure that region, correct SPEC.md,
and take one more round as a disclosed exception — not two. If that round does not
close it, stop and report the region as unresolved with the numbers; a fifth round is
where "least work" has already been lost.
Put the implementation into the same state first — the same project selected, the same panel open, the same data — or the diff measures absent content, not drift. A dev URL that renders a blank body outside its native shell is a defect to report, not a gate result.
${CLAUDE_PLUGIN_ROOT}/skills/bytedesk-designer-translate/scripts/shoot.sh <url> translate/shots/<state>-app.png 1280x800
node ${CLAUDE_PLUGIN_ROOT}/skills/bytedesk-designer-translate/scripts/compare.mjs translate/shots/<state>-rN.png translate/shots/<state>-app.png translate/diff/<state>-app --threshold 16
pixelDiff is the gate here; 0.01 (one percent) is the most that should pass, and the
report says which rects carry the rest. Fix the implementation's CSS to match the surface —
not the other way round — because the surface is the one that was measured.
translate/
SPEC.md the measurements, the invented-element list, the logical width
grid-<state>.png the gridded mockup that was measured
prompts/<state>-r<N>.txt exactly what Codex was handed, every round
shots/<state>-r<N>.png each round's render; <state>-app.png for the implementation
diff/<state>-r<N>/ diff.png + report.json per round; <state>-app/ for the gate
notes.md provenance header, then per round: hotspots chosen, change made, scores
surfaces/<state>.html the deliverable, loading surfaces/tokens/
Record every screenshot you read in state.json under stages.translate.viewed, and the
final scores under stages.translate.scores. A surface whose diff you did not look at is
not translated; it is generated.
--ds-color-surface block at
the same rect) and the score stops lying about the chrome around it.Shared contracts: ${CLAUDE_PLUGIN_ROOT}/references/run-folder-contract.md,
${CLAUDE_PLUGIN_ROOT}/references/codex-handoff.md (text mode),
${CLAUDE_PLUGIN_ROOT}/references/claude-codex-collaboration.md.
evals/evals.json (opens in a new tab)evals/workspace/iteration-1/benchmark.json (opens in a new tab)evals/workspace/iteration-1/benchmark.md (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/eval_metadata.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/eval_metadata.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/grading.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/RESULT.md (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/state.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/surfaces/render-failed.html (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/surfaces/tokens/design.css (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/SPEC.md (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/diff/render-failed-r1/report.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/diff/render-failed-r2/report.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/notes.md (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/prompts/render-failed-r1.txt (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/prompts/render-failed-r2.txt (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/render-failed-r1-log.txt (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/render-failed-r1-reply.txt (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/render-failed-r1.attempts.json (opens in a new tab)evals/workspace/iteration-1/eval-0-measure-then-build/with_skill/run-1/outputs/2026-08-28-render-failed/translate/render-failed-r1.session-id (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
9 skills in this plugin
/bytedesk-designerRun design work end to end: product idea to design brief to identity to art direction to real HTML screens to a published storybook, with an independent review before anything ships. Use this whenever someone wants to design a product, see what their idea would look like, get mockups made, refresh a look, or design several products or screens at once - and whenever design work needs more than one stage but nobody has said which. Works from nothing at all, bootstrapping a design system first if none exists, or picks up from a run already partly done. Fans out one focused worker per surface so attention does not dilute across a batch, and keeps set-level judgement in one place. Requires the Codex CLI installed and signed in./bytedesk-designer-authorityCreate, audit, or extend a design-authority repository: the single source of truth for design tokens, per-product profiles, motif language, and the rules governing what generated art may be. Use this when someone wants to start a design system, set up design tokens, capture an existing look as a reusable system, add a product to one they already have, decide a product accent, or check whether their tokens, CSS and docs still agree. Also use it when another design task cannot find an authority to read, since nothing else in the suite can run without one. Bootstraps from nothing, from a scattering of existing brand values, or from a live site or screenshot to reverse-engineer. Produces a real git repository with a validator, not a document. Requires the Codex CLI installed and signed in./bytedesk-designer-directionEstablish the visual world of a product by generating and critiquing art direction: Claude briefs, the Codex CLI renders, Claude looks at the result and re-briefs until it lands. Use this whenever someone wants an image made, changed, or explored - moodboards, hero and header graphics, social and ad creative, illustrations, spot art, packaging, textures, or abstract pieces that establish how something should feel. Trigger it even when they never say Codex or image generation, as in a header graphic for the launch post, or that image is too busy redo it. Also covers variants of an existing image and edits to one they already have. Reads the design authority live for the palette, the product motif, and the rules on what generated art may be, rather than inventing a look. For logos, marks, and icons use the identity skill instead. Requires the Codex CLI installed and signed in./bytedesk-designer-discoveryTurn a product idea into a design brief a designer or an agent can actually build from: who it is for, which surfaces exist, what constraints are real, how it should sound, and what it must never look like. Use this at the start of any design work, whenever someone describes a product they want to build and wants to see it, or when design work has begun without anyone writing down what it is for. Also use it when an existing brief is thin, contradictory, or reads as a list of adjectives. Generates two or three genuinely different product framings with the Codex CLI so the operator can choose by rejecting rather than by describing, then commits to one. Produces a brief every later stage reads. Requires the Codex CLI installed and signed in./bytedesk-designer-identityDesign a logo mark, app icon, or favicon and ship it as a real asset kit rather than a picture of a logo. Use this whenever someone wants a logo, a mark, a wordmark, a brandmark, an app icon, a favicon, or a set of icons - made, revised, or explored. Generates two or three concepts with the Codex CLI to find the idea fast, then redraws the winner as SVG by hand and delivers a vector master, a PNG size ladder, a favicon carrying sizes drawn at size, ground variants, and a proof showing it at 16px where marks actually die. Exists as a separate stage because image models have an unbreakable white-background prior for marks and cannot produce exact geometry. Requires the Codex CLI installed and signed in./bytedesk-designer-publishAssemble finished design work into a browsable storybook that anyone can open: every surface rendered live, every direction piece beside the brief that produced it, provenance attached, and a manifest recording what came from where. Use this when design work is done and needs to be shared, shown, handed over, reviewed by people, or kept somewhere it will not rot - a storybook, a gallery, a contact sheet, a design index, a handoff package. Also use it to add newly finished work to a storybook that already exists. Builds a static zero-dependency site that loads the design authority's real stylesheet, so what it shows cannot drift from what the system says.npx claudepluginhub bytedeskai/bytedesk-marketplace --plugin bytedesk-designer