skills/frontend/figma-to-react-components/SKILL.md
Convert Figma component designs into production-ready React implementations with design token integration, accessibility via React Aria, and comprehensive documentation. Use when building React components from Figma designs, generating component implementation specs, or bridging design-to-development workflows.
npx skillsauth add ravnhq/ai-toolkit figma-to-react-componentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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).
react-aria and react-stately installedOn first use in a project, discover the local configuration before generating code. Search the codebase to determine:
Token import path — Where tokens are imported from. Search for existing token files:
@import 'styles/tokens' or @import 'path/to/variables'@import 'tokens.css' or custom properties in :roottailwind.config.ts theme extensionimport { tokens } from './tokens'Component output directory — Where components live (e.g., src/components/)
Stories directory — Where Storybook stories live (e.g., stories/ or co-located)
Styling approach — SCSS modules, CSS modules, Tailwind utility classes, styled-components, etc.
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.
Follow these phases in order:
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:
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:
get_variable_defs to pull all variable collections from the Figma fileToken categories to map (or generate):
Important: Use the project's token variable names, never raw values (see rules/tokens-never-hardcode.md).
Create props documentation following references/props-template.md.
Required sections:
Prop naming: Follow conventions in references/figma-property-conventions.md.
Create the component following references/component-patterns.md.
Requirements:
rules/aria-use-react-aria-hooks.md)rules/naming-bem-methodology.md):focus-visible (see rules/aria-focus-visible-only.md)Create the stylesheet using the project's token system.
Structure:
:hover, :active, :disabled, :focus-visible)rules/tokens-use-semantic-names.md)Generate Storybook documentation showing all variants:
aria-label, aria-labelledby, aria-describedby)After implementation, validate:
The Figma MCP sometimes generates temporary files during extraction:
Deliver all artifacts in this order:
Props Documentation ([ComponentName]-props.md)
React Component ([ComponentName].tsx)
Styles ([ComponentName].[scss|module.scss|css])
Storybook Story ([ComponentName].stories.tsx)
See rules index for token, accessibility, and naming rules.
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.
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.
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".rules/aria-use-react-aria-hooks.md. For complex components, compose multiple hooks or use useFocusRing as a baseline./* TODO */ comment.get_design_context and rebuild props from actual Figma component definitions. Follow naming conventions in references/figma-property-conventions.md.testing
Transform user requests into detailed, precise prompts for AI models. Use when users say 'promptify', 'promptify this', 'rewrite this prompt', 'make this prompt better/more specific', or explicitly request prompt engineering or improvement of their request for better AI responses.
tools
Manage AI skills from the Ravn AI Toolkit via corvus CLI — install, update, remove, search, and configure skills for any project. Use when: (1) Installing AI skills into a project, (2) Updating installed skills to latest versions, (3) Browsing or searching available skills, (4) Configuring global or per-project skill sets, (5) Troubleshooting corvus setup. Triggers on: "install skills", "add skills", "update skills", "corvus", "skill manager", "browse skills", "set up AI rules".
development
Generate a gallery of design variations for a UI component. Takes an existing component (referenced by name, pasted code, or screenshot) and produces N distinct rendered alternatives in a single comparison page. Use when exploring visual directions, generating mockups, comparing design approaches for a component, creating A/B candidates, or when anyone says "show me options" or "give me variations" for a UI element.
tools
Create custom QA agent personalities for project-specific testing needs. Guided builder that asks about the specialty, tools, and test scenarios, then generates a personality file and registers it in the QA config. Trigger on "create a QA personality", "add a custom test agent", "build a webhook tester", or when the user needs a project-specific QA agent. Also triggered by /qa-create-personality.