design-to-code

design-to-code is a skill for Claude Code, Codex from jdanigo/hydraia. It costs 158 tokens per session (2,370 once invoked), scanned A, original, MIT.

A guide for turning a finished website image into working front-end code. It rebuilds the page with reusable components for the project's framework instead of displaying the image itself.

In plain words
What is it for?
Use it when implementing a website from a JPG or PNG design in React, Next.js, Angular, Vue, Svelte, Astro, or plain HTML and CSS.
Why use it?
It reduces the gap between a visual design and the implemented page. It also provides a way to check that spacing, colours, text, and layout stay faithful to the design.

Skill for Claude CodeCodex

Part of the hydraia plugin — 51 skills, 15 commands, 26 agents, 4 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jdanigo/hydraia/design-to-code
Any agent
npx skills add jdanigo/hydraia --skill design-to-code
Clone the repo
git clone --depth 1 https://github.com/jdanigo/hydraia

Made for: Claude Code, Codex.

Or install hydraia, the plugin that ships this one along with the rest of its 51 skills, 15 commands, 26 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for design-to-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/jdanigo/hydraia/design-to-code.svg)](https://agentmods.dev/skills/jdanigo/hydraia/design-to-code)
Your own site
<a href="https://agentmods.dev/skills/jdanigo/hydraia/design-to-code"><img src="https://agentmods.dev/badge/skills/jdanigo/hydraia/design-to-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 158 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,370 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00158 $0.02370
Opus 5 $0.00079 $0.01185
Sonnet 5 $0.00032 $0.00474
Haiku 4.5 $0.00016 $0.00237

Measured 4d ago against content hash 6346fac49605, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

design-to-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/design-to-code/SKILL.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CORE DIRECTIVE: RENDER → FAITHFUL CODE

You are an elite front-end implementation strategist. The user already has a finished design render (jpg/png). Your job is to distill that render into real, idiomatic, reusable code for the repository's actual front-end stack — not to paste the image into the page.

The two failure modes you exist to prevent:

  1. Embedding the render instead of rebuilding it. Never substitute the source image (or a slice of it) for built UI. The output must be a reconstructed DOM, not a picture of the design.
  2. Design drift. The coded result must match the render — spacing, color, typography, hierarchy — verified by a screenshot-diff loop, not by vibes.

You produce code from a render. You do not generate design renders from a brief — that lives in the web-design-frames and mobile-design-frames skills. This skill consumes renders (and may invoke mobile-design-frames for a mobile render in the responsive gate, option C).

Pipeline

  1. Context — auto-detect framework + styling + existing tokens from the repo. Greenfield / empty repo → ask framework + styling.
  2. Ingest — receive the desktop render(s) from the user. 1.5 Responsive gate — ask A / B / C (below). If C → invoke mobile-design-frames.
  3. Segment — deep visual analysis → component tree + asset inventory. Classify every piece: reconstructable UI (code) vs genuine asset.
  4. Tokens — extract palette / type scale / spacing / radii / shadows → token layer. Reuse the repo's token/theme system if present; else create one, idiomatic to the stack.
  5. Asset gate — list required genuine assets → authorization + tool choice.
  6. Build — extract reusable components that consume tokens; compose the page. Icons = inline SVG, gradients/shadows/patterns = CSS. Promote an atomic element to asset only if code cannot reach fidelity (see Asset boundary).
  7. Verify — preview + screenshot the rendered code → compare against the source render → fix drift → iterate. The loop also judges asset promotion.
  8. Report — components, assets, token file, breakpoints, fidelity notes.

Read the full file on GitHub · 196 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 196 lines · 158 tokens per session scan A 6346fac49605

Subscribe to this mod's changes

design-to-code is a skill published in the GitHub repository jdanigo/hydraia (8 stars, last pushed 15d ago), licensed MIT. It adds 158 tokens to every session and 2,370 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.