跳到正文
cccskills
免费在 GitHub 公开

design-image-to-code

Turn a reference image or mockup into a working local frontend that matches it closely. Inspects the image, extracts the design system (layout, type, spacing, color, components), implements it, then screenshot-compares and iterates to close the gap. Use when the user says "image to code", "build this mockup", "code this screenshot", "make this design real", or provides a UI image to implement. Part of the Product Design set. Uses a browser tool for screenshot verification.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Design — Image To Code

Reproduce a reference image as a real, runnable frontend — verified by screenshot diff, not "looks roughly like it". The discipline that separates this from generic codegen: you measure the result against the reference and iterate until the gap is minor and explainable.

When to use

  • You have a mockup/screenshot (from a designer, design-ideate, or generated) to implement.
  • "Build this design", "code this screenshot", "make this real".
  • Recreating a UI you can see but don't have code for.

When NOT to use

  • The source is a live site (you can hit its URL/HTML) → design-url-to-code (it can extract real CSS).
  • No image yet, just an idea → design-ideate.
  • You need interactivity/flow wiring, not a static match → design-prototype (run this first to build screens).

Inputs

  • The reference image(s) (path).
  • Target stack: ask; default to matching the repo, else React + Vite + Tailwind + TS.
  • ./design/context.md constraints if present.

Workflow

  1. Inspect the image with a vision/read tool. Inventory every meaningful element. Extract the design system: layout grid, type scale, spacing rhythm, palette, components, radii, shadows.
  2. Reuse before inventing: if adapting an existing project, read its components/tokens/fonts first and use them.
  3. First pass: build to match the primary viewport as closely as possible. Don't chase responsive yet.
  4. Capture: run the app, screenshot at the reference's exact dimensions via a browser-automation tool.
  5. Compare & list mismatches in priority order: layout → type → spacing → color → icons.
  6. Iterate until differences are minor and explainable. Then handle responsive (tablet/mobile).
  7. Missing assets: use supplied files; generate raster assets with an image tool; or use clearly-marked placeholders + a note.

Worked example

reference: ./mocks/pricing.png  (1440px wide)
stack: matches repo → Next.js + Tailwind + Aurora DS
pass 1: built 3-tier pricing grid, header, CTA
capture: screenshot @1440 → ./design/checks/pricing-impl.png
mismatches:
 - [layout] cards 3-col but gap too tight (16 vs ~32 in ref)
 - [type] tier price 32px, ref ~40px
 - [color] "popular" badge wrong accent (#7C3 vs ref #16A34A)
 - [spacing] section pad 48 vs ref ~80
iterate: fix gap=32, price=40px, badge=#16A34A, section pad=80
re-capture: gap now minor (sub-pixel font rendering only) → DONE
responsive: collapse to 1-col < 768px, stack CTA
verify: build clean, typecheck clean, runs at :3000

Quality bar / Definition of done

  • Implementation screenshot ≈ reference at the target viewport; remaining diffs are minor and explained.
  • Existing design-system components/tokens reused, not duplicated.
  • Build + typecheck clean; runs locally with one command.
  • Responsive handled after the reference-size match is solid.

Common pitfalls

  • Claiming parity without comparing — always capture + diff. "Looks close" isn't verification.
  • "Improving" the design — match the reference unless explicitly asked to deviate; note any forced deviations (e.g. for a11y).
  • Inventing new tokens when the project already has a scale — creates drift.
  • Chasing responsive too early — nail the reference viewport first, or you iterate on a moving target.
  • Eyeballing spacing/type — measure against the reference; "looks like 16" is often 24.

Handoff

Static screens done → design-prototype (wire interactivity/flow) → design-qa (conformance) → design-share.

Tooling

Needs a vision/read tool (inspect the image) and a browser-automation tool (screenshot the build for comparison). Optional image tool for missing assets. Without a browser tool you can still build, but flag that visual parity is unverified.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Rapidly generate up to 25 distinct ad creative hypotheses for testing. Produces a matrix of angles (pain, benefit, social proof, urgency, curiosity, comparison) x formats (static, carousel hook, UGC-style, bold-text overlay) with headline, visual prompt, and rationale for each, then generates the visuals with any image tool. Use when the user wants "ad variations", "ad concepts", "creative testing batch", "give me 25 ads", or paid-social creative ideation. Part of the Creative Production set.

中文简介正在准备中。当前显示原文说明。

DKeken/codex-skills-alternative152026年6月3日 更新

Pick a visual direction before generating any creative. Produces 3-6 named, distinct visual directions (e.g. premium minimal, bold maximalist, lifestyle/editorial, retro, techno-brutalist) with rationale + sample prompts, then generates one reference image per direction so the user can choose. Use when the user says "explore visual direction", "what style should this be", "give me directions/looks", or before ads/scene/shot work when no style is locked. Part of the Creative Production set.

中文简介正在准备中。当前显示原文说明。

DKeken/codex-skills-alternative152026年6月3日 更新

Build visual territories (mood boards) for team alignment before production. Groups references into 2-4 named territories, each with palette, texture, typography feel, and 4-6 generated sample tiles, so a team can agree on a direction. Use when the user says "moodboard", "visual territories", "align the team on a look", "reference board", or needs stakeholder sign-off on aesthetic before generating final assets. Part of the Creative Production set.

中文简介正在准备中。当前显示原文说明。

DKeken/codex-skills-alternative152026年6月3日 更新

Build visuals that sell a specific offer and value proposition. Translates an offer (price, bundle, guarantee, bonus, deadline) into hero visuals that make the value legible at a glance. Use when the user says "visualize the offer", "promo creative", "make the deal look good", "value prop hero", or has a concrete offer to merchandise. Part of the Creative Production set.

中文简介正在准备中。当前显示原文说明。

DKeken/codex-skills-alternative152026年6月3日 更新

Take a chosen visual to finished, production-ready state. Runs cleanup + refinement passes (fix artifacts, balance composition, color-grade, sharpen text, conform to spec/aspect) using image edit/regenerate. Use when the user says "polish this", "finalize", "clean up the image", "production-ready", "fix the artifacts", or has a selected visual that needs finishing. Final stage of the Creative Production set.

中文简介正在准备中。当前显示原文说明。

DKeken/codex-skills-alternative152026年6月3日 更新

Connect business positioning to a concrete visual language. Maps strategic positioning (category, differentiator, who-it's-for, who-it's-against) onto visual decisions — palette, type, imagery, tone — so the look reinforces the strategy. Use when the user says "positioning into visuals", "what should the brand look like given our strategy", "align visuals with positioning", or is moving from strategy to brand expression. Part of the Creative Production set.

中文简介正在准备中。当前显示原文说明。

DKeken/codex-skills-alternative152026年6月3日 更新

查看 DKeken 的全部技能

报告此技能的问题