Communitygithub.com

デザインリファレンス抽出&マッピング

参照サイトや貼り付けられたHTMLからビジュアルシステム(カラー、タイポグラフィ、スペーシング、形状、コンポーネント構造、トーン)を抽出し、現在のプロジェクトの既存トークンにマッピングするスキルです。

デザインリファレンス抽出&マッピング とは?

このスキルは、ユーザーが「このサイトのようにして」「このスタイルで」といった参照を共有した際に、その参照元からビジュアルデザインシステムを体系的に抽出し、現在のプロジェクトのデザイントークンにマッピングするためのものです。対応プラットフォームはClaude CodeなどのAIエージェントで、参照元のURLからスクリーンショットと計算済みスタイルを取得したり、貼り付けられたHTMLをレンダリングしてインラインスタイルを直接解析します。抽出後は色、タイポグラフィ、スペーシング、形状、コンポーネント構造、トーンの6カテゴリに整理し、既存トークン(CSS変数やTailwind設定など)と比較したトークンテーブルを生成します。新しいトークンは必要最小限に抑え、既存トークンのチューニングを優先し、コントラスト比のチェックも自動で行います。コード変更は行わず、ユーザーの承認を待ってから次のステップ(design-pass)に進む設計です。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/iamk3nnyt/claude-skills/tree/HEAD/skills/design-ref

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

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

ドキュメント

デザインリファレンス

参照: $ARGUMENTS

1. 参照をキャプチャする

URL: 共有ツールキットで1440pxと375pxのスクリーンショットを撮り、シートを読み込みます:

node ${CLAUDE_SKILL_DIR}/../ui-audit/scripts/audit.mjs <url> --widths 375,1440 --no-axe --out /tmp/design-ref/<host>

--injectを使用して計算済みスタイルを取得するか、${CLAUDE_SKILL_DIR}/../ui-audit/scripts/cdp.mjsをインポートした一回限りのCDPスクリプト(launch()→navigate()→evaluate())で取得します。body、h1–h3、p、a、button、プライマリCTA、カード、アイブロウ/キッカー、入力フィールド、フッターのgetComputedStyleをサンプリングします。font-family/font-size/font-weight/line-height/letter-spacing、color、background、border-radius、box-shadow、padding、gapを収集します。

貼り付けられたHTML / メール: /tmp/design-ref/ref.htmlに保存し、render-html.mjsでレンダリングしてインラインスタイルを直接読み取ります。

2. システムを抽出する

  • カラーロール: キャンバス、サーフェス、インク、ミュートインク、アクセント、アクセントインク、ボーダー、成功/警告。各ロールのHEX値と、それが使用される場所を示します。
  • タイポグラフィ: フォントファミリー(ライセンスフォントの場合は最も近い無料代替フォントも)、ピクセル値/行間/ウェイト/トラッキングを含むスケールステップ、およびケース設定(アイブロウは大文字+トラッキング?)。
  • スペーシング: 実際に使用されているリズム(例:8/16/24/40/64)、セクションパディング、カードパディング。
  • シェイプ: 要素クラスごとの角丸、シャドウレシピ、ボーダーの太さ。
  • コンポーネント構造: ボタン(高さ、パディング、角丸、ウェイト、アイコン)、カード、アイブロウ、ヒーロー構成。
  • トーン: 3つの形容詞と、コピーが何をしているか(短い文章?二人称?数字?)。

3. プロジェクトにマッピングする(フォークしない)

プロジェクトのトークン(app/globals.cssの@theme/:root、tailwind.config、またはテーマファイル)と既存のコンポーネントを読み取ります。以下を生成します:

ロール参照現在のプロジェクトトークン提案
accent#FF5A1F--color-brand #…維持 / 再調整 / 新規(理由を記載)

ルール:

  • 新しいトークンを追加する前に、既存トークンを再調整します。新しいトークンごとに1行の理由が必要です。
  • ブランド固定の項目は変更しません:ロゴ、プロジェクトに既存のブランドカラー、すでにライセンスまたは使用中のフォント。
  • すべての提案について、アクセントオンキャンバスとインクオンサーフェスのコントラストを確認します(テキスト≥4.5:1、UI≥3:1)。
  • プロジェクトがコードと同期しているFigmaファイルを保持している場合、トークンの変更は同じタスク内でFigmaにも反映します。

終了条件

  • 各行が「維持」「再調整」「新規」のいずれかにマークされたトークンテーブルが完成している。
  • 提案されたペアのコントラストが確認されている。
  • まだコードは変更されていない。コード変更はdesign-passで、ユーザーがテーブルに同意した後に行う。
  • テーブルの下に1文の要約がユーザーに提示されている。

Individual skills in this repo

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

iamk3nnyt/claude-skills

Turns a feature idea into a one-page spec covering problem, audience, MVP scope, non-goals, numbered Given/When/Then acceptance criteria, affected routes, data and emails, and open questions. Use when the user says "brief", "spec this", "scope this" or "what would it take", or before starting a feature whose scope is unclear.

iamk3nnyt/claude-skills

Checks UI copy across locales by comparing key parity between next-intl message catalogs and in-code sv/en COPY objects, finding placeholder and array mismatches and words from the other language leaking in (the "och" in English bug), then manually reviewing claims against terms and pricing and the project's banned phrases. Use after editing copy or translations, before shipping a page with new text, or when asked to proofread or check translations.

iamk3nnyt/claude-skills

Applies an agreed visual direction to a page or component by reusing existing components first, then verifies every width and dark mode with the headless-Chrome audit plus a before/after pixel diff, and reviews against Refactoring UI, Nielsen and WCAG 2.2. Use when asked to redesign, restyle, polish or "make it look like the reference", after design-ref or when the direction is already clear.

iamk3nnyt/claude-skills

QAs a project's transactional and digest emails by rendering every template without DB or network, screenshotting at 600 and 375 px in light, dark and images-off, and checking for placeholder leaks (undefined, NaN, {{…}}), preheader, unsubscribe, alt text, absolute links, Outlook-safe buttons, viewport meta and Gmail's 102 KB clip. Use when email templates change, before sending a campaign, or when asked to check how emails look.

関連スキル