New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Turns a screenshot, mockup, Figma export

Screenshot to code

by OneWave-AI · MIT license · ★ 306 on GitHub

Screenshot to code cover

Turns a screenshot, mockup, Figma export, or photo of a UI into working front-end code - React + Tailwind CSS v4 by default, or Next.js, Vue, or plain HTML/CSS - matching layout, spacing, colors, and typography, then renders the result…

---
name: screenshot-to-code
description: Turns a screenshot, mockup, Figma export, or photo of a UI into working front-end code - React + Tailwind CSS v4 by default, or Next.js, Vue, or plain HTML/CSS - matching layout, spacing, colors, and typography, then renders the result and compares it against the image to close visual gaps. Use whenever the user shares an image of a website, app screen, dashboard, component, or wireframe and wants it built, cloned, recreated, or "made real", or says "code this up", "build this design", or "match this screenshot".
---

# Screenshot to Code

Recreate the UI in the image as clean, responsive, accessible code, then check the render against the image.

## Workflow

1. **Pick the target stack.** If the user is inside a project, match it: read `package.json` for React/Next/Vue and the Tailwind version, and reuse existing components, tokens, and icon libraries. Do not ask when the repo already answers it. With no project:
   - Single screen or quick prototype: one self-contained `index.html` (Tailwind via the browser build, see [references/stack-setup.md](references/stack-setup.md)).
   - App or multi-screen: React + TypeScript + Tailwind v4 on Vite.
   - User mentions Next.js, SSR, or routing: Next.js App Router.

2. **Write a short spec before coding.** Looking at the image, note:
   - Layout regions top to bottom (nav, hero, sidebar, grid, footer) and the grid or flex structure of each

Overview

Recreate the UI in the image as clean, responsive, accessible code, then check the render against the image.

Manual install (npx, ZIP)
Claude Codenpx skills add OneWave-AI/claude-skills --skill screenshot-to-code -g -a claude-code
Claude Code (degit)npx degit OneWave-AI/claude-skills/screenshot-to-code#main ~/.claude/skills/screenshot-to-code
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md5.8 KB
Read SKILL.md here
OneWave-AI/main1 file shown
SKILL.md
Show the full text64 lines
screenshot-to-code/SKILL.md64 lines · 5.8 KB

Screenshot to Code

Recreate the UI in the image as clean, responsive, accessible code, then check the render against the image.

Workflow

  1. Pick the target stack. If the user is inside a project, match it: read package.json for React/Next/Vue and the Tailwind version, and reuse existing components, tokens, and icon libraries. Do not ask when the repo already answers it. With no project:

    • Single screen or quick prototype: one self-contained index.html (Tailwind via the browser build, see references/stack-setup.md).
    • App or multi-screen: React + TypeScript + Tailwind v4 on Vite.
    • User mentions Next.js, SSR, or routing: Next.js App Router.
  2. Write a short spec before coding. Looking at the image, note:

    • Layout regions top to bottom (nav, hero, sidebar, grid, footer) and the grid or flex structure of each
    • Design tokens: 3-6 colors as hex, font family guess and the type scale, spacing rhythm (usually multiples of 4px), corner radius, shadow style
    • Repeated components (cards, list rows, buttons) that should be one component with props
    • What the image cannot show: hover and focus states, mobile layout, real data, content below the fold

    Estimate sizes from the image resolution. If the screenshot is 2x (a Retina capture 2880px wide is a 1440px layout), halve the pixel measurements.

  3. Build. Use semantic elements (header, nav, main, section, button, a), extract repeated pieces into components, and put tokens in one place (Tailwind v4 @theme or CSS custom properties) rather than scattering hex codes. Use real text from the image, not lorem ipsum. For images and logos you cannot extract, use sized placeholders with descriptive alt text. Use an icon library the project already has (default: lucide-react), not hand-drawn SVGs or emoji.

  4. Make it responsive. Build for the screenshot's viewport first, then define how it collapses: multi-column grids stack, navs become a menu button, and type scales down with clamp() or responsive utilities. If the screenshot is mobile, go the other direction.

  5. Render and compare. If you can run a browser (Playwright, a headless browser, or a browser tool), screenshot the result at the source image's viewport width and compare side by side. See references/visual-check.md. Fix the largest differences first: layout and alignment, then spacing, then type size and weight, then color. Two or three passes is usually enough; stop when remaining differences are at the level of font rendering.

  6. Deliver. Provide the files, how to run them, and a short list of assumptions (fonts guessed, states invented, content inferred). Name anything that needs real assets.

Stack notes

  • React 19: function components with TypeScript prop types. propTypes checks were removed from React 19; do not add them. forwardRef is not needed for passing ref to function components.
  • Tailwind CSS v4: configuration lives in CSS. Use @import "tailwindcss"; and @theme { --color-brand: #...; }, not a tailwind.config.js and not the v3 @tailwind base/components/utilities directives. Custom tokens become utilities automatically (bg-brand).
  • Next.js (App Router): pages in app/, components are Server Components by default. Add "use client" only to components that use state, effects, or event handlers.
  • Create React App is deprecated. Use Vite for plain React.

Setup commands for each stack are in references/stack-setup.md.

Worked example

Input: a 1440px-wide screenshot of a pricing section - centered heading, three plan cards with the middle one highlighted, feature checklists, and a button per card.

Spec:

  • Regions: heading block, then a 3-column card grid, max width about 1100px, 24px gap
  • Tokens: background #0B1220, card #111A2E, accent #3B82F6, text #E5E7EB, muted #94A3B8; Inter-like sans; radius 12px
  • Components: PlanCard with name, price, features[], highlighted, cta
  • Unknowns: hover states, monthly/annual toggle behavior, mobile layout

Build: PricingSection.tsx mapping a plans array into PlanCard; highlighted adds an accent border and a "Most popular" label; grid-cols-1 md:grid-cols-3. Check icons from lucide-react.

Compare: the first render has cards 40px too tall because of button padding, and the heading weight is 600 against a 700 in the image. Fix both, re-render, and deliver with an assumptions list: toggle not built, font assumed Inter.

Failure modes

  • Guessing the stack when the repo already defines it, or mixing Tailwind v3 config into a v4 project.
  • Absolute positioning to force a pixel match. It breaks on the first resize. Use flex and grid, and accept small differences.
  • One giant component. Anything that repeats three times is a component with props.
  • Invisible states. Buttons and links need hover and focus-visible styles even though the screenshot cannot show them. Inputs need labels.
  • Color drift. Sample colors from flat areas of the image, not anti-aliased edges or gradients, and check text contrast meets WCAG AA (4.5:1 for body text).
  • Claiming a match without looking. If you could not render the result, say the comparison was not done.
1---
2name: screenshot-to-code
3description: Turns a screenshot, mockup, Figma export, or photo of a UI into working front-end code - React + Tailwind CSS v4 by default, or Next.js, Vue, or plain HTML/CSS - matching layout, spacing, colors, and typography, then renders the result and compares it against the image to close visual gaps. Use whenever the user shares an image of a website, app screen, dashboard, component, or wireframe and wants it built, cloned, recreated, or "made real", or says "code this up", "build this design", or "match this screenshot".
4---
5 
6# Screenshot to Code
7 
8Recreate the UI in the image as clean, responsive, accessible code, then check the render against the image.
9 
10## Workflow
11 
121. **Pick the target stack.** If the user is inside a project, match it: read `package.json` for React/Next/Vue and the Tailwind version, and reuse existing components, tokens, and icon libraries. Do not ask when the repo already answers it. With no project:
13 - Single screen or quick prototype: one self-contained `index.html` (Tailwind via the browser build, see [references/stack-setup.md](references/stack-setup.md)).
14 - App or multi-screen: React + TypeScript + Tailwind v4 on Vite.
15 - User mentions Next.js, SSR, or routing: Next.js App Router.
16 
172. **Write a short spec before coding.** Looking at the image, note:
18 - Layout regions top to bottom (nav, hero, sidebar, grid, footer) and the grid or flex structure of each
19 - Design tokens: 3-6 colors as hex, font family guess and the type scale, spacing rhythm (usually multiples of 4px), corner radius, shadow style
20 - Repeated components (cards, list rows, buttons) that should be one component with props
21 - What the image cannot show: hover and focus states, mobile layout, real data, content below the fold
22 
23 Estimate sizes from the image resolution. If the screenshot is 2x (a Retina capture 2880px wide is a 1440px layout), halve the pixel measurements.
24 
253. **Build.** Use semantic elements (`header`, `nav`, `main`, `section`, `button`, `a`), extract repeated pieces into components, and put tokens in one place (Tailwind v4 `@theme` or CSS custom properties) rather than scattering hex codes. Use real text from the image, not lorem ipsum. For images and logos you cannot extract, use sized placeholders with descriptive `alt` text. Use an icon library the project already has (default: `lucide-react`), not hand-drawn SVGs or emoji.
26 
274. **Make it responsive.** Build for the screenshot's viewport first, then define how it collapses: multi-column grids stack, navs become a menu button, and type scales down with `clamp()` or responsive utilities. If the screenshot is mobile, go the other direction.
28 
295. **Render and compare.** If you can run a browser (Playwright, a headless browser, or a browser tool), screenshot the result at the source image's viewport width and compare side by side. See [references/visual-check.md](references/visual-check.md). Fix the largest differences first: layout and alignment, then spacing, then type size and weight, then color. Two or three passes is usually enough; stop when remaining differences are at the level of font rendering.
30 
316. **Deliver.** Provide the files, how to run them, and a short list of assumptions (fonts guessed, states invented, content inferred). Name anything that needs real assets.
32 
33## Stack notes
34 
35- **React 19**: function components with TypeScript prop types. `propTypes` checks were removed from React 19; do not add them. `forwardRef` is not needed for passing `ref` to function components.
36- **Tailwind CSS v4**: configuration lives in CSS. Use `@import "tailwindcss";` and `@theme { --color-brand: #...; }`, not a `tailwind.config.js` and not the v3 `@tailwind base/components/utilities` directives. Custom tokens become utilities automatically (`bg-brand`).
37- **Next.js (App Router)**: pages in `app/`, components are Server Components by default. Add `"use client"` only to components that use state, effects, or event handlers.
38- **Create React App** is deprecated. Use Vite for plain React.
39 
40Setup commands for each stack are in [references/stack-setup.md](references/stack-setup.md).
41 
42## Worked example
43 
44Input: a 1440px-wide screenshot of a pricing section - centered heading, three plan cards with the middle one highlighted, feature checklists, and a button per card.
45 
46Spec:
47- Regions: heading block, then a 3-column card grid, max width about 1100px, 24px gap
48- Tokens: background `#0B1220`, card `#111A2E`, accent `#3B82F6`, text `#E5E7EB`, muted `#94A3B8`; Inter-like sans; radius 12px
49- Components: `PlanCard` with `name`, `price`, `features[]`, `highlighted`, `cta`
50- Unknowns: hover states, monthly/annual toggle behavior, mobile layout
51 
52Build: `PricingSection.tsx` mapping a `plans` array into `PlanCard`; `highlighted` adds an accent border and a "Most popular" label; `grid-cols-1 md:grid-cols-3`. Check icons from `lucide-react`.
53 
54Compare: the first render has cards 40px too tall because of button padding, and the heading weight is 600 against a 700 in the image. Fix both, re-render, and deliver with an assumptions list: toggle not built, font assumed Inter.
55 
56## Failure modes
57 
58- **Guessing the stack** when the repo already defines it, or mixing Tailwind v3 config into a v4 project.
59- **Absolute positioning to force a pixel match.** It breaks on the first resize. Use flex and grid, and accept small differences.
60- **One giant component.** Anything that repeats three times is a component with props.
61- **Invisible states.** Buttons and links need hover and `focus-visible` styles even though the screenshot cannot show them. Inputs need labels.
62- **Color drift.** Sample colors from flat areas of the image, not anti-aliased edges or gradients, and check text contrast meets WCAG AA (4.5:1 for body text).
63- **Claiming a match without looking.** If you could not render the result, say the comparison was not done.
64 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 306
Checked
Source
OneWave-AI/claude-skills ↗
Creator
OneWave-AI · 16 listings
View creator

Similar skills

See all →
SkillReverse-lookup glossary that turns a vague descriptionAnimation vocabularyemilkowalski/skills · by emilkowalskiReverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.★ 40.8k GitHub starsSkillMake hand-painted watercolour-and-ink cartoon videosPainted animationedenfunf/reelmimic · by edenfunfMake hand-painted watercolour-and-ink cartoon videos (MP4) with code — p5.js + p5.brush rendered frame by frame in headless Chrome, encoded with ffmpeg — starring Clawd or any character. Use when the user asks to make an animation, animated short, cartoon, music video, lyric video, animated GIF/loop or "a video of Clawd…", or mentions the PDoomVideo / ClaudeAnimationBase approach. Covers storyboarding, the engine API, the render-and-look review loop, music/lyric sync and splitting long videos across subagents.★ 3.6k GitHub starsSkillSearch tool for modern web development best practicesModern web guidanceGoogleChrome/modern-web-guidance · by GoogleChromeSearch tool for modern web development best practices. MANDATORY: Execute FIRST for all HTML/CSS and clientside JS tasks. Do NOT skip — web APIs evolve rapidly and training weights contain obsolete patterns. Trigger immediately for: - UI/Layout: Modals, dialogs, popovers, Glassmorphism/backdrop-filters, anchor positioning, container queries, `:has()`, `:user-valid`. - Scroll/Motion: View Transitions, Scroll-driven animations, scroll parallax/reveals. - Performance: CWV (LCP, INP), content-visibility, Fetch Priority, image optimization. - System/APIs: Local filesystem access, WebUSB, WebSockets sync, WebAssembly widgets. - Frameworks: Adapting layout/styles in React, Vue, Angular. - General Frontend: Forms, autofill, advanced inputs, custom scrollbars, modern component states, etc. DO NOT trigger for: - Backend: Database SQL, ORMs, Express API routes. - Pipelines: CI/CD deployment, Docker, Actions. - Generic: Local scripts (Python/Go tools), ESLint, Git.★ 2.4k GitHub starsSkillTraduz pedidos de animação em português para o efeito deBiblioteca de Motion apenasdouglas · Versão Documentalapenasdouglas/ai-motion-library · by apenasdouglasTraduz pedidos de animação em português ("faz o número quicar", "entra um depois do outro", "dá um tranco no zoom") para o efeito de motion graphics certo, com o termo técnico, a duração e a aceleração. Use sempre que o usuário pedir animação, motion, transição ou efeito em vídeo, HTML, CSS, GSAP, Remotion, HyperFrames ou After Effects, principalmente quando o pedido for vago ("faz uma animação bonita") ou o vídeo for de canal dark (faceless) de curiosidades, história ou documentário. Also triggers on English requests for motion graphics, easing and animation effects in documentary or faceless YouTube videos.★ 68 GitHub starsSkillHeadless, reproducible browser automation with PlaywrightPlaywright BrowserAndyShiu/claude-skill-playwright-browser · by AndyShiuHeadless, reproducible browser automation with Playwright for any project — screenshots of web pages or local dev servers (desktop/tablet/mobile, full page or one element, single page or every page/menu of an app in one batch), frontend audits (console errors, failed requests, broken images/links, responsive overflow, axe accessibility, LCP/CLS performance), before/after visual comparison, scripted E2E flows (log in, click, fill, page through, assert), and logged-in pages via saved sessions. Use this whenever the user wants to screenshot or visually check a site, find frontend bugs, see how a page looks on mobile, compare the UI before and after a CSS/code change, reproduce a bug from an issue or ticket and capture evidence images for it, verify a UI flow works, or run/write a browser test — even if they never say "Playwright" or "browser". If Claude in Chrome could also do the job, briefly ask which to use (with a recommendation) instead of silently picking.★ 49 GitHub starsSkillRebuild a web page, sectionReplicaalbertirgi/replica · by albertirgiRebuild a web page, section, component or interaction from a reference (a live URL, a local HTML file, a screenshot or design export, or a screen recording or GIF) inside the user's own codebase. Then measure the rebuild against the reference (element boxes, computed styles, pixels, motion timing and easing) and iterate until a numeric Replica Score passes. Use when the user wants to clone, replicate, recreate, copy, port or match a site, landing page, hero, navbar, pricing table, card, modal, footer, hover effect, scroll reveal, page-load animation or any other UI, or to "make it look/feel/move like" one. Also use when they say "pixel-perfect", "1:1", "exactly like this" or "same as <url>", or hand over a screenshot, Figma export or video and ask to build it, including when they want their own copy, brand or extra features on top.★ 43 GitHub stars

More from OneWave-AI

SkillFinding security vulnerabilities , correctness bugsCode review proOneWave-AI/claude-skills · by OneWave-AIPerforms a deep code review of files, modules, a diff, or a branch - finding security vulnerabilities (mapped to OWASP Top 10:2025), correctness bugs, performance problems, and maintainability issues - and returns severity-ranked findings with evidence and concrete fixes. Use when the user asks to review, audit, or sanity-check code, asks "is this safe", "what's wrong with this", "find bugs", or wants a security or performance pass before shipping. For posting line comments on a GitHub pull request, use git-pr-reviewer.★ 306 GitHub starsSkillMapping mismatched column names to one schemaCSV/Excel MergerOneWave-AI/claude-skills · by OneWave-AIMerges, appends, joins, and deduplicates multiple CSV, TSV, and Excel files (including multi-sheet workbooks) with pandas - mapping mismatched column names to one schema, normalizing keys, resolving conflicting values, tracking which file each row came from, and verifying the row math. Use when the user wants to combine spreadsheets or exports, stack monthly files, consolidate contact or lead lists, VLOOKUP-style join two sheets on an ID or email, or dedupe records across sources, even if they only say "put these together" or "clean up these lists into one".★ 306 GitHub starsSkillDesigns relational and document database schemasDatabase schema designerOneWave-AI/claude-skills · by OneWave-AIDesigns relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes driven by real query patterns, ERDs, and reversible migration scripts - with PostgreSQL (including Supabase) as the default and MySQL, SQLite, and MongoDB supported. Use when the user wants to model data for a new app or feature, review or fix an existing schema, choose keys or indexes, plan multi-tenancy, normalize or denormalize, or write CREATE TABLE statements or migrations, even if they just describe their app and ask "how should I store this". For moving data between database providers, use database-migrator.★ 306 GitHub starsSkillBuild and run a labelled eval set for a System One model Evaluating a typed-decision configOneWave-AI/claude-skills · by OneWave-AIBuild and run a labelled eval set for a System One model (Jev, Von, or any typed-decision config), then sweep criteria wordings and thresholds against it. Use when a Jev/Von classification is wrong or unreliable, when choosing between the hosted API and a local open model, when tuning noul thresholds, or before shipping any typed-decision feature. Produces an accuracy-by-wording matrix and a calibrated threshold.★ 306 GitHub starsSkillExtract and analyze data from invoices, receiptsFinancial Document ParserOneWave-AI/claude-skills · by OneWave-AIExtract and analyze data from invoices, receipts, bank statements, and financial documents. Categorize expenses, track recurring charges, and generate expense reports. Use when user provides financial PDFs or images.★ 306 GitHub starsSkillWrites conversion-focused landing page copyLanding page copywriterOneWave-AI/claude-skills · by OneWave-AIWrites conversion-focused landing page copy - headlines, subheads, value propositions, feature and benefit blocks, social proof, FAQs, and CTA button text - using PAS, AIDA, or StoryBrand. Use when the user wants words for a landing page, sales page, product or pricing page, waitlist page, homepage hero, or ad-to-page flow, including rewriting weak copy, generating headline or CTA variants for A/B tests, or turning a product description into page sections. Use landing-page-optimizer instead for auditing an existing page's performance, and a frontend skill for building the page itself.★ 306 GitHub stars