Skip to content

figma

Pi extension for Figma REST API tools, compact design context, and Jira-linked Figma summaries.

Use this package when implementation work starts from Figma files, frames, FigJam boards, or Jira tickets that contain Figma design links.

Installation

bash
pi install npm:@pi-stef/figma

Setup And Auth

Create the config file:

bash
mkdir -p ~/.pi/sf/figma
cat > ~/.pi/sf/figma/config.json <<'JSON'
{
  "apiToken": "MY_TOKEN"
}
JSON
chmod 600 ~/.pi/sf/figma/config.json

Check token discovery:

text
figma_auth_status
figma_auth_status fileKey="abc123"

Natural Language Usage

text
pi "Summarize this Figma flow before implementing: https://www.figma.com/file/..."
pi "Inspect the checkout screen and extract implementation hints."

REST Tool Surface

ToolPurpose
figma_contextOverview/screen context with hierarchy and styles
figma_get_design_contextPage/frame context with nearby nodes
figma_get_node_summaryLayout, dimensions, styles, text, components
figma_get_implementation_contextDesign-to-code hints for layout, color, typography, spacing
figma_extract_textVisible text nodes with paths
figma_find_nodes_by_nameSearch node names
figma_find_nodes_by_textSearch visible text content
figma_render_nodesImage render URLs
figma_extract_assetsAsset manifest for renderable nodes
figma_get_stylesFile styles
figma_get_variablesVariables and collections
figma_get_componentsFile components

Figma Context Workflow

  • mode="overview" — for pages, canvases, multi-screen flows
  • mode="screen" — for focused frames or screens

Recommended flow:

  1. Start with mode="overview" for broad links
  2. Pick relevant screen node IDs
  3. Re-run with mode="screen" for implementation details

Atlassian Integration

When ~/.pi/sf/atlassian/config.json is configured, Jira context automatically includes linked Figma context. See atlassian for setup.

Scopes And Permissions

CapabilityTypical scope
Files, nodes, text, design contextfile_content:read
Commentsfile_comments:read
Components, styles, librarieslibrary_assets:read and library_content:read

Troubleshooting

SymptomAction
Figma API token not foundCreate config file with { "apiToken": "MY_TOKEN" }
401 or 403Check token validity, scopes, and file access
429Wait or narrow request with node IDs and lower depth