agentleFS
glebrati-cloudglebrati-cloud/screenshot-to-code/SKILL.md

screenshot-to-code

Skill3 starsChanged 8 months agoMITView on GitHub

Convert any screenshot, mockup, or design image into clean, production-ready code. Use this skill whenever the user shares a screenshot, UI mockup, Figma export, wireframe, or any visual reference and wants it turned into working code. Also trigger when the user says things like "build this", "code this design", "replicate this UI", "make this page", "convert this to HTML/React/Vue/Tailwind", or pastes an image with an implied request to recreate it. Works for full pages, individual components, dashboards, landing pages, forms, navbars, cards -- anything visual.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. OneWave-AI/claude-skills★ 378same name
    2. furqanistic/aura-skills★ 8same name
    3. JoaoEquer/Oficina★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every border-radius, shadow, and spacing decision matters.

    line 20
  2. Distinctive:

    Before writing any code, study the image systematically:

    line 27
  3. Distinctive:

    Default based on context, or ask the user:

    line 70
  4. Distinctive:

    All images need descriptive alt text

    line 111
  5. Distinctive:

    Blurry screenshots: Do your best, note areas where you had to guess

    line 166
  6. Distinctive:

    Charts/graphs: Use placeholder data with the correct visual structure

    line 171

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Screenshot to Code

Transform any visual reference into clean, responsive, production-ready code.

Core Philosophy

Users don't want "roughly similar" -- they want code that looks identical to their reference. Every border-radius, shadow, and spacing decision matters. But the code must also be clean enough for a developer to actually maintain it.

Workflow

Step 1: Deep Visual Analysis

Before writing any code, study the image systematically:

Layout

  • Identify the grid system (12-col grid? Custom?)
  • Map the component hierarchy: page > sections > components > elements
  • Note flexbox vs grid patterns
  • Identify fixed/sticky elements

Design Tokens Extract a complete design system from the image:

Colors:
  --primary:     #___  (brand color, CTAs, links)
  --secondary:   #___  (accents, secondary actions)
  --bg:          #___  (page background)
  --surface:     #___  (card/panel backgrounds)
  --text:        #___  (primary text)
  --text-muted:  #___  (secondary text, placeholders)
  --border:      #___  (dividers, outlines)
  --accent:      #___  (highlights, badges, notifications)

Spacing: Identify the base unit (4px? 8px?) and the scale
Typography: Font family hints, size scale, weight usage
Radius: Identify border-radius patterns (sharp? rounded? pill?)
Shadows: Note shadow depth levels used

Components List every distinct UI component visible:

  • Navigation (type, items, active states)
  • Content areas (cards, lists, tables, text blocks)
  • Interactive elements (buttons, inputs, dropdowns, toggles)
  • Feedback elements (alerts, badges, tooltips, progress bars)
  • Media (images, icons, avatars, charts)

Responsive Clues

  • Is this clearly a desktop view? Mobile? Tablet?
  • What would logically stack, collapse, or hide at smaller sizes?
  • Are there sidebar patterns that should become drawers on mobile?

Step 2: Choose Output Format

Default based on context, or ask the user:

What you seeDefault output
Simple static page / landing pageSingle HTML file (HTML + CSS + JS)
UI component / widgetReact + Tailwind CSS (.jsx)
Full app with multiple componentsReact + Tailwind with component files
Email templateHTML with inline CSS
Dashboard with dataReact + Tailwind + Recharts placeholders

Supported stacks:

  • HTML/CSS/JS -- Zero dependencies, works everywhere
  • React + Tailwind -- Industry standard, prefer for components
  • Vue 3 -- Composition API with script setup
  • Svelte -- Minimal boilerplate
  • React + CSS Modules -- When Tailwind is not wanted

Step 3: Generate Production Code

Pixel Accuracy Rules

  • Colors must be exact hex values extracted from the image -- never approximate
  • Spacing must be precise -- if it looks like 12px gap, use 12px not 0.75rem
  • Border-radius, shadows, opacity: match exactly what you see
  • Typography: match size, weight, line-height, and letter-spacing
  • Icons: identify the icon library (Lucide, Heroicons, etc.) and use the correct icons

Code Quality Rules

  • Semantic HTML: nav, main, section, article, aside, footer
  • Meaningful names: .pricing-card__price, not .div-3
  • CSS custom properties for design tokens (colors, spacing, radius)
  • Component decomposition: if a UI element appears 2+ times, it is a component
  • Comments only for non-obvious layout decisions

Responsive Rules

  • Mobile-first: base styles for mobile, @media queries for larger screens
  • At minimum: mobile (< 768px) and desktop (>= 768px)
  • Navigation: hamburger menu with toggle on mobile
  • Grid layouts: reduce columns on smaller screens
  • Touch targets: minimum 44px on mobile

Accessibility Rules

  • All images need descriptive alt text
  • Form inputs must have associated label elements
  • Interactive elements must be keyboard-navigable
  • Color contrast must meet WCAG AA (4.5:1 for text)
  • ARIA labels for icon-only buttons
  • Focus visible styles must not be removed

Step 4: Deliver

  • Save as a working file the user can open/import immediately
  • HTML files should render correctly when opened in a browser
  • React components should be valid, importable, and self-contained
  • Note any assumptions made about ambiguous parts of the design
  • Proactively offer to refine specific areas

Pattern Library

Navigation

Desktop: Logo | Nav Links (with active indicator) | CTA Button
Mobile: Logo | Hamburger > Slide-out or dropdown menu
Sticky: position: sticky; top: 0; z-index: 50; backdrop-filter: blur;

Hero Sections

Full-width container with constrained content (max-width: 1200px)
Headline (text-5xl/6xl) > Subtitle (text-xl, muted) > CTA group
Background: gradient | image with overlay | solid with pattern

Card Grids

CSS Grid: grid-template-columns: repeat(auto-fill, minmax(300px, 1fr))
Card: surface bg + subtle shadow + radius + padding + hover:shadow-lg transition
Responsive: 3 cols > 2 cols > 1 col

Dashboards

Layout: Fixed sidebar (240px) + scrollable main content
Sidebar: Logo + nav groups with icons + user profile at bottom
Main: Header bar + stat cards row + chart area + table
Mobile: Sidebar becomes a drawer with overlay

Forms

Stack labels above inputs (not inline)
Input states: default > focus (ring) > error (red border + message) > disabled (opacity)
Submit button: full-width on mobile, auto-width on desktop

Edge Cases

  • Blurry screenshots: Do your best, note areas where you had to guess
  • Partial screenshots: Build what is visible, use sensible defaults for cut-off areas
  • Dark mode only: Build dark mode, add a note about light mode adaptation
  • Non-English text: Preserve the original text in the code, use UTF-8
  • Complex animations: Implement static version first, add CSS transitions for hover/focus
  • Charts/graphs: Use placeholder data with the correct visual structure

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.