FI

Control Figma programmatically to create frames, shapes, and components or render designs using a CLI-based workflow.

Install

mkdir -p .claude/skills/figma-use && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2471" && unzip -o skill.zip -d .claude/skills/figma-use && rm skill.zip

Installs to .claude/skills/figma-use

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Control Figma via CLI — create shapes, frames, text, components, set styles, layout, variables, export images. Use when asked to create/modify Figma designs or automate design tasks.
182 chars✓ has a “when” trigger
Advanced

Key capabilities

  • Create shapes, frames, text, and components in Figma via CLI
  • Set styles, layout properties, and variables for Figma nodes
  • Render JSX trees directly into Figma
  • Export Figma nodes as JSX code or Storybook stories
  • Create icons from Iconify by name
  • Watch for and react to Figma comments

How it works

The skill connects to Figma via remote debugging and executes commands or renders JSX to manipulate design elements, styles, and layouts.

Inputs & outputs

You give it
CLI commands or JSX code specifying Figma design operations
You get back
Modified Figma design, exported JSX/Storybook code, or image assets

When to use figma-use

  • Automating component creation in Figma
  • Rendering UI prototypes from JSX
  • Programmatically updating design styles
  • Exporting design assets via CLI

About this skill

figma-use

CLI for Figma. Two modes: commands and JSX.

# Commands
figma-use create frame --width 400 --height 300 --fill "#FFF" --layout VERTICAL --gap 16
figma-use create icon mdi:home --size 32 --color "#3B82F6"
figma-use set fill 1:23 "$Colors/Primary"

# JSX (props directly on elements, NOT style={{}})
echo '<Frame p={24} bg="#3B82F6" rounded={12}>
  <Text size={18} color="#FFF">Hello</Text>
</Frame>' | figma-use render --stdin --x 100 --y 100

Before You Start

figma-use status  # Check connection

If not connected — start Figma with remote debugging:

# macOS
open -a Figma --args --remote-debugging-port=9222

# Windows
"%LOCALAPPDATA%\Figma\Figma.exe" --remote-debugging-port=9222

# Linux
figma --remote-debugging-port=9222

Figma 126+ blocks remote debugging. Run figma-use patch once to fix, then restart Figma. Click Always Allow on the keychain prompt. Re-run after Figma updates.

Can't patch? Use figma-use daemon start --pipe — launches Figma with debug pipe, no patching needed.

Start Figma with --remote-debugging-port=9222 and you're ready.

Non-default port? If Figma is on another port, pass --port <N> to any command (or set the FIGMA_PORT env var). Errors will show the correct port.

open -a Figma --args --remote-debugging-port=9333
figma-use get components --port 9333

Two Modes

Imperative — single operations:

figma-use create frame --width 400 --height 300 --fill "#FFF" --radius 12
figma-use set fill <id> "#FF0000"
figma-use node move <id> --x 100 --y 200

Declarative — render JSX trees:

echo '<Frame p={24} gap={16} flex="col" bg="#FFF" rounded={12}>
  <Text size={24} weight="bold" color="#000">Title</Text>
  <Text size={14} color="#666">Description</Text>
</Frame>' | figma-use render --stdin --x 100 --y 200

stdin supports both pure JSX and full module syntax with imports:

import { Frame, Text, defineComponent } from 'figma-use/render'

const Button = defineComponent(
  'Button',
  <Frame bg="#3B82F6" p={12} rounded={6}>
    <Text color="#FFF">Click</Text>
  </Frame>
)

export default () => (
  <Frame flex="row" gap={8}>
    <Button />
    <Button />
  </Frame>
)

Elements: Frame, Rectangle, Ellipse, Text, Line, Star, Polygon, Vector, Group, Icon, Image, Instance

Use <Instance> to create component instances:

<Frame flex="row" gap={8}>
  <Instance component="59763:10626" />
  <Instance component="59763:10629" />
</Frame>

⚠️ Always use --x and --y to position renders. Don't stack everything at (0, 0).

Icons

150k+ icons from Iconify by name:

figma-use create icon mdi:home
figma-use create icon lucide:star --size 48 --color "#F59E0B"
figma-use create icon heroicons:bell-solid --component  # as Figma component

In JSX:

<Icon name="mdi:home" size={24} color="#3B82F6" />

Images

Load images from URL:

<Image src="https://example.com/photo.jpg" w={200} h={150} />

Export JSX

Convert Figma nodes back to JSX code:

figma-use export jsx <id>           # Minified
figma-use export jsx <id> --pretty  # Formatted

# Format options
figma-use export jsx <id> --pretty --semi --tabs

# Match vector shapes to Iconify icons (requires: npm i whaticon)
figma-use export jsx <id> --match-icons
figma-use export jsx <id> --match-icons --icon-threshold 0.85 --prefer-icons lucide,tabler

Round-trip workflow:

# Export → edit → re-render
figma-use export jsx <id> --pretty > component.tsx
# ... edit the file ...
figma-use render component.tsx --x 500 --y 0

Compare two nodes as JSX:

figma-use diff jsx <from-id> <to-id>

Export Storybook (Experimental)

Export all components on current page as Storybook stories:

figma-use export storybook                      # Output to ./stories/
figma-use export storybook --out ./src/stories  # Custom output dir
figma-use export storybook --match-icons        # Match vectors to Iconify icons
figma-use export storybook --no-semantic-html   # Disable semantic HTML conversion

Semantic HTML: By default, components are converted to semantic HTML elements based on their names:

  • Input/*, TextField/*<input type="text">
  • Textarea/*<textarea>
  • Checkbox/*<input type="checkbox">
  • Radio/*<input type="radio">
  • Button/*<button>
  • Select/*, Dropdown/*<select>

Use --no-semantic-html to disable this and keep <Frame> elements.

Generates .stories.tsx files:

  • ComponentSets → React component with props + stories with args
  • VARIANT properties → Union type props (variant?: 'Primary' | 'Secondary')
  • TEXT properties → Editable string props (label?: string)
  • Components grouped by / prefix → Button/Primary, Button/SecondaryButton.stories.tsx

Example output for Button with variant and label:

// Button.tsx
export interface ButtonProps {
  label?: string
  variant?: 'Primary' | 'Secondary'
}
export function Button({ label, variant }: ButtonProps) {
  if (variant === 'Primary')
    return (
      <Frame>
        <Text>{label}</Text>
      </Frame>
    )
  // ...
}

// Button.stories.tsx
export const Primary: StoryObj<typeof Button> = {
  args: { label: 'Click', variant: 'Primary' }
}

Variables as Tokens

Reference Figma variables in any color option with var:Name or $Name:

figma-use create rect --width 100 --height 100 --fill 'var:Colors/Primary'
figma-use set fill <id> '$Brand/Accent'

In JSX:

<Frame bg="$Colors/Primary" />
<Text color="var:Text/Primary">Hello</Text>

Style Shorthands

Size & Position:

ShortFullValues
w, hwidth, heightnumber or "fill"
minW, maxWminWidth, maxWidthnumber
minH, maxHminHeight, maxHeightnumber
x, ypositionnumber

Layout:

ShortFullValues
flexflexDirection"row", "col"
gapspacingnumber
wraplayoutWraptrue
justifyjustifyContent"start", "center", "end", "between"
itemsalignItems"start", "center", "end"
p, px, pypaddingnumber
pt, pr, pb, plpadding sidesnumber
positionlayoutPositioning"absolute"
growlayoutGrownumber
stretchlayoutAligntrue → STRETCH

Appearance:

ShortFullValues
bgfillhex or $Variable
strokestrokeColorhex
strokeWidthstrokeWeightnumber
strokeAlignstrokeAlign"inside", "outside"
opacityopacity0..1
blendModeblendMode"multiply", etc.

Corners:

ShortFullValues
roundedcornerRadiusnumber
roundedTL/TR/BL/BRindividual cornersnumber
cornerSmoothingsquircle smoothing0..1 (iOS style)

Effects:

ShortFullValues
shadowdropShadow"0px 4px 8px rgba(0,0,0,0.25)"
blurlayerBlurnumber
overflowclipsContent"hidden"
rotaterotationdegrees

Text:

ShortFullValues
sizefontSizenumber
weightfontWeight"bold", number
fontfontFamilystring
colortextColorhex

Grid (CSS Grid layout):

ShortFullValues
displaylayoutMode"grid"
colsgridTemplateColumns"100px 1fr auto"
rowsgridTemplateRows"auto auto"
colGapcolumnGapnumber
rowGaprowGapnumber

Components (via .figma.tsx)

First call creates master, rest create instances:

import { defineComponent, Frame, Text } from 'figma-use/render'

const Card = defineComponent(
  'Card',
  <Frame p={24} bg="#FFF" rounded={12}>
    <Text size={18} color="#000">
      Card
    </Text>
  </Frame>
)

export default () => (
  <Frame gap={16} flex="row">
    <Card />
    <Card />
  </Frame>
)
figma-use render ./Card.figma.tsx --x 100 --y 200
figma-use render --examples  # Full API reference

Variants (ComponentSet)

import { defineComponentSet, Frame, Text } from 'figma-use/render'

const Button = defineComponentSet(
  'Button',
  {
    variant: ['Primary', 'Secondary'] as const,
    size: ['Small', 'Large'] as const
  },
  ({ variant, size }) => (
    <Frame
      p={size === 'Large' ? 16 : 8}
      bg={variant === 'Primary' ? '#3B82F6' : '#E5E7EB'}
      rounded={8}
    >
      <Text color={variant === 'Primary' ? '#FFF' : '#111'}>
        {variant} {size}
      </Text>
    </Frame>
  )
)

Creates real ComponentSet with all combinations.

Diffs

Compare frames and generate patch:

figma-use diff create --from <id1> --to <id2>
--- /Card/Header #123:457
+++ /Card/Header #789:013
 type: FRAME
 size: 200 50
-fill: #FFFFFF
+fill: #F0F0F0

⚠️ Context lines need space prefix: size: 200 50 not size: 200 50

Apply with validation:

figma-use diff apply patch.diff            # Fails if old values don't match
figma-use diff apply patch.diff --dry-run  # Preview
figma-use diff apply patch.diff --force    # Skip validation

Visual diff (red = changed pixels):

figma-use diff visual --from <id1> --to <id2> --output diff.png

⚠️ After initial render, use diffs or direct commands. Don't re-render full JSX trees.

Query (XPath)

Find nodes using XPath selectors:

figma-use query "//FRAME"                              # All frames
figma-use query "//FRAME[@width < 300]"                # Frames narrower than 300px
figma-use query "//COMPONENT[starts-with(@name, 'Button')]"  # Name starts with
figma-use query "//FRAME[contains(@name, 'Card')]"     # Name contains
figma-use query "//SECTION/FRAME"                  

---

*Content truncated.*

Prerequisites

Figma running with remote debugging enabledfigma-use patch applied if Figma version 126+

Limitations

  • Deleting a section deletes all its children.
  • Row layout needs explicit width.
  • Figma 126+ blocks remote debugging without a patch.

How it compares

This skill enables programmatic control of Figma through CLI commands and JSX, offering an automated and code-driven approach to design compared to manual interaction within the Figma UI.

Compared to similar skills

figma-use side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
figma-use (this skill)93moReviewAdvanced
penpot-uiux-design276moReviewAdvanced
elegant-design215moReviewIntermediate
visual-design-foundations55moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

penpot-uiux-design

github

Comprehensive guide for creating professional UI/UX designs in Penpot using MCP tools. Use this skill when: (1) Creating new UI/UX designs for web, mobile, or desktop applications, (2) Building design systems with components and tokens, (3) Designing dashboards, forms, navigation, or landing pages, (4) Applying accessibility standards and best practices, (5) Following platform guidelines (iOS, Android, Material Design), (6) Reviewing or improving existing Penpot designs for usability. Triggers: "design a UI", "create interface", "build layout", "design dashboard", "create form", "design landing page", "make it accessible", "design system", "component library".

27145

elegant-design

rand

Create world-class, accessible, responsive interfaces with sophisticated interactive elements including chat, terminals, code display, and streaming content. Use when building user interfaces that need professional polish and developer-focused features.

21108

visual-design-foundations

wshobson

Apply typography, color theory, spacing systems, and iconography principles to create cohesive visual designs. Use when establishing design tokens, building style guides, or improving visual hierarchy and consistency.

547

frontend-design-pro

claudekit

Creates jaw-dropping, production-ready frontend interfaces AND delivers perfectly matched real photos (Unsplash/Pexels direct links) OR flawless custom image-generation prompts for hero images, backgrounds, and illustrations. Zero AI slop, zero fake URLs.

1011

design-context

WellApp-ai

Refresh UI/UX context from design system, Storybook, and codebase

17

vibefigma

vibeflowing-inc

Convert Figma designs to production-ready React components with Tailwind CSS. Use when user provides a Figma URL, asks to convert Figma designs to React/code, wants to extract components from Figma, or mentions "vibefigma". Requires a Figma access token (via --token flag, FIGMA_TOKEN env var, or .env file).

01

Search skills

Search the agent skills registry