Home
cd ../playbooks
Developer ToolsIntermediate

Image-to-Code: Design Reference to Implementation

An image-first workflow that forces Claude to establish a visual reference, deeply analyze it, and only then write frontend code that matches it

10 minutes
By Leonxlnx (Taste Skill)Source
#frontend#design-to-code#screenshot#ui#implementation

Ask an AI agent for a landing page and you get the same purple gradient, the same three-card row, the same centered hero every time. This playbook forces reference-first discipline: get a real visual source, extract typography, spacing, color, and copy from it, and build to match instead of drifting into generic templates.

Who it's for: frontend developers, indie hackers building landing pages, designers working with AI coding agents, agencies prototyping client sites, founders building their own marketing site

Example

"Build this hero section to match the screenshot I gave you" → Claude extracts exact headline wording, type scale, spacing rhythm, button styling, and color palette from the reference before writing a line of code, then implements a faithful match instead of a generic reinterpretation

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add image-to-code
# Image-to-Code: Design Reference to Implementation

Elite website image-to-code workflow. For visually important frontend tasks, generate or gather the design reference first, analyze it deeply, then implement to match it as closely as possible. Prefer large, readable, section-specific images over one compressed board. Avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.

# CORE DIRECTIVE: IMAGE-FIRST WEBSITE DESIGN TO CODE

You are an elite web design art director and implementation strategist.

Your job is not to generate generic website mockups. Your job is to produce premium, artistic, implementation-friendly website section references and then turn them into real frontend.

This applies to:
- hero sections

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Forces a strict order of operations on visual frontend work: reference first, deep analysis second, implementation third. Instead of jumping straight to code when asked for a landing page or hero section, Claude establishes a visual source of truth (a screenshot, mockup, or generated reference), extracts the actual design system from it (typography, spacing, color, button states, copy), and only then writes the implementation.

The template also encodes a long list of "AI slop" patterns to avoid: purple gradient heroes, three-equal-card rows, cards-inside-cards nesting, generic pill badges, and fake technical microcopy like "orchestration layer." It ships a variation engine (theme, background character, typography character, hero architecture, section system, signature components, motion language) so Claude commits to one coherent visual direction instead of a mashup of defaults.

This is one of three related "Taste Skill" playbooks. This one is for building new sections or pages from a visual reference. Use Redesign Existing Projects instead when the codebase already exists and needs a design audit rather than a fresh build.


Quick Start

Step 1: Create a Project Folder

mkdir -p ~/Documents/ImageToCode

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ~/Documents/ImageToCode/

Step 3: Start Working

cd ~/Documents/ImageToCode
claude

Drop a screenshot, mockup, or Figma export into the folder and ask Claude to build it. For sections without an existing reference, ask Claude to describe the visual direction first (theme, hero architecture, component set) before it writes any code.


The Core Workflow

  1. Establish the reference — a screenshot, mockup, or generated image. One image per section, not one compressed board for the whole page.
  2. Deep analysis — extract exact headline text, type scale, spacing rhythm, button states, color palette, and layout structure before touching code.
  3. Implement to match — build the frontend to be faithful to the reference, not "inspired by" it. No drifting into generic templates during implementation.

If a section image is unclear, the rule is to get a fresh, cleaner image of just that section rather than cropping a low-detail region out of a larger board. Cropping destroys spacing accuracy and type scale relationships.


Hero Rules

The template is strict about the first screen:

  • Headline stays within 1-3 lines. If it's running long, cut words instead of wrapping to a 4th line.
  • One focal point. No competing elements fighting for attention.
  • No stuffing the hero with pills, fake stats, badges, or decorative micro-labels like "00 orchestration layer."
  • Must read clean on a small laptop viewport, not just a 27-inch monitor.

The Variation Engine

To stop every generated page from looking the same, the template makes Claude commit to one combination before building:

  • Theme: pristine light, deep dark, bold studio solid, or quiet premium neutral
  • Background character: grid/dotted field, ambient gradient, cinematic imagery, or tactile texture
  • Typography character: clean grotesk, expressive display, editorial serif+sans, Swiss rational, and others
  • Hero architecture: cinematic centered, asymmetric split, floating polaroid scatter, editorial offset, and others
  • Signature components: exactly 4 chosen from a list of distinct patterns (diagonal masonry, 3D card decks, marquee strips, etc.)
  • Motion language: exactly 2 chosen cues (staggered float-up, parallax drift, scroll-driven reveals, etc.)

Picking a fixed combination up front is what keeps a multi-section build visually coherent instead of turning into eight sections that each look like a different website.


What It Flags as Slop

  • Layout: giant unreadable collages, identical repeated card rows, cards-inside-cards-inside-cards, giant rounded wrapper sections around everything
  • Visual: default purple/blue AI gradients, glowing edges, floating blobs, glassmorphism stacked without reason
  • Typography: giant heading with a weak tiny subcopy, lazy all-caps everywhere, generic gradient headline tricks
  • Copy: "unleash," "elevate," "revolutionize," "next-gen," "seamless"; fake brand names like "Acme," "Nexus," "NovaCore"
  • Density: over-packed sections, card overload, tiny gaps between major sections

Limitations

  • Written around an image-generation-first workflow. Without a way to generate images, treat "generate a reference" as "get a screenshot or mockup from the user" — the analysis and implementation discipline still applies.
  • The variation engine's choices (theme, architecture, components) are meant as internal direction-setting, not a menu to show the user unless asked.
  • Built for marketing sites, landing pages, and portfolio/product pages. It is not tuned for dense internal dashboards or data-heavy admin UIs.
  • Faithful matching only goes as far as the reference allows. Ambiguous details still require judgment calls, the template just orders those calls after real extraction instead of before it.

$Related Playbooks

Developer Tools

Imagegen Frontend Mobile: App Screen & Flow Reference Generator

An image-direction rule set that produces premium, consistent iOS/Android app screen mockups and multi-screen user flows, ready to hand to a coding agent for implementation

10 minutes
Intermediate
Developer Tools

Imagegen Frontend Web: Website Design Reference Generator

An image-direction rule set that turns a one-line brief into a full set of Awwwards-level website design comps, one horizontal image per section, ready to hand to a coding agent

10 minutes
Intermediate
Developer Tools

i18n Expert

Set up, audit, and enforce internationalization in UI codebases — install the i18n framework, replace hard-coded strings, ensure locale coverage, and validate key parity and pluralization.

20 minutes
Intermediate
Developer Tools

Frontend Enhancer

Enhance Next.js applications with modern visual design, production-ready components, color palettes, animations, and responsive layout templates.

10 minutes
Intermediate
Developer Tools

Karpathy's Autoresearch: Let an Agent Run ML Experiments Overnight

Point Claude at a small real LLM training setup and let it modify the code, train for 5 minutes, keep what improves, and repeat while you sleep

20 minutes
Advanced
Developer Tools

iOS App Developer

Develop iOS/macOS apps with XcodeGen, SwiftUI, and SPM — including Apple Developer signing, notarization, and CI/CD pipelines — and fix the Xcode build failures that block shipping.

20 minutes
Advanced
Developer Tools

LangSmith Fetch

Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio for error analysis and performance optimization.

10 minutes
Intermediate
Developer Tools

LLM Error Analysis

Build evaluators grounded in how your LLM system actually fails, by reading ~100 traces and letting failure categories emerge instead of borrowing generic ones — a 7-step process (collect, read/note, group, label, rate, decide, iterate) that notes the first thing that went wrong, fixes obvious prompt/tool/code gaps before building any evaluator, and prioritizes by real failure frequency.

15 minutes
Intermediate
Developer Tools

LLM Eval Audit

Audit an existing LLM evaluation pipeline against six diagnostic areas — error analysis, evaluator design, judge validation, human review, labeled data, and pipeline hygiene — surfacing unvalidated judges, Likert-scale noise, vanity similarity metrics, and the accuracy-under-class-imbalance trap, as an impact-ordered findings report where every problem links to a concrete fix.

10 minutes
Advanced
Developer Tools

Leanback to Compose for TV Migration

Migrate an Android TV app from the legacy Leanback UI Toolkit to Jetpack Compose for TV (androidx.tv) — the 10-foot UI design constraints, D-pad focus handling (initial focus, bidirectional routing, focusRestorer, IME focus chaining), Media3 playback with PlayerSurface, a five-phase migration order, and a direct Leanback-class-to-Compose-screen mapping table.

15 minutes
Advanced
Developer Tools

Long-Horizon Agent Prompting

Design the launch prompt for an agent working autonomously for hours or days — a pseudo-formal task brief with an exact success predicate, an enumerated non-counting-outcomes list, adversarial verification, and effort floors, because persistence pressure against a loose spec produces confident non-solutions.

10 minutes
Advanced
Developer Tools

Learning Mode Coding Coach

Interactive coding mode that hands you the meaningful 5-10 line decisions — business logic, trade-offs, design choices — while Claude handles the boilerplate and explains the codebase as you go.

2 minutes
Beginner

Browse all Developer Tools playbooks →