Figma Agent
v0.1.2Unified Figma skill for OpenClaw. Reads design context directly via Figma's Remote MCP and routes write/edit/create operations through ACP coding sessions (C...
Like a lobster shell, security has layers — review code before you run it.
License
Runtime requirements
SKILL.md
Figma Agent
A unified Figma skill with a hybrid architecture:
- Read / Inspect operations use the direct Figma MCP path.
- Write / Edit / Create operations go through an ACP coding session (Claude Code, Codex, or another ACP-supported agent with Figma MCP connected).
- To the user, this feels like one skill, not two separate systems.
Prerequisites
- Figma account (Full Seat required for write access)
- One-time Figma MCP connection via a supported client:
- Claude Code:
claude plugin install figmaor connect via MCP settings - Codex, Cursor, VS Code, Windsurf: add Figma in MCP settings
- Claude Code:
- Token bootstrap:
node scripts/bootstrap-token.mjs— automatically extracts the token and writes it to OpenClaw config - Gateway restart:
openclaw gateway restart
This external-client requirement is temporary. Once Figma opens Dynamic Client Registration for custom clients, direct auth will replace this step.
When to use this skill
Use this skill when the user wants to:
- inspect a Figma screen, frame, or file
- retrieve screenshots or design context
- understand variables, structure, metadata, or design-system elements
- request targeted edits to an existing screen
- create a new screen or variant in Figma
- run a simple review loop: inspect → edit → inspect again
Do not use this skill for:
- generic design discussions without Figma context
- heavy multi-step autonomous workflow orchestration
- non-Figma browser automation
Product behavior
The skill behaves like one product with internal routing.
Transparency rule
- Read operations: stay quiet about internal routing unless it matters.
- Write / edit / create operations: explicitly tell the user when switching to the heavier ACP execution path.
Examples:
- Read: "The screen uses a 12-column grid with 16px gutters…"
- Write: "I'll push this change through an ACP coding session now and bring back the result."
Capability groups
1. Inspect / Read (direct path)
Typical requests:
- "Analyze this screen"
- "Get me the screenshot"
- "What are the key components here?"
- "Which variables / tokens are used?"
Available tools (via scripts/figma-mcp.mjs):
get_design_context— full design context for a nodeget_screenshot— PNG screenshot of a nodeget_metadata— structural metadata and node treeget_variable_defs— design token / variable definitionssearch_design_system— search across design systemget_figjam— FigJam board contentget_code_connect_map— Code Connect mappingsget_code_connect_suggestions— Code Connect suggestionsget_context_for_code_connect— context for Code Connect setupwhoami— verify auth and account info
2. Write / Edit / Create (ACP path)
Typical requests:
- "Change this layout"
- "Create a new variant"
- "Add a new screen"
- "Rewrite this in Figma"
For these, use an ACP coding agent (e.g. Claude Code or Codex). The ACP session has access to:
use_figma— general-purpose Plugin API executioncreate_new_file— create blank Figma filegenerate_figma_design— code-to-canvas generationgenerate_diagram— Mermaid to FigJamadd_code_connect_map— add Code Connect mappingssend_code_connect_mappings— publish Code Connectcreate_design_system_rules— define design system rules
Routing rules
Namespace note
figma__*= OpenClaw-side direct tools (if/when native MCP materializes)mcp__figma__*= Figma MCP tools inside ACP coding sessionsscripts/figma-mcp.mjs= zero-dependency wrapper for direct calls
The user does not need to know about this distinction.
Default heuristic
Route to direct read when the request is about: seeing, understanding, comparing, extracting, summarizing, inspecting, reviewing existing design state.
Route to ACP when the request is about: changing, editing, creating, generating, restructuring, writing to canvas, producing new design state.
Mixed requests
- Inspect first (direct path)
- Summarize relevant context
- Switch to ACP for the mutation
- Return the result
Write path flow
- Determine that mutation is required
- Gather relevant Figma context directly first
- Hand mutation task to the ACP coding agent
- Let CC execute the Figma change
- Return result to the conversation
Review loop
A simple review loop is in scope:
- Inspect current state
- Perform targeted change
- Show / summarize result
- Accept one more correction or refinement
Avoid over-complicated automation. Prefer clear step-by-step execution.
Write safety: checkpoint before every write
Before any write operation (use_figma, create_new_file, generate_figma_design),
always save a version-history checkpoint first:
// Use writeWithCheckpoint() instead of call('use_figma', ...)
await client.writeWithCheckpoint(fileKey, 'Short label', 'Description', code);
This saves a named entry in Figma's Version History (File → Version History) so the user can always restore the state before the edit.
Rule: reads never need a checkpoint. Writes always do.
Failure handling
Auth failure
If a direct Figma read fails due to invalid or expired auth:
- Stop the attempt
- Tell the user clearly that Figma auth needs renewal
- Point to:
node scripts/bootstrap-token.mjs --refresh - Do not silently reroute as if it were a different problem
Rate limits
If reads are rate-limited, say so clearly. Do not pretend direct reads are always cheap or always available.
Token management
Bootstrap
node scripts/bootstrap-token.mjs # scan + write
node scripts/bootstrap-token.mjs --dry-run # preview only
node scripts/bootstrap-token.mjs --refresh # refresh expired token
Supported token sources (in priority order):
- Claude Code (
~/.claude/.credentials.json) - Codex (
~/.codex/auth.json) - Windsurf (
~/.codeium/windsurf/mcp_config.json)
Token location
The token is written to openclaw.json under mcp.servers.figma.headers.Authorization.
What works via Remote MCP (official)
All capabilities below are confirmed via Figma's official documentation.
Read / Inspect ✅
get_design_context— design structure, layout, component infoget_screenshot— PNG screenshot of any frame or nodeget_metadata— full layer tree with node IDs, positions, dimensionsget_variable_defs— local variables/tokens (requires valid nodeId)search_design_system— community and linked library components/stylesget_code_connect_map/get_code_connect_suggestions— Code Connect mappingsget_figjam— FigJam diagram contentwhoami— current user identity
Write / Create ✅ (Full Seat required)
use_figma— executes JavaScript via Figma Plugin API: create/modify frames, components, variables, auto layout, fills, strokes, textcreate_new_file— creates a blank Figma file in Draftsgenerate_figma_design— captures live HTML/CSS from a browser URL and imports it as editable Figma layers (HTML-to-canvas)generate_diagram— converts Mermaid diagrams to FigJamadd_code_connect_map/send_code_connect_mappings— Code Connectcreate_design_system_rules— design system agent instructions
Known limitations (official, as of April 2026)
Source: Figma Write to Canvas docs
- 20 KB output limit per
use_figmacall — large write operations must be split into multiple calls - No image/asset import — cannot embed raster images or external assets via MCP
- No custom font loading — only fonts already installed in the Figma file/org are available
- Beta quality — write to canvas is actively being improved; some edge cases may fail silently
- Dev Seat = read-only —
use_figma(write) requires a Full Seat saveVersionHistoryAsyncnot available in Remote MCP sandbox — manual version history via Figma UI onlyfigma.variables.getVariableById()not available in Remote MCP sandbox — use variable IDs retrieved viaget_variable_defsand bind viasetBoundVariableForPaint- SVG/vector assets cannot be created programmatically via Plugin API in this context — clone existing vector nodes from the file instead
generate_figma_design(HTML capture) requires the Figma capture script to run in the browser; external<script src>tags are not executed in headless browsers — use inline script embedding as a workaround- Write to canvas is only available with select approved MCP clients (Claude Code, Cursor, VS Code, Codex, Copilot CLI, etc.) — not with arbitrary custom clients
Constraints
- Do not assume custom-client OAuth/DCR for Figma Remote MCP is stable.
- Do not over-promise fully native OpenClaw-only write support.
- Keep the architecture future-compatible with a more native path later.
- Prefer usefulness over purity.
Files
9 totalComments
Loading comments…
