image-to-code-skill

视觉设计 / 插画 界面 · 动效 · 设计品味 图转代码 1 文件 EN 原文

把设计稿还原成代码

从截图或设计图还原为可运行的 HTML/CSS,尽量还原间距、字体与层次。

说明语言:中英混合

原文描述EN

Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, avoid lazy under-generation, avoid cards-inside-cards-inside-cards UI, and keep the hero clean, spacious, readable, and visible on a small laptop.

来源echoleesongclaude-skills-plugin ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/echoleesong/claude-skills-plugin --skill image-to-code-skill

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: image-to-code description: Elite website image-to-code skill for Codex. For visually important web tasks, it must first generate the design image(s) itself, deeply analyze them, then implement the website to match them as closely as possible. In Codex, it must prefer large, readable, section-specific images instead of tiny compressed boards, generate fresh standalone images for sections or detail views instead of cropping old ones, 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 generate premium, artistic, implementation-friendly website section references and then turn them into real frontend.

This skill is for:

Standard AI output tends to collapse into repetitive defaults:

Your goal is to aggressively break these defaults.

The output must feel:

IMPORTANT: For visual website tasks, you must first generate the design image(s) yourself. Then you must deeply analyze the generated image(s). Only after that should you implement the frontend.

Do not skip image generation when image generation is available. Do not begin with freeform coding first. The generated image(s) are the primary visual source of truth.

The required workflow is:

image generation first deep image analysis second implementation third

If the task is mainly visual, this order is mandatory.


1. ACTIVE BASELINE CONFIGURATION

AI Instruction: Use these as defaults unless the user clearly wants something else. Adapt them to the prompt.

Interpretation:


2. MANDATORY IMAGE-FIRST RULE

For website design requests where visual quality matters, image generation is mandatory first.

This means:

  1. generate the design image or image set yourself first
  2. deeply inspect and analyze the generated image(s)
  3. extract the design system from them
  4. implement the frontend only after that

Do not:

The image is the design source. The code is the translation layer.


3. GENERATE ENOUGH IMAGES RULE

Generate enough images to make the design truly readable and extractable.

Do not be lazy with image count.

If more images would improve:

then generate more images.

Strong rule:

Never reduce image count just for convenience if that harms quality.


4. CODEX-SPECIFIC SECTION IMAGE RULE

Inside Codex, do not compress too many website sections into one single image if that would make the text, spacing, buttons, or layout details too small to analyze properly.

In Codex, prefer separate large images per section.

Default rule inside Codex:

This is preferred because:

Do not default to:

If necessary, generate more images rather than shrinking everything.

Outside Codex, this skill may still allow more compact multi-section composition when appropriate. Inside Codex, prioritize section clarity and extraction accuracy.


5. DO NOT CROP OLD IMAGES RULE

When a section needs a dedicated image or a closer detail view, do not simply crop, cut out, zoom into, or slice it from a previously generated larger image.

Do not:

Instead:

Reason: cropped images often destroy:

Fresh section-specific generation is strongly preferred over cropping.


6. FRESH RE-GENERATION RULE

If a section or detail is not clear enough, generate it again as a new standalone image.

This standalone regeneration should:

But it should also:

This is not a different design. It is a cleaner, more analyzable section-specific render of the same design system.


7. OPTIONAL DETAIL / EXTRACTION IMAGE RULE

If a section image still does not expose the necessary detail clearly enough, generate an additional detail image for that same section.

Examples of useful secondary images:

These additional images exist to improve analysis and extraction quality.

Use them when needed for:

Do not hesitate to create a second or third extraction-oriented image for a section if the first image is too broad.


8. CLEAN ANALYSIS STANDARD

Analyze cleanly and systematically.

Do not do vague vibe-only analysis. Do not jump too fast from image to code.

For every generated section image, inspect cleanly:

If something is unclear, generate another image before coding.

The analysis should feel:


9. DEEP IMAGE ANALYSIS REQUIREMENT

Before implementing anything, deeply analyze the generated image(s).

Do not just glance at them. Treat them like a design specification.

Carefully inspect and extract:

Your goal is to understand exactly why the generated website looks strong.

Only after this deep analysis should you implement the frontend.


10. IMAGE-FIRST CODEX WEBSITE WORKFLOW

When this skill is used inside Codex or any environment that supports image generation plus implementation, default to an image-first workflow for website design tasks.

Preferred execution order:

  1. infer the section count
  2. generate section reference images first
  3. generate extra detail/extraction images where needed
  4. if needed, regenerate unclear sections as fresh standalone images
  5. deeply inspect all generated images
  6. extract text, typography, spacing, colors, layout, buttons, and component logic
  7. implement the website to match the generated design as closely as reasonably possible
  8. only invent missing details when the images leave something ambiguous

For visually important frontend tasks, do not begin by freely designing in code. Begin by creating the visual references first whenever image generation is available.

The images are the primary art-direction source. The code is the implementation layer.


11. WHEN TO TRIGGER IMAGE GENERATION FIRST

If image generation is available, strongly prefer generating image references first when the request is mainly about visual frontend quality.

Trigger image-first workflow when the user asks for:

Direct-code first is more acceptable only when:


12. THE COMBINATORIAL VARIATION ENGINE

To avoid repetitive AI-looking output, internally choose a strong combination and commit to it consistently.

Do not mash everything into chaos. Pick a coherent visual direction and execute it clearly.

Theme Paradigm

Choose 1:

  1. Pristine Light Mode
  2. Deep Dark Mode
  3. Bold Studio Solid
  4. Quiet Premium Neutral

Background Character

Choose 1:

  1. subtle technical grid / dotted field
  2. pure solid field with soft ambient gradient depth
  3. full-bleed cinematic imagery
  4. tactile textured surface feel

Typography Character

Choose 1:

  1. clean grotesk
  2. refined grotesk
  3. expressive display
  4. compressed statement typography
  5. editorial serif + sans
  6. Swiss rational hierarchy

Hero Architecture

Choose 1:

  1. cinematic centered minimalist
  2. asymmetric split hero
  3. floating polaroid scatter
  4. inline typography behemoth
  5. editorial offset composition
  6. massive image-first hero with restrained text

Section System

Choose 1:

  1. modular bento rhythm
  2. alternating editorial blocks
  3. poster-like stacked storytelling
  4. gallery-led cadence
  5. Swiss grid discipline
  6. asymmetric premium marketing flow

Signature Component Set

Choose exactly 4 unique components:

Motion-Implied Language

Choose exactly 2:

These are not coding instructions. They are visual-direction cues the design should imply.


13. WEBSITE REFERENCE RULE

Every generated website section image must clearly communicate:

A developer or coding model should be able to look at the image(s) and understand how to build the website.

Do not produce vague abstract artwork when the request is for frontend. Default to real section comps.


14. HERO MINIMALISM RULES

The hero must feel cinematic, clear, and intentional.

Absolute Hero Rules

Hero Cleanliness Rule

The hero should feel calm, premium, and immediately readable.

Do:

Do not:

Headline Rule

Strong preference:

Avoid:


15. RESPONSIVE FIRST-VIEW RULE

The first visible website screen must feel usable and clean on a small laptop.

This means:

The hero and immediate first-view area should:

A smaller laptop should still see:


16. ANTI-NESTED-BOX RULE

Do not default to box-in-box-in-box layouts.

Avoid:

Use boxes only when they have a clear purpose.

Prefer:

A section should not feel like a prison of containers. It should feel designed, open, and intentional.


17. REDUCE MICRO-UI CLUTTER RULE

Do not clutter the design with tiny UI extras that do not materially improve clarity.

Avoid:

Examples of things to avoid unless they are truly necessary:

Prefer:


18. SECTION IMAGE GENERATION RULE

Inside Codex, treat each section as its own analyzable unit.

If the user asks for:

General preference:

This section-first generation rule exists to prevent:


19. WEBSITE IMAGE SYSTEM RULE

When generating a website design, think not only about the overall site but also about the internal image system used inside the website itself.

This may include:

If the site benefits from multiple images, include multiple image moments across the website.

Rules:


20. FIXED MEDIA FRAME RULE

Images inside the website should usually sit inside clear, controlled, implementation-friendly frames.

Prefer:

Examples:

Avoid:

The goal is:


21. TEXT EXTRACTION RULE

When text is readable in the generated section image, extract it and use it.

Especially inspect and extract:

If the text is too small to extract reliably:

Do not ignore text extraction. The visible text is part of the design system and should influence implementation.


22. TYPOGRAPHY EXTRACTION RULE

Do not only notice that typography “looks nice”. Analyze it properly.

Extract and observe:

Use these findings during implementation. Do not flatten typography into a generic coded hierarchy.


23. SPACING EXTRACTION RULE

Analyze spacing deliberately.

Inspect:

The goal is not exact pixel OCR. The goal is faithful spacing logic.

Do not collapse the implementation into generic tight spacing if the generated design is more generous.


24. BUTTON / COMPONENT EXTRACTION RULE

Buttons and components must be analyzed, not guessed.

Inspect:

If button or card detail is too small, generate a closer image.


25. COLOR EXTRACTION RULE

Actively analyze and extract colors from the generated image(s).

Inspect:

The implemented website should preserve the original color logic as closely as reasonably possible.

Do not replace a carefully designed palette with generic default web colors.


26. DESIGN-TO-CODE COPY DISCIPLINE

After generating and analyzing the reference image(s), implement the website in a copy-oriented way.

This means:

Do not drift into a different design direction during implementation. Do not “improve” the design by replacing it with a generic coded layout.

The goal is not:

The goal is:


27. ANTI-DRIFT IMPLEMENTATION RULE

A common failure mode is design drift: the generated images look strong, but the coded result becomes generic.

Strictly avoid that.

During implementation:

The final coded result should still feel like the same website as the generated references.


28. MISSING DETAIL RESOLUTION

When implementing from images, some details may still be unclear.

Resolve ambiguity by following this order:

  1. preserve the visible design language
  2. preserve layout and spacing logic
  3. preserve component family
  4. preserve mood and polish level
  5. generate an extra detail image if needed
  6. regenerate the section as a fresh standalone image if needed
  7. only then choose the most implementation-friendly faithful version

Do not fill ambiguity with generic defaults too quickly.


29. ANTI-AI-SLOP RULES

Strictly avoid these patterns unless explicitly requested.

Layout slop

Visual slop

Typography slop

Content slop

Avoid generic filler vibes like:

Avoid fake brand slop:

Avoid fake complexity slop:

Density slop


30. TYPOGRAPHY-FIRST DISCIPLINE

Typography is a primary design material.

Always ensure:

For editorial directions:

For tech/product directions:


31. SECTION RHYTHM RULE

A high-end site does not feel like the same block repeated forever.

Vary section rhythm across the page by changing:

But:


32. DENSITY & SPACING DISCIPLINE

Do not make the website too dense.

The page should breathe.

Rules:

A premium website should feel:

Not:


33. DEFAULT SECTION PACKS

4-section pack

  1. Hero
  2. Features
  3. Social proof / testimonial
  4. CTA

8-section pack

  1. Hero
  2. Trust bar
  3. Features
  4. Product showcase
  5. Benefits / use cases
  6. Testimonials
  7. Pricing
  8. CTA

12-section pack

  1. Hero
  2. Trust bar
  3. Feature grid
  4. Product preview
  5. Problem / solution
  6. Benefits
  7. Workflow
  8. Metrics / proof / integration
  9. Testimonials
  10. Pricing
  11. FAQ
  12. CTA + footer

In Codex, these should usually become section-by-section images, not one compressed sheet.


34. MULTI-IMAGE CONSISTENCY RULE

For multi-image websites, enforce:

Image 2, 3, or 8 must not drift into a different website.


35. CLARITY CHECK

Before finalizing, verify internally:

  1. Has the design been generated first?
  2. Have all generated images been deeply analyzed?
  3. Is the text readable enough?
  4. If not, were extra detail images created?
  5. Were enough images generated, or was the image count too lazy?
  6. Were unclear sections regenerated as fresh standalone images instead of being cropped?
  7. Is the hierarchy obvious?
  8. Is the hero clean enough?
  9. Is typography analyzed properly?
  10. Are spacing relationships understood properly?
  11. Are buttons and components extracted properly?
  12. Are colors analyzed properly?
  13. Is the design visually distinctive?
  14. Is it free of obvious AI tells?
  15. Can someone code from this faithfully?
  16. If multiple images exist, do they clearly belong together?
  17. Has Codex avoided compressing too many sections into one tiny image?
  18. Was the analysis clean, structured, and specific?
  19. Has unnecessary nested boxing been removed?
  20. Is the first screen still clean and readable on a small laptop?
  21. Have useless pills, labels, and fake technical micro-elements been reduced?

If not, refine internally before output.


36. RESPONSE BEHAVIOR

When the user asks for a website design in an image-to-code workflow:

  1. infer site type
  2. infer number of sections
  3. if image generation is available and visual quality is central, generate the design image(s) first
  4. inside Codex, prefer one large image per section
  5. generate additional detail/extraction images if text or components are too small
  6. generate more images whenever that improves readability or extraction quality
  7. do not be lazy with image count
  8. do not crop old images for section extraction
  9. regenerate sections as fresh standalone images when needed
  10. choose a strong visual combination
  11. choose 4 signature components
  12. choose 2 motion-implied cues
  13. enforce hero cleanliness and short hero line count
  14. reduce unnecessary pills, labels, and micro-UI clutter
  15. avoid cards-inside-cards-inside-cards and giant boxed section wrappers
  16. keep the first screen readable and balanced on a small laptop
  17. enforce strong image usage where appropriate
  18. keep spacing generous, even, and analyzable
  19. deeply and cleanly analyze all generated images
  20. extract text, typography, spacing, buttons, colors, components, and layout logic
  21. implement the website to match the generated references as closely as reasonably possible
  22. create the final files only after the full analysis pass

Do not ask unnecessary follow-up questions if a strong interpretation is possible. Do not start with freeform coding when the visual problem should clearly be solved with image generation first. Do not compress many sections into one unreadable image in Codex. Do not crop previously generated large images when a fresh cleaner section-specific image should be generated instead.


37. EXAMPLE INTERPRETATIONS

Example 1

User: “make me one hero section for an AI startup”

Interpretation:

Example 2

User: “design me an 8-section landing page”

Interpretation:

Example 3

User: “make a premium creative agency website with 4 sections”

Interpretation:


38. FINAL GOAL

Generate website reference images that feel:

For visual website work, the skill must first generate the image(s) itself, then deeply and cleanly analyze those generated image(s), then use them as the primary visual source, then build the frontend to match them closely.

Inside Codex, if the user wants multiple sections, prefer separate large section images instead of one compressed multi-section board, so text, spacing, typography, buttons, and colors can be extracted properly.

If a section still needs more clarity, generate an additional extraction-oriented image for that section.

If more images would improve quality, generate more images. Do not be lazy with image count.

Do not crop previously generated images when a fresh section-specific image would preserve spacing, layout, and readability better. Generate a new clean image instead.

Avoid cards-inside-cards-inside-cards. Avoid giant boxed wrappers around every section. Avoid fake technical pills and decorative micro-labels. Keep the hero especially clean, spacious, restrained, and readable on a small laptop.

The result should be:

The final outcome should look like a top-tier website concept translated faithfully into real code, not a tiny unreadable design board and not a generic coded reinterpretation.

同类技能
animateanimate-expoanimation-performanceanimation-vocabularyapple-designask-sonnerbrandkitbreak-ui
本页内容来自开源项目 echoleesong, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。