Skip to content
Development
Skill

/design-to-code

Elite render-to-code skill. The user brings a finished website design render (jpg/png); this skill distills it into real, idiomatic, reusable front-end components for the repo's actual stack (React, Next, Angular, Vue, Svelte, Astro, or plain HTML/CSS) — never embedding the

From plugin
hydraia
852 skills27 agents17 commands6 hooks

Claude Code

$ npx -y skills add jdanigo/hydraia --skill design-to-code --agent claude-code

SKILL.md

design-to-code.SKILL.md
name: design-to-code
description: Elite render-to-code skill. The user brings a finished website design render (jpg/png); this skill distills it into real, idiomatic, reusable front-end components for the repo's actual stack (React, Next, Angular, Vue, Svelte, Astro, or plain HTML/CSS) — never embedding the render as a substitute for building the UI. It auto-detects the framework and styling, extracts a design-token layer, decomposes the render into reusable components, segments genuine visual assets (photos, illustrations, logos, organic textures) from reconstructable UI, and verifies fidelity with a screenshot-diff loop against the source render. Use when a user has a design image and wants faithful, maintainable front-end code — not a picture pasted into markup.

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

0. **Context** — auto-detect framework + styling + existing tokens from the repo. Greenfield / empty repo → ask framework + styling. 1. **Ingest** — receive the desktop render(s) from the user. 1.5 **Responsive gate** — ask A / B / C (below). If C → invoke `mobile-design-frames`. 2. **Segment** — deep visual analysis → component tree + asset inventory. Classify every piece: reconstructable UI (code) vs genuine asset. 3. **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. 4. **Asset gate** — list required genuine assets → authorization + tool choice. 5. **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). 6. **Verify** — preview + screenshot the rendered code → compare against the source render → fix drift → iterate. The loop also judges asset promotion. 7. **Report** — components, assets, token file, breakpoints, fidelity notes.

0. Context detection

Inspect `package.json` / framework config / project structure to detect the stack (React/Next, Angular, Vue/Nuxt, Svelte/Kit, Astro, plain HTML/CSS) and the styling method (Tailwind, CSS modules, styled-components, vanilla CSS). Respect existing conventions and file layout. Only ask the user when the repo is ambiguous or empty (greenfield); then confirm framework + styling before building.

1.5 Responsive gate

Responsive behavior is the **user's decision**, never assumed. At session start, ask what to do about mobile and wait for the choice:

  • **A. I have the mobile design** — user provides the mobile render → use it as the

*source* of responsive behavior (decompose both; breakpoints faithful to both designs).

  • **B. Desktop only, infer** — infer breakpoints (stacking, reflow) and **report the

decisions made** back to the user. Nothing silent.

  • **C. Design the mobile for me** — generate the mobile render from the desktop as source,

via `mobile-design-frames`, then decompose it the same way.

Never skip this gate. Never assume responsive behavior on your own.

Asset boundary (code-first with fidelity escape)

**Default: aggressive code-first.** Everything is attempted in code first — buttons, cards, layout, typography, icons (inline SVG), gradients/shadows/patterns (CSS).

**Fidelity escape.** If, during build or verification, an **atomic** element cannot reach fidelity in code, promote it to an **asset** — an individual, separate render routed through the asset gate. Typical candidates:

  • icons whose SVG can't match 100% (complex shapes, internal gradients)
  • multi-stop / mesh gradients CSS can't reproduce faithfully
  • atmospheric shadows / glows hard to express in `box-shadow`
  • organic textures / patterns

**Promotion rules — so the escape never becomes the embed bug again:**

  • Promote the **atomic element only** (one icon, one gradient, one shadow) — **never**

a whole section or the whole composition.

  • **Never promotable:** text, layout, hierarchy, spacing → always code.
  • Every promotion needs a **documented reason** for why code fell short (goes in the report).
  • Strict order: attempt code → verify → if fidelity fails → promote → asset gate.

4. Asset gate

After segmentation (and whenever build promotes an element), list the genuine assets needed — real photos, complex illustrations, logos, organic textures, plus promoted atomic elements. Then ask the user:

**Authorize generation?**

  • **Yes** → ask which tool: **Higgsfield (recommended)** · fal.ai · a named installed MCP.

Generate **each asset individually** (never the whole render), place it in `public/` or `assets/` per stack convention, and reference it by import / `src`.

  • **No** → the user provides the assets. Hand over an exact spec per asset: filename,

dimensions, format, and where to place it. Then wait.

Never generate an asset without explicit authorization. Never generate the whole render as an "asset".

Anti-embed hard rules

These are non-negotiable. Violating any one

Read more
@jdanigo
Ships withhydraia

An agentic development harness for Claude Code. **One command runs the entire feature pipeline** — it collaborates with you on the design, then builds autonomously: plan, execute, double-review, and verify.

852 skills27 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
8
Star history of jdanigo/hydraia on GitHub, a chart by star-history.com

Other skills on hydraia.

hydraia

hydraia

Use whenever the user asks to build, add, implement, or change a feature or functionality — or brings a user story or ticket to…

@jdanigo@jdanigoInstall Skill
adr

adr

Use when a design decision is made that is expensive to reverse, affects multiple components, or rejects a plausible alternative…

@jdanigo@jdanigoInstall Skill
agency-tier-ui

agency-tier-ui

Teaches the AI to design like a high-end agency. Defines the exact fonts, spacing, shadows, card structures, and animations that…

@jdanigo@jdanigoInstall Skill
api-design

api-design

Use when designing or reviewing an API surface — REST, GraphQL, or gRPC. Contract-first methodology: the contract artifact…

@jdanigo@jdanigoInstall Skill
banner-design

banner-design

Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with…

@jdanigo@jdanigoInstall Skill
brainstorming

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior.…

@jdanigo@jdanigoInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about design-to-code.

Which coding agents can use design-to-code?
design-to-code installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.