Skip to content
extracting-design-tokens logo

Design Token Extraction Skill

extracting-design-tokens

Extracts and documents design tokens (colors, typography, spacing, shadows, etc.) from Figma designs. Updates the "デザイントークン" section in screen spec.md.

SKILL.md

Full skill instructions

Design Token Extraction Skill

Figmaデザインからデザイントークン(色、タイポグラフィ、スペーシング、シャドウ等)を抽出・整理するスキルです。

目次

  1. 概要
  2. 対象範囲
  3. クイックスタート
  4. 詳細ガイド
  5. 出力形式

概要

このスキルは以下のタスクをサポートします:

  1. カラートークン: プライマリ、セカンダリ、セマンティック色
  2. タイポグラフィ: フォントファミリー、サイズ、ウェイト、行間
  3. スペーシング: マージン、パディング、ギャップ
  4. シャドウ: エレベーション、ボックスシャドウ
  5. ボーダー: 角丸、線幅、スタイル
  6. アニメーション: duration、easing

禁止事項

以下は絶対に行わないこと:

  • CSS/​Sass/​CSS-in-JSの実装コード生成
  • 特定のデザインシステムライブラリの提案
  • 技術スタック固有の実装詳細

このスキルの目的は「どのようなデザイントークンがあるか」の情報整理のみです。

対象範囲

このスキルで抽出するもの

カテゴリトークン例
Colorprimary, secondary, error, success, background, text
Typographyheading-1, body-large, caption
Spacingxs, sm, md, lg, xl
Shadowelevation-1, elevation-2, elevation-3
Borderradius-sm, radius-md, radius-full
Animationduration-fast, duration-normal, easing-default

抽出レベル

  1. 画面レベル: この画面で使用されているトークン
  2. プロジェクトレベル: Figma Variables(利用可能な場合)

出力先

このスキルは画面仕様書(spec.md)の「デザイントークン」セクションを更新します。

.outputs/​{screen-id}/
├── spec.md                 # ← このスキルが「デザイントークン」セクションを更新
├── index.html              # 参照用HTML
└── assets/

クイックスタート

基本的な使い方

以下のFigma画面で使用されているデザイントークンを抽出してください:
https://figma.com/​design/​XXXXX/​Project?node-id=1234-5678

エージェントは自動的に:

  1. Figma Variablesを取得(利用可能な場合)
  2. 画面内で使用されている色・フォント・スペーシングを分析
  3. トークン一覧を整理
  4. spec.md の「デザイントークン」セクションを更新

詳細ガイド

詳細な情報は以下のファイルを参照してください:

Workflow

デザイントークン抽出時にこのチェックリストをコピー:

Design Token Extraction Progress:
- [ ] Step 0: spec.md の存在確認
- [ ] Step 1: Figma Variablesを取得
- [ ] Step 2: カラートークンを抽出
- [ ] Step 3: タイポグラフィトークンを抽出
- [ ] Step 4: スペーシングトークンを抽出
- [ ] Step 5: シャドウトークンを抽出
- [ ] Step 6: その他のトークンを抽出
- [ ] Step 7: トークン使用箇所をマッピング
- [ ] Step 8: spec.md の「デザイントークン」セクションを更新

Step 0: spec.md の存在確認

ls .outputs/​{screen-id}/​spec.md

Step 1: Figma Variablesを取得

mcp__figma__get_variable_defs(fileKey, nodeId)

Figma Variablesが定義されている場合、トークン名と値のマッピングを取得。

Step 2: カラートークンを抽出

画面内で使用されている色を収集:

  • 背景色
  • テキスト色
  • ボーダー色
  • アイコン色
  • セマンティック色(success, error, warning, info)

Step 3: タイポグラフィトークンを抽出

  • フォントファミリー
  • フォントサイズ
  • フォントウェイト
  • 行間(line-height)
  • 字間(letter-spacing)

Step 4: スペーシングトークンを抽出

  • コンポーネント間の余白
  • パディング
  • ギャップ(Flexbox/​Grid)

Step 5: シャドウトークンを抽出

  • ボックスシャドウの値
  • エレベーションレベル

Step 6: その他のトークンを抽出

  • ボーダー角丸
  • ボーダー幅
  • アニメーション duration
  • z-index

Step 7: トークン使用箇所をマッピング

各トークンがどの要素で使用されているかを整理:

トークン使用箇所
color/​primaryボタン背景、リンクテキスト
color/​text/​primary見出し、本文
spacing/​mdカード内パディング

Step 8: spec.md の「デザイントークン」セクションを更新

  1. セクションを特定(## デザイントークン)
  2. ステータスを「完了 ✓」に更新
  3. {{DESIGN_TOKENS_CONTENT}} を内容に置換
  4. 完了チェックリストを更新
  5. 変更履歴に追記

出力形式

spec.md「デザイントークン」セクションの内容

## デザイントークン

> **ステータス**: 完了 ✓  
> **生成スキル**: extracting-design-tokens  
> **更新日**: 2024-01-15

### カラー

#### プライマリ

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| color/​primary/​default | #0070E0 | ボタン、リンク |
| color/​primary/​hover | #005BB5 | ホバー状態 |
| color/​primary/​pressed | #004A99 | 押下状態 |

#### テキスト

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| color/​text/​primary | #24243F | 見出し、本文 |
| color/​text/​secondary | #67717A | 補足テキスト |
| color/​text/​disabled | #9E9E9E | 非活性テキスト |
| color/​text/​inverse | #FFFFFF | 暗い背景上のテキスト |

#### 背景

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| color/​background/​primary | #FFFFFF | ページ背景 |
| color/​background/​secondary | #F8F9F9 | セクション背景 |
| color/​background/​tertiary | #E8EAED | カード背景 |

#### セマンティック

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| color/​success | #2E7D32 | 成功状態 |
| color/​error | #D32F2F | エラー状態 |
| color/​warning | #F57C00 | 警告状態 |
| color/​info | #1976D2 | 情報 |

### タイポグラフィ

| トークン名 | フォント | サイズ | ウェイト | 行間 | 用途 |
|-----------|---------|--------|---------|------|------|
| typography/​heading-1 | Noto Sans JP | 32px | 700 | 1.4 | ページタイトル |
| typography/​heading-2 | Noto Sans JP | 24px | 700 | 1.4 | セクション見出し |
| typography/​heading-3 | Noto Sans JP | 20px | 600 | 1.4 | サブ見出し |
| typography/​body-large | Noto Sans JP | 16px | 400 | 1.6 | 本文(強調) |
| typography/​body | Noto Sans JP | 14px | 400 | 1.6 | 本文 |
| typography/​caption | Noto Sans JP | 12px | 400 | 1.5 | キャプション |
| typography/​button | Noto Sans JP | 14px | 600 | 1.0 | ボタンテキスト |

### スペーシング

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| spacing/​2xs | 4px | 最小間隔 |
| spacing/​xs | 8px | アイコンとテキスト間 |
| spacing/​sm | 12px | 関連要素間 |
| spacing/​md | 16px | コンポーネント内パディング |
| spacing/​lg | 24px | セクション間 |
| spacing/​xl | 32px | 大きなセクション間 |
| spacing/​2xl | 48px | ページセクション間 |

### シャドウ

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| shadow/​sm | 0 1px 2px rgba(0,0,0,0.05) | 軽いエレベーション |
| shadow/​md | 0 2px 4px rgba(0,0,0,0.1) | カード |
| shadow/​lg | 0 4px 12px rgba(0,0,0,0.15) | ホバー状態 |
| shadow/​xl | 0 8px 24px rgba(0,0,0,0.2) | モーダル |

### ボーダー

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| border/​radius/​sm | 4px | ボタン、入力フィールド |
| border/​radius/​md | 8px | カード |
| border/​radius/​lg | 16px | モーダル |
| border/​radius/​full | 9999px | 円形、ピル型 |
| border/​width/​default | 1px | 標準線幅 |
| border/​color/​default | #E0E0E0 | 区切り線、入力ボーダー |

### アニメーション

| トークン名 | 値 | 用途 |
|-----------|-----|------|
| animation/​duration/​fast | 100ms | 即時フィードバック |
| animation/​duration/​normal | 200ms | 標準トランジション |
| animation/​duration/​slow | 300ms | モーダル、大きな変化 |
| animation/​easing/​default | ease-out | 標準イージング |
| animation/​easing/​enter | ease-out | 要素の登場 |
| animation/​easing/​exit | ease-in | 要素の退場 |

### この画面で使用されているトークン

| カテゴリ | トークン | 使用箇所 |
|---------|---------|---------|
| Color | color/​primary/​default | 送信ボタン背景、講座リンク |
| Color | color/​text/​primary | ページタイトル、本文 |
| Color | color/​background/​secondary | カード背景 |
| Typography | typography/​heading-1 | ページタイトル |
| Typography | typography/​body | 講座説明文 |
| Spacing | spacing/​md | カード内パディング |
| Spacing | spacing/​lg | カード間ギャップ |
| Shadow | shadow/​md | 講座カード |
| Border | border/​radius/​md | 講座カード |

### 特記事項

- Figma Variablesから取得したトークンは「Figma定義」列に ✓ を記載
- 画面から推測したトークンは「要確認」として明示

完了チェックリスト

生成後、以下を確認:

- [ ] spec.md の「デザイントークン」セクションが更新されている
- [ ] ステータスが「完了 ✓」になっている
- [ ] カラートークンが網羅されている
- [ ] タイポグラフィトークンが網羅されている
- [ ] スペーシングトークンが網羅されている
- [ ] 使用箇所がマッピングされている
- [ ] 完了チェックリストが更新されている
- [ ] 変更履歴に記録が追加されている

注意事項

他のセクションを変更しない

このスキルは「デザイントークン」セクションのみを更新します。

Figma Variablesがない場合

Figma Variablesが定義されていない場合:

  1. 画面内で使用されている値を直接抽出
  2. 一般的な命名規則でトークン名を推測
  3. 「要確認」として明示

トークン命名規則

詳細は token-categories.md を参照。

基本形式: {category}/​{subcategory}/​{variant}

例:

  • color/​primary/​default
  • typography/​heading/​1
  • spacing/​md

参照

More Design skills

brandkit logo
Design

brandkit

Premium brand-kit image generation for high-end identity systems, logo concepts, and visual-world presentations.

92.7K 345.8K
View

Premium website design-to-code skill that generates visual references first, then builds faithful frontend implementations.

92.7K 341.7K
View

Premium frontend image direction for landing pages and marketing sites, generating one distinct horizontal image per section.

92.7K 337.8K
View

Premium mobile app screen concepts and flows with clean hierarchy, strong imagery, and distinctive art direction.

92.7K 331.8K
View

Emil Kowalski's philosophy on UI polish, component design, and the invisible details that make software feel good.

43.5K 323.4K
View

Frontend design and iteration for production-grade interfaces, from concept to ship.

76.8K 313.3K
View

Reverse-engineer design tokens from public websites into starter token files for your project.

232 129.9K
View
Animate logo
Design

Animate

Builds an animation from scratch by making the decisions in the order that determines whether it feels right.

43.5K 117.9K
View

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

179.7K 114.2K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

Design AI tools

Maze Guru logo
Images

Maze Guru

Chat-to-edit AI studio for product photos, portraits, branding, and video.

Freemium
View
R
Design

RoomGPT

Generate your dream room in seconds.

Paid
View

Redesign your interior in seconds using AI

Paid
View
Reroom logo
Design

Reroom

Transform rooms with AI-generated designs.

Freemium
View
Jife logo
Design

Jife

Transform Your Space with AI-Powered Japanese Interior Designs by Jife

Paid
View
Visily logo
Design

Visily

AI-powered wireframes for non-designers.

Free
View

Revolutionize Property Viewing with AI-Generated Floor Plans and Virtual Tours

Paid
View
Archsynth logo
Design

Archsynth

Transform sketches into stunning architectural renders with AI.

Paid
View