Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计提醒

figmaFigma 设计协作

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

1,187

周安装

51

GitHub Stars

52

下载量

416
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:figma(Figma 设计协作)
来源仓库:https://github.com/zenobi-us/dotfiles
仓库路径:skills/figma
安装命令:
npx skills add https://github.com/zenobi-us/dotfiles --skill figma
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/zenobi-us/dotfiles --skill figma

简介

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化,适合让 Agent 根据产品场景整理页面结构、生成 UI 方案或改进组件层级。

  • 适用于与 Figma 设计系统集成,提取设计 token 或生成前端代码片段。
  • 通过 npx skills add 命令安装后,结合设计稿链接或组件名称提供实现建议。
  • 使用时需结合现有品牌指南,避免脱离上下文堆砌装饰元素;涉及真实改动应通过浏览器预览验证文本溢出与对齐问题。
  • 安装前建议确认权限范围和维护状态,防止误读私有设计文件或触发 API 限流。

SKILL.md

Figma Skill

Master Figma automation and integration using the figma-desktop MCP server via mcporter. This skill enables programmatic access to Figma designs, code generation, screenshots, and Code Connect mappings.

[!CRITICAL] ⚠️ IMPORTANT - Parameter Passing: Use function-call syntax (NOT flag syntax). Parameters go inside the function call, not as flags: ``bash mise x node@20 -- mcporter call 'figma-desktop.get_design_context(nodeId: "123:456", clientLanguages: "typescript", clientFrameworks: "react")' ` **Key Rules:** - Parameters are camelCase inside the function call - String values use double quotes: "value" - Boolean values use bare notation: true or false - Environment variables are interpolated outside quotes: "'$VAR'" - NO --flag` syntax, NO JSON string escaping needed

Prerequisites

Verify Figma Desktop Connection

mise x node@20 -- mcporter call 'figma-desktop.get_metadata'

Should return metadata for the currently selected node. If it fails, ensure:

  1. Figma Desktop is running
  2. The figma-desktop MCP server is configured in mcporter

Quick Setup

Get Design Context (One-Shot)

The fastest way to get design information and generated code:

mise x node@20 -- ./scripts/get_design_context.sh "123:456"

Or use the currently selected node:

mise x node@20 -- ./scripts/get_design_context.sh

With framework context:

mise x node@20 -- ./scripts/get_design_context.sh "123:456" --languages "typescript" --frameworks "react"

Extract Node ID from URL

If you have a Figma URL like https://figma.com/design/:fileKey/:fileName?node-id=1-2:

  • The nodeId is 1:2 (replace - with :)

For branch URLs like https://figma.com/design/:fileKey/branch/:branchKey/:fileName:

  • Use branchKey as the fileKey

Core Operations

Get Design Context (Generate Code)

Primary tool for generating UI code from Figma designs:

mise x node@20 -- mcporter call 'figma-desktop.get_design_context(nodeId: "123:456")'

With technology context (recommended):

mise x node@20 -- mcporter call 'figma-desktop.get_design_context(nodeId: "123:456", clientLanguages: "typescript,css", clientFrameworks: "react")'

For currently selected node:

mise x node@20 -- mcporter call 'figma-desktop.get_design_context()'

Force code output (for large designs):

mise x node@20 -- mcporter call 'figma-desktop.get_design_context(nodeId: "123:456", forceCode: true)'

With artifact type context:

mise x node@20 -- mcporter call 'figma-desktop.get_design_context(nodeId: "123:456", artifactType: "REUSABLE_COMPONENT", taskType: "CREATE_ARTIFACT")'

Valid artifactType values:

  • WEB_PAGE_OR_APP_SCREEN
  • COMPONENT_WITHIN_A_WEB_PAGE_OR_APP_SCREEN
  • REUSABLE_COMPONENT
  • DESIGN_SYSTEM

Valid taskType values:

  • CREATE_ARTIFACT
  • CHANGE_ARTIFACT
  • DELETE_ARTIFACT

Get Screenshot

Capture a visual screenshot of a Figma node:

mise x node@20 -- mcporter call 'figma-desktop.get_screenshot(nodeId: "123:456")'

For currently selected node:

mise x node@20 -- mcporter call 'figma-desktop.get_screenshot()'

Get Metadata (Structure Overview)

Get XML structure overview of a node (node IDs, layer types, names, positions, sizes):

mise x node@20 -- mcporter call 'figma-desktop.get_metadata(nodeId: "123:456")'

Note: Prefer get_design_context for most use cases. Use get_metadata only for structure overview.

Get Variable Definitions

Get design tokens/variables for a node (colors, fonts, sizes, spacings):

mise x node@20 -- mcporter call 'figma-desktop.get_variable_defs(nodeId: "123:456")'

Returns mappings like: {'icon/default/secondary': '#949494'}

Get FigJam Content

For FigJam files (whiteboards, diagrams):

mise x node@20 -- mcporter call 'figma-desktop.get_figjam(nodeId: "123:456")'

With node images:

mise x node@20 -- mcporter call 'figma-desktop.get_figjam(nodeId: "123:456", includeImagesOfNodes: true)'

Note: Only works for FigJam files, not standard Figma design files.

Code Connect

Code Connect maps Figma components to code components in your codebase.

Get Code Connect Mappings

Check existing mappings for a node:

mise x node@20 -- mcporter call 'figma-desktop.get_code_connect_map(nodeId: "123:456")'

Returns mappings like:

{
  "1:2": {
    "codeConnectSrc": "https://github.com/foo/components/Button.tsx",
    "codeConnectName": "Button"
  }
}

Add Code Connect Mapping

Map a Figma component to a code component:

mise x node@20 -- mcporter call 'figma-desktop.add_code_connect_map(nodeId: "123:456", source: "src/components/Button.tsx", componentName: "Button", label: "React")'

Required parameters:

  • source: Path to component in codebase
  • componentName: Name of the component
  • label: Framework/language label

Valid label values:

  • React, Web Components, Vue, Svelte, Storybook, Javascript
  • Swift UIKit, Objective-C UIKit, SwiftUI
  • Compose, Java, Kotlin, Android XML Layout
  • Flutter, Markdown

Create Design System Rules

Generate design system rules for your repository:

mise x node@20 -- mcporter call 'figma-desktop.create_design_system_rules(clientLanguages: "typescript", clientFrameworks: "react")'

Helper Scripts

ScriptPurpose
./scripts/get_design_context.shOne-shot design context - Get design info and generated code (with optional framework context)
./scripts/get_screenshot.shCapture screenshot - Save node screenshot to file
./scripts/get_variables.shGet design tokens - Extract variables (colors, fonts, sizes, spacings)
./scripts/add_code_connect.shAdd Code Connect - Map Figma component to code component

Script help:

./scripts/get_design_context.sh --help
./scripts/get_screenshot.sh --help
./scripts/get_variables.sh --help
./scripts/add_code_connect.sh --help

Common Workflows

1. Implement a Design Component

# Get the node ID from Figma URL (node-id=1-2 → nodeId="1:2")
NODE_ID="1:2"

# Get design context with your tech stack
mise x node@20 -- mcporter call 'figma-desktop.get_design_context(nodeId: "'$NODE_ID'", clientLanguages: "typescript,css", clientFrameworks: "react")'

# Get variables/tokens for the component
mise x node@20 -- mcporter call 'figma-desktop.get_variable_defs(nodeId: "'$NODE_ID'")'

2. Document Component in Code Connect

# Check existing mappings
mise x node@20 -- mcporter call 'figma-desktop.get_code_connect_map(nodeId: "123:456")'

# Add mapping
mise x node@20 -- mcporter call 'figma-desktop.add_code_connect_map(nodeId: "123:456", source: "src/components/Button/Button.tsx", componentName: "Button", label: "React")'

3. Extract Design System Tokens

# Get all variables for a design system frame
mise x node@20 -- mcporter call 'figma-desktop.get_variable_defs(nodeId: "0:1")'

# Generate design system rules
mise x node@20 -- mcporter call 'figma-desktop.create_design_system_rules(clientLanguages: "typescript,css", clientFrameworks: "react")'

4. Screenshot for Documentation

# Get screenshot of a component
mise x node@20 -- mcporter call 'figma-desktop.get_screenshot(nodeId: "123:456")' > component.png

Common Issues & Solutions

ProblemSolution
Connection refusedEnsure Figma Desktop is running and figma-desktop MCP server is configured
Node not foundVerify nodeId format is 123:456 (colon separator). Check the node exists in the file.
No output for large designUse forceCode: true parameter to force code generation
Wrong code languageSpecify clientLanguages and clientFrameworks parameters
"Invalid arguments" or command failsUse function-call syntax, NOT flag syntax. Parameters go inside functionName(param: value)
FigJam tool not workingget_figjam only works for FigJam files, not regular Figma design files
Code Connect not appearingEnsure the node is a component instance, not a regular frame

Discovering Function Parameters with Schema Introspection

The mcporter CLI can introspect the MCP server schema to discover correct parameters and their types.

List All Available Tools

mise x node@20 -- mcporter list figma-desktop --json | jq -r ".tools[].name"

Returns:

get_design_context
get_variable_defs
get_screenshot
get_code_connect_map
add_code_connect_map
get_metadata
create_design_system_rules
get_figjam

Inspect a Specific Tool Schema

mise x node@20 -- mcporter list figma-desktop --json | jq '.tools[] | select(.name == "get_design_context")'

This returns the full JSON schema including:

  • inputSchema.properties - All available parameters with types and descriptions
  • inputSchema.required - Which parameters are mandatory

Filter for just required parameters:

mise x node@20 -- mcporter list figma-desktop --json | \
  jq '.tools[] | select(.name == "add_code_connect_map") | .inputSchema.required[]'

Get parameter descriptions:

mise x node@20 -- mcporter list figma-desktop --json | \
  jq '.tools[] | select(.name == "get_design_context") | .inputSchema.properties | to_entries[] | "\(.key): \(.value.description)"'

Tips

  • Node ID from URL: node-id=1-2 in URL becomes nodeId: "1:2" (replace - with :)
  • Branch URLs: For branch URLs, use branchKey as the fileKey
  • Currently selected: Omit nodeId to use the currently selected node in Figma Desktop
  • Technology context: Always specify clientLanguages and clientFrameworks for better code generation
  • Large designs: Use forceCode: true if output is truncated
  • Use jq for JSON parsing in shell scripts
  • Use schema introspection when unsure about parameters - mcporter list figma-desktop --json | jq is your friend

Available Tools Reference

ToolPurposeRequired Params
get_design_contextGenerate UI code from designNone (uses selection)
get_screenshotCapture visual screenshotNone (uses selection)
get_metadataGet XML structure overviewNone (uses selection)
get_variable_defsGet design tokens/variablesNone (uses selection)
get_code_connect_mapGet existing code mappingsNone (uses selection)
add_code_connect_mapMap design to code componentsource, componentName, label
create_design_system_rulesGenerate design system rulesNone
get_figjamGet FigJam contentNone (uses selection)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

29.29%
按下载量换算122

Claude Code

22.4%
按下载量换算93

Antigravity

18.87%
按下载量换算78

Gemini CLI

14.16%
按下载量换算59

windsurf

8.56%
按下载量换算36

Cursor

3.84%
按下载量换算16

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills