Community画像github.com

plugin87/image-to-code

デザイン参照、スクリーンショット、モックアップをもとに、トークン駆動でアクセシブルなコードを生成。リファレンスからデザインシステム(パレット、タイプスケール、スペーシング、半径、レイアウトアーキタイプ)を推測し、3層トークンにマッピングして再構築し、キットのゲートで検証します。ユーザーがデザインやスクリーンショットを提供し、それにマッチするUIコードを求めている際に使用します。

image-to-code とは?

このスキルは、画像やスクリーンショット、モックアップなどの視覚的なデザインリファレンスを基に、単なるコピーではなく、真のデザインシステムとしてのUIコードを生成します。デザイナーのようにリファレンスを解析し、パレット、タイポグラフィ、スペーシング、角丸、レイアウトといったデザイン言語を推測。推測した値を3層(DTCG)トークンに変換し、単一の `theme.css` を生成します。生成後は、コントラスト検証、レンダリング比較、ハードコードチェック、テイスト監査などの自動検証ゲートを通過し、アクセシブルで一貫性のあるコードを実現します。対応プラットフォームは汎用的で、あらゆるWeb UIフレームワークに適用可能ですが、特にトークンベースの設計システム(例:Claude Code, Cursor, Codexなどのエージェントプラットフォーム)を前提としています。重要なのは、著作権で保護された画像やブランド資産を複製せず、あくまでデザインシステムのロジックを抽出・再現する点です。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/plugin87/ux-ui-agent-skills/tree/main/.claude/skills/image-to-code

Installed? Explore more 画像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

スキル:画像からコードへ

視覚的なリファレンスから、単発のコピーではなく、真のデザインシステムとして設計を再構築します。システム(カラー/タイポグラフィ/スペーシングの言語)に合わせてください。決して著作権のある画像やブランド資産を流用しないでください。

ステップ

  1. リファレンスをデザイナーのように読み込む。 以下を推測して書き留めます。
    • パレット — 1つの主要サーフェスファミリー、テキストカラー、1つの主要アクション + 最大1つのアクセント(色相をサンプリングし、ランダムなhexを推測しないこと)。
    • タイポグラフィ — ファミリーの雰囲気(ジオメトリック/グロテスク/セリフ)、スケールの跳び方、ディスプレイ対ボディのコントラスト、ウェイト。
    • スペーシングと密度 — 基本単位、セクションのリズム、カードのパディング;空気感があるかコンパクトか。
    • 角丸と奥行き — 角丸の言語(シャープ/ソフト/ピル)、シャドウ対ヘアラインによる区切り。
    • レイアウトアーキタイプと順序 — フルブリードヒーロー / 非対称スプリット / ベントー / エディトリアルスタック(taste/design-taste.md → バリアンス必須)。
  2. 既知のシステムにアンカーする 類似している場合 — taste/aesthetic-systems.md / python3 scripts/design_systems.py search <term> を参照し、そのレシピを採用して判断を安定させます。
  3. 推測した値からトークンテーマを構築する → 3層DTCG(design-tokens スキル);単一の theme.css を生成します。すべてのカラーペアを scripts/contrast.py / scripts/validate_contrast.py(ライト+ダーク)で検証 — サンプリングしたブランドカラーがAAに失敗した場合は調整;テイストがPOURを優先することはありません。
  4. トークン駆動でレイアウト+コンポーネントを再構築する frameworks/adapter-protocol.md + components/* 経由:1つの共有プリミティブレイヤー、全8状態、a11y配線済み、絵文字なし(lucide)、単一テーマ。design-taste.md を適用して、汎用的なものに後退しないようにします。
  5. リファレンスに対して検証する — レンダリングしてスクリーンショットを撮り、リファレンスと並べて比較;node scripts/measure_render.mjs、lint_hardcodes.py、taste_audit.mjs、npm run verify を実行します。

検証(完了条件)

  • npm run verify が100%合格(トークンが解決、コントラストAAライト+ダーク、ハードコード/絵文字なし、実レンダリングWCAG準拠)。
  • 再構築されたUIは1つの推測されたトークンテーマを使用 — セクションごとのパレットはありません。
  • 結果のスクリーンショットが、リファレンスのデザイン言語と視覚的に一致していること。

正直な限界:これはデザインシステムに一致させるものであり、ピクセルパーフェクトなコピーではありません。リファレンスの写真、ロゴ、著作権のあるコピーを再現しないでください — 代わりに独自のものか汎用的なプレースホルダーを使用してください。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

plugin87/design-tokens

Generate, extend, or audit design tokens in DTCG format with the 3-tier architecture (primitive → semantic → component). Use when the user wants a color palette, type scale, spacing/shadow/radius/motion tokens, multi-brand theming, or wants to validate token files. Covers colors, typography, spacing, shadows, borders, breakpoints, motion, gradients, opacity, blur, sizing, states, theming.

plugin87/governance

Govern how the design system evolves — SemVer for tokens/components, the contribution workflow, deprecation policy, and change communication. Use when the user wants to add/promote/deprecate a component or token, decide a version bump, set up a contribution process, or keep the system from fragmenting.

plugin87/performance

Optimize UI performance against Core Web Vitals — LCP, INP, CLS — with loading/code-split strategy, layout-shift prevention, and animation performance rules. Use when the user wants to improve speed, fix jank or layout shift, hit Web Vitals budgets, or make a UI feel fast on low-end devices.

plugin87/prototype

Move an idea up the fidelity ladder (content-first → wireframe → low-fi → high-fi → code) with a validation plan at each level, plus user-journey mapping and usability-testing scripts. Use when the user wants to prototype, wireframe, map a user flow, or plan/run usability testing.

plugin87/redesign

Upgrade an existing website or app to premium quality without breaking functionality — audit the current design, identify generic/AI tells, then apply taste and system rules surgically. Use when the user wants to improve, modernize, polish, or "make better" an existing UI/codebase.

plugin87/token-build

Set up or run the token build pipeline — transform the DTCG tokens/*.json (source of truth) into platform artifacts (CSS variables, Tailwind @theme, JS/TS, iOS Asset Catalog, Android, Compose) with Style Dictionary / Tokens Studio / W3C DTCG export. Use when the user wants to generate platform theme files from tokens, wire token CI, or multi-platform token output.

plugin87/ux-writing

Write or review UI copy — buttons, errors, empty states, microcopy, notifications, labels — using the voice & tone system (clear, concise, useful, human, honest) with the what→why→how error formula and inclusive-language rules. Use when the user needs interface copy, error messages, empty-state text, or a copy review.

関連スキル