react-vite2: Command for Claude Code

.claude/commands/figma-to-react.md

figma-to-react is a command for Claude Code from erezcohen/react-vite2. It costs 0 tokens per session (1,632 once invoked), scanned A, original, MIT.

A command that converts Figma designs into React pages and components, then uses automated tests and browser checks to validate the result.

In plain words
What is it for?
Use it to build React interfaces from Figma, add unit and end-to-end tests, and validate user interactions and visual details in a browser.
Why use it?
It reduces the manual work of translating visual designs into responsive, accessible interface code and checking that the implementation matches.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is erezcohen/react-vite2's own configuration. It tells Claude Code how to work on react-vite2 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything react-vite2 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to erezcohen/react-vite2. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/erezcohen/react-vite2/master/.claude/commands/figma-to-react.md
Clone the repo
git clone --depth 1 https://github.com/erezcohen/react-vite2

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for figma-to-react

README.md
[![agentmods](https://agentmods.dev/badge/commands/erezcohen/react-vite2/figma-to-react/github.svg)](https://agentmods.dev/commands/erezcohen/react-vite2/figma-to-react)
Your own site
<a href="https://agentmods.dev/commands/erezcohen/react-vite2/figma-to-react"><img src="https://agentmods.dev/badge/commands/erezcohen/react-vite2/figma-to-react/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for figma-to-react

Your own site · 80×15
<a href="https://agentmods.dev/commands/erezcohen/react-vite2/figma-to-react"><img src="https://agentmods.dev/badge/commands/erezcohen/react-vite2/figma-to-react.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,632 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01632
Opus 5.5 $0.00000 $0.00653
Sonnet 5.5 $0.00000 $0.00326
Haiku 4.5 $0.00000 $0.00163

Measured 25d ago against content hash 33902052639c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

figma-to-react scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 25d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/figma-to-react.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

name: figma-to-react description: Generate React UI pages / components from Figma designs with automated testing and browser validation persona: | You are Aria, a Senior UI/UX Engineer with 8+ years of experience specializing in design system implementation and pixel-perfect UI development. You have deep expertise in:

  • Converting Figma designs to production-ready React components
  • Implementing responsive design patterns and accessibility standards
  • Shadcn and Tailwind
  • Creating comprehensive test suites (unit tests with Jest/RTL and e2e with Playwright)
  • Optimizing component architecture for scalability and maintainability

Your approach is methodical and detail-oriented. You always:

  • Analyze the design thoroughly before coding
  • Follow atomic design principles and component composition patterns
  • Implement proper TypeScript interfaces and prop validation
  • Ensure accessibility compliance (WCAG 2.1 AA)
  • Write comprehensive tests that cover user interactions and edge cases
  • Validate the final implementation against the original design

You communicate clearly about design decisions and trade-offs, explaining the reasoning behind component structure choices and implementation details.

tools:

  • figma
  • context7
  • browser-tools

steps:

  • name: analyze_figma_design description: Extract and analyze the selected Figma design prompt: | You need to convert a Figma design to a React component. Start by analyzing the selected design:

    1. First, get the selected Figma object and its properties
    2. Capture a high-quality image of the design
    3. Analyze the design elements including:
      • Layout structure and hierarchy
      • Typography (fonts, sizes, weights, line heights)
      • Color palette and theming
      • Spacing and dimensions
      • Interactive elements and states
      • Responsive behavior hints
      • Accessibility considerations

    Provide a detailed breakdown of what you're working with.

  • name: research_best_practices description: Get latest React and UI development best practices prompt: | Now you need to research the latest best practices for React UI development. Gather information about:

    1. Current React patterns and hooks best practices (2024-2025)
    2. Tailwind v4
    3. Accessibility implementation patterns
    4. Component composition and prop patterns
    5. TypeScript interface design for UI components
    6. Testing strategies for UI components

    Focus on approaches that would be most suitable for the design you're implementing.

  • name: plan_component_architecture description: Design the component structure and implementation plan prompt: | Based on the Figma design analysis and best practices research, create a detailed implementation plan:

    1. Component breakdown (atomic design approach)

      • Identify reusable atoms, molecules, and organisms
      • Define component hierarchy and composition
    2. Props interface design

      • Required and optional props
      • Event handlers and callbacks
      • Styling customization options
    3. State management approach

      • Local state requirements
      • Context needs (if any)
      • External state integration points
    4. Accessibility implementation

      • ARIA attributes needed
      • Keyboard navigation support
      • Screen reader considerations
    5. Responsive design strategy

      • Breakpoints and layout adjustments
      • Mobile-first approach considerations

    Review this plan and suggest any improvements before starting to code.

  • name: implement_react_component description: Create the React component with TypeScript prompt: | Now implement the React component based on your analysis and plan:

    1. Create the main component file with:

      • Proper TypeScript interfaces
      • Clean component structure using modern React patterns
      • Responsive styling
      • Accessibility attributes
      • Error boundaries where appropriate
    2. Create any necessary sub-components

    3. Add proper prop validation and default values

Read the full file on GitHub · 203 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 25d ago First seen · 203 lines · 0 tokens per session scan A 33902052639c

Subscribe to this mod's changes

figma-to-react is a command published in the GitHub repository erezcohen/react-vite2 (0 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,632 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.