Skip to content
Back to skills

Collection

ASecurity

Fetch design information from Figma using the API. Use when applying designs from Figma, extracting styles, colors, fonts, or layout information. Requires FIGMA_TOKEN environment variable.

  • 24 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
designbashnodeapi

Works with

  • api

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-1882c87b/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-1882c87b)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: figma
description: Fetch design information from Figma using the API. Use when applying designs from Figma, extracting styles, colors, fonts, or layout information. Requires FIGMA_TOKEN environment variable.
---

# Figma Design Fetcher

Figma APIを使用してデザイン情報を取得し、CSSやスタイル情報を抽出するSkillです。

## 環境変数

```bash
export FIGMA_TOKEN="your-figma-personal-access-token"
```

## 使い方

### 1. FigmaのURLからfile_keyとnode_idを抽出

FigmaのURL形式:
```
https://www.figma.com/design/{file_key}/{file_name}?node-id={node_id}
```

例:
- URL: `https://www.figma.com/design/dOd0KjODECcrKVCK8F8MkI/MyDesign?node-id=2-2`
- file_key: `dOd0KjODECcrKVCK8F8MkI`
- node_id: `2-2`

### 2. デザイン情報を取得

```bash
# ファイル全体の情報を取得
curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \
  "https://api.figma.com/v1/files/{file_key}"

# 特定ノードの情報を取得
curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \
  "https://api.figma.com/v1/files/{file_key}/nodes?ids={node_id}"

# 画像をエクスポート
curl -s -H "X-Figma-Token: $FIGMA_TOKEN" \
  "https://api.figma.com/v1/images/{file_key}?ids={node_id}&format=png&scale=2"
```

### 3. スタイル情報の抽出

Figma APIのレスポンスから以下を抽出:

- **色**: `fills[].color` (RGBA 0-1形式)
- **フォント**: `style.fontFamily`, `style.fontSize`, `style.fontWeight`
- **サイズ**: `absoluteBoundingBox.width`, `absoluteBoundingBox.height`
- **余白**: `paddingLeft`, `paddingRight`, `paddingTop`, `paddingBottom`
- **角丸**: `cornerRadius`
- **影**: `effects[].type === "DROP_SHADOW"`

### 4. 色の変換

Figma APIの色 (0-1) → CSS (0-255):
```
r: Math.round(color.r * 255)
g: Math.round(color.g * 255)
b: Math.round(color.b * 255)
a: color.a
```

## APIエンドポイント

| エンドポイント | 説明 |
|---------------|------|
| `GET /v1/files/:file_key` | ファイル全体のドキュメントツリー |
| `GET /v1/files/:file_key/nodes?ids=:ids` | 特定ノードの詳細情報 |
| `GET /v1/images/:file_key?ids=:ids&format=png` | ノードを画像としてエクスポート |
| `GET /v1/files/:file_key/styles` | ファイルのスタイル一覧 |

## スクリプト

デザイン情報取得:
```bash
.claude/skills/figma/scripts/fetch_design.sh {file_key} {node_id}
```

## 出力例

```json
{
  "colors": {
    "primary": "#3B82F6",
    "background": "#FFFFFF",
    "text": "#1F2937"
  },
  "typography": {
    "heading": { "fontFamily": "Inter", "fontSize": 24, "fontWeight": 700 },
    "body": { "fontFamily": "Inter", "fontSize": 16, "fontWeight": 400 }
  },
  "spacing": {
    "containerPadding": 24,
    "elementGap": 16
  },
  "borderRadius": 8
}
```

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.