Token导航 LogoToken导航

Agent Skill · 研究检索

figma-to-react-components(Figma TO React 组件)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

figma-to-react-components 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 53,729。

总安装 524周安装 21GitHub Stars 13下载 170核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ravnhq/ai-toolkit --skill figma-to-react-components

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助前端页面和组件开发,支持 React、Next.js、Vue 等框架代码生成。可审查样式、布局和交互逻辑,帮助定位性能问题和组件结构问题。需结合项目现有设计系统和路由方式,避免生成孤立片段影响整体一致性。

安装方式:github,命令为 npx skills add https://github.com/ravnhq/ai-toolkit --skill figma-to-react-components。注意:页面改动后应通过本地预览和构建检查确认视觉效果和兼容性。

来源仓库内路径:skills/figma-to-react-components

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/ravnhq/ai-toolkit --skill figma-to-react-compo…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

figma-to-react-components 怎么安装?

在终端执行 npx skills add https://github.com/ravnhq/ai-toolkit --skill figma-to-react-components。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

figma-to-react-components 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

figma-to-react-components 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

figma-to-react-components 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

figma-to-react-components 用的人多吗?

公开数据是累计安装 524 次,近一周安装 21 次,下载 170 次,GitHub 13 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

figma-to-react-components 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
figma-to-react-components

Figma TO React 组件 · 本页

52413调用外部服务未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Figma to React Component Converter

Convert Figma component designs into production-ready React components with full design token integration, accessibility support via React Aria, and comprehensive documentation. Works with any design token system (SCSS variables, CSS custom properties, Tailwind, or JavaScript tokens).

Prerequisites

  • Figma MCP — Figma MCP server configured and running
  • React Aria — react-aria and react-stately installed
  • Design tokens (optional) — If the project already has a token system (SCSS, CSS vars, Tailwind, JS/TS), map to it. If not, tokens are extracted from Figma and generated as part of the workflow.
  • Storybook (optional) — For component documentation and visual testing

Project Configuration Discovery

On first use in a project, discover the local configuration before generating code. Search the codebase to determine:

  1. Token import path — Where tokens are imported from. Search for existing token files:

- SCSS: @import 'styles/tokens' or @import 'path/to/variables' - CSS: @import 'tokens.css' or custom properties in :root - Tailwind: tailwind.config.ts theme extension - JS/TS: import {tokens} from './tokens' - If no token files exist: Tokens will be extracted from Figma and generated during Phase 2. Ask the user which format to generate (SCSS, CSS custom properties, or Tailwind) and where to save them.

  1. Component output directory — Where components live (e.g., src/components/)
  2. Stories directory — Where Storybook stories live (e.g., stories/ or co-located)
  3. Styling approach — SCSS modules, CSS modules, Tailwind utility classes, styled-components, etc.
  4. Icon/asset strategy — Project icon library location and import convention

Cache these findings for the session. If unsure about any setting, ask the user before generating code.

Workflow

Follow these phases in order:

Phase 1: Extract Figma Design Context

Use Figma MCP tools to gather component information:

Figma:get_design_context(fileKey, nodeId)   # Component structure and tokens
Figma:get_variable_defs(fileKey, nodeId)     # Variable definitions for token mapping
Figma:get_screenshot(fileKey, nodeId)        # Visual reference

What to extract:

  • Component structure and hierarchy
  • Applied variables/tokens (colors, spacing, typography)
  • Variant properties (size, state, hierarchy)
  • Interactive states (hover, pressed, disabled, focus)
  • Text styles and their token mappings
  • Layout constraints and spacing values
  • Icons and image fills

Phase 2: Map Design Tokens

If the project has existing tokens: Cross-reference Figma variables to the project's token system using references/token-mapping-guide.md.

If the project has NO token files: Extract tokens directly from Figma and generate token files. See references/token-mapping-guide.md § "Extracting Tokens from Figma" for the full workflow:

  1. Use get_variable_defs to pull all variable collections from the Figma file
  2. Ask the user for their preferred format (SCSS, CSS custom properties, or Tailwind) and output directory
  3. Generate organized token files (colors, spacing, typography, radius, elevation) using semantic naming conventions
  4. Create an index/barrel file that imports all token partials
  5. Proceed with mapping component values to the newly generated tokens

Token categories to map (or generate):

  • Colors (backgrounds, text, borders, icons)
  • Spacing (padding, margins, gaps)
  • Typography (font family, size, weight, line height)
  • Border radius
  • Elevation/shadows
  • Component sizes (heights, widths, icon sizes)

Important: Use the project's token variable names, never raw values (see rules/tokens-never-hardcode.md).

Phase 3: Generate Props Documentation

Create props documentation following references/props-template.md.

Required sections:

  • Overview (max 200 characters)
  • Component Properties (Props table + React Aria Properties table)
  • Size Variants (using typography token names)
  • Hierarchy Variants
  • State Variants (default, hover, pressed, disabled, focus)
  • Icons (token references for icon sizes)
  • Typography (token names from Figma descriptions)
  • Accessibility (Focus State, Keyboard Navigation, Disabled State, Color Contrast)
  • Usage Guidelines

Prop naming: Follow conventions in references/figma-property-conventions.md.

Phase 4: Generate React Component Code

Create the component following references/component-patterns.md.

Requirements:

  • React Aria hooks for accessibility (see rules/aria-use-react-aria-hooks.md)
  • TypeScript with explicit prop interfaces
  • BEM naming convention for CSS classes (see rules/naming-bem-methodology.md)
  • Proper disabled state handling
  • Focus management with :focus-visible (see rules/aria-focus-visible-only.md)
  • Build props from actual Figma MCP extraction, not assumptions

Phase 5: Generate Styles

Create the stylesheet using the project's token system.

Structure:

  • Import tokens from the discovered project path
  • Base styles using token references
  • State modifiers (:hover, :active, :disabled, :focus-visible)
  • Size variant modifiers
  • Hierarchy/variant modifiers
  • Use semantic token names (see rules/tokens-use-semantic-names.md)

Phase 6: Create Storybook Story

Generate Storybook documentation showing all variants:

  • Default story with primary args
  • Size variants side by side
  • Hierarchy/visual variants
  • State demonstrations (default, disabled)
  • Include React Aria prop controls (aria-label, aria-labelledby, aria-describedby)

Phase 7: Testing & Validation

After implementation, validate:

  • Visual comparison with Figma design (within 2px tolerance)
  • All variants render correctly
  • Interactive states (hover, focus, pressed, disabled) work as expected
  • Keyboard navigation functions properly
  • No hardcoded values remain — all visual properties use tokens

Phase 8: Cleanup Junk Files

The Figma MCP sometimes generates temporary files during extraction:

  • Remove root-level SVG files generated by Figma MCP
  • Remove temporary images not in project asset directories
  • Verify no orphaned files from the MCP extraction process

Output Structure

Deliver all artifacts in this order:

  1. Props Documentation ([ComponentName]-props.md)

- All tokens referenced by variable name - Complete accessibility documentation

  1. React Component ([ComponentName].tsx)

- TypeScript with full type safety - React Aria integration - No inline SVG code — use project's icon library

  1. Styles ([ComponentName].[scss|module.scss|css])

- Token-based styling - BEM methodology - All state variants

  1. Storybook Story ([ComponentName].stories.tsx)

- Interactive examples with React Aria props - All variants demonstrated

Rules

See rules index for token, accessibility, and naming rules.

Examples

Positive Trigger

User: "Convert this Figma button component to React with all its variants and states."

Expected behavior: Use figma-to-react-components guidance — extract Figma context via MCP, map tokens, generate typed React component with React Aria, create styles using project tokens, and produce Storybook story.

Non-Trigger

User: "Write unit tests for this payment service."

Expected behavior: Do not prioritize figma-to-react-components; choose a more relevant skill or proceed without it.

Troubleshooting

Figma Tokens Not Found

  • Error: Figma variables do not map to any project tokens.
  • Cause: Token variable names in Figma differ from project token names, token files are in an unexpected location, or the project has no token files yet.
  • Solution: First search the codebase for token files. If found, map Figma variable names to project token names using references/token-mapping-guide.md. If no token files exist, extract tokens from Figma using get_variable_defs and generate token files — see references/token-mapping-guide.md § "Extracting Tokens from Figma".

React Aria Hook Selection Unclear

  • Error: Unsure which React Aria hook to use for a given component.
  • Cause: Component type does not match a standard pattern (Button, TextField, Select, etc.).
  • Solution: Check the React Aria hooks table in rules/aria-use-react-aria-hooks.md. For complex components, compose multiple hooks or use useFocusRing as a baseline.

Generated Styles Use Raw Values

  • Error: Component styles contain hardcoded pixel values or hex colors instead of tokens.
  • Cause: Token mapping was skipped or incomplete during Phase 2.
  • Solution: Re-run token mapping against the project's token system. Replace every raw value with its token reference. If no token exists, flag it as a gap with a /* TODO */ comment.

Component Props Do Not Match Figma

  • Error: Generated React props do not align with Figma component properties.
  • Cause: Props were assumed instead of extracted from Figma MCP.
  • Solution: Re-extract using get_design_context and rebuild props from actual Figma component definitions. Follow naming conventions in references/figma-property-conventions.md.

Workflow

  1. Identify whether the request matches a Figma-to-React conversion task.
  2. Follow the 8-phase workflow: extract design context, map tokens, generate props docs, build component, create styles, write story, validate, clean up.
  3. Verify all output uses project tokens (no hardcoded values) and includes React Aria accessibility.

平台分布

Codex

37.5%
按下载量换算64

Claude

29.46%
按下载量换算50

Cursor

20.93%
按下载量换算36

Gemini CLI

8.93%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills