本文へスキップ
Skillpedia
インターフェース(UI/UX)101k · #981

design-extract

できること

このツールは、コードファイルや画像に散らばっている色、タイポグラフィ(書体や文字の組み方)、余白などのデザイン情報を集めて、ほかのプログラムが使えるように1か所にまとめます。

使う場面

  • ✓デザイン要素があちこちに分散しているプロジェクトがあるとき。
  • ✓あるプログラムから別のプログラムへデザインを移行するとき。
  • ✓Webサイトやアプリケーションのビジュアルスタイルをまとめて整理したいとき。

スキルのリンク

https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/design-extract/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/design-extract/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“コードと画像にあるデザイン要素を、1つのファイルにまとめて整理して。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールは、CSSやJavaScriptなどのさまざまな種類のコードファイルと画像の中から、色、フォント、余白の定義を探します。見つけた情報を収集し、標準化された形式で保存します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Design extract

Spec §10 / §21.3.2: tokens scattered across a repo's CSS / theme files / Tailwind config / styled-components helpers / SCSS partials need to be lifted into one bag before token-map can crosswalk them onto the active OD design system. This atom does the lifting; the input shape is intentionally generic so the same atom serves both code-migration and figma-migration when fed different sources.

Inputs

  • code/index.json from code-import (code-migration), OR
  • figma/tree.json from figma-extract (figma-migration), OR
  • A folder of screenshot images (tune-collab quick-tune flows).

Output

project-cwd/
└── code/
    └── tokens.json     # { colors[], typography[], spacing[], radius[], shadow[] }

Each token entry carries:

{
  "kind":     "color",
  "name":     "primary-500",     // optional source name
  "value":    "#5b8def",          // canonical value
  "sources": ["styles/global.css:42", "tailwind.config.js:24"],
  "usage":   ["Header.tsx", "Footer.tsx"]
}

sources[] and usage[] are the audit trail token-map.unmatched.json references when a target token can't be found.

Convergence

The atom completes when code/tokens.json exists. Empty token bags emit a warning event but do not abort — token-map handles the empty case by skipping its mapping pass.

Anti-patterns the prompt fragment forbids

  • Hard-coded hex values inside JSX literals (color: '#fff') are tokens for this atom's purposes; record them with kind:'color' and a synthetic name so they don't disappear into the noise.
  • Tailwind utility scans must dedupe palette references against the active theme — never list bg-blue-500 and bg-blue-600 as one token.

Status

Implemented by the daemon runner in apps/daemon/src/plugins/atoms/design-extract.ts. It scans the indexed source files, extracts CSS, Tailwind, and JavaScript token evidence, and writes code/tokens.json.

よくある質問

「デザイントークン」とは何ですか?

プロジェクトの見た目を構成する基本的な要素のことです。使われている正確な色、フォントの種類、要素同士の間隔などを指します。

なぜこの「トークン」を整理することが重要なのですか?

トークンを整理すると、プロジェクト全体でデザインを管理しやすくなり、統一感を保ちやすくなります。また、ほかのツールがこの情報を効率よく使えるようになります。

どのような種類のファイルからでもデザインを抽出できますか?

一般的なコードファイル(CSS、JavaScript、Tailwindなど)と画像に対応するように設計されています。Figmaで作られた複雑なデザインなどの場合は、追加の手順が必要になることがあります。

詳細

作者による元の説明

Extract design tokens (color / typography / spacing) from imported source code, screenshots, or Figma exports into the canonical token bag token-map consumes.

repo: nexu-io/open-design

人気

GitHubのスター
101k
ランキング
#981
ライセンス
Apache-2.0
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル