image-to-code

Converts design mockups and screenshots into functional interface code by extracting the underlying design system first.

Updated Aug 12, 2026
One-click install
npx skills add https://github.com/brunoolf/frontend-craft --skill image-to-code-brunoolf
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: image-to-code
Source: https://github.com/brunoolf/frontend-craft/tree/main/skills/image-to-code
Command: npx skills add https://github.com/brunoolf/frontend-craft --skill image-to-code-brunoolf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Turning a mockup or screenshot into code often produces fragile markup full of magic values that breaks at any other viewport width. This Skill enforces a system-first method: extract the grid, spacing scale, typography, and color tokens from the image before writing any markup, so the result is maintainable and responsive. ## Core Features & Use Cases - Structural image reading: Measures columns, gutters, spacing base (4 or 8), type scale, colors grouped by role, radii, shadows, and repeated components before coding. - Token extraction and reconciliation: Converts measurements into design tokens and reconciles them with an existing DESIGN.md instead of creating a parallel scale. - Outside-in construction and verification: Builds layout first, then components, then detail, and checks the result against the original for spacing, font weights, secondary text color, and optical alignment. - Use Case: A designer hands you a landing page screenshot. The Skill derives the 8px spacing base and type scale, writes tokens, builds the responsive layout, and fills in the states and breakpoints the image omits. ## Quick Start Implement this attached mockup as responsive interface code, extracting the design system from the image before writing any markup.

Frequently Asked Questions about image-to-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a design mockup or screenshot into code?▼

Read the image structurally first: measure the grid, spacing scale, type scale, and colors, then write those as tokens before any markup. Build outside-in (layout, then components, then detail) and verify against the original for spacing and font-weight mismatches.

How to reproduce a website design from a screenshot accurately?▼

Extract the underlying system rather than copying pixel values top to bottom. Group near-identical measurements into scale steps, treat repeated elements as components, and compare the result side by side with the image, checking vertical spacing and secondary text color specifically.

What if the mockup only shows one screen width?▼

The image shows one state at one width, so all other breakpoints must be derived from the extracted system, not guessed. The same applies to hover, focus, disabled, loading, error, and empty states, which never appear in a mockup.

Should I reproduce a mockup exactly when it has accessibility problems?▼

No. When the mockup violates contrast, touch-target, or line-length rules, implement the corrected version and report what changed and why. Exact fidelity is only appropriate when the user explicitly requests it, with issues reported separately.

What are the limitations of image-to-code conversion?▼

A static image cannot convey motion, real content lengths, responsive behavior, or interactive states. Long and short text must be tested, and if no image exists, a reference should be generated first, one image per section, before applying the method.