/install figma-agent
Figma Agent
Figma Remote MCP integration for OpenClaw. Reads designs via figma__* tools; creates and edits via CC sessions using mcp__figma__* tools.
Route First
Read/Inspect → call figma__* tools directly. No CC session needed.
Write/Create/Edit → requires CC session via mcp__figma__* tools.
Seeing or understanding a design? → Direct. Do not start a session.
Changing or creating something? → Start a CC session. Follow the matching playbook below.
Execution model:
- Route & Brief — choose the workflow, identify the real risks, and write a lean execution brief
- Execute — perform the direct read or CC-based write flow
- Done Gate — do not report success until the applicable structural and visual validation checks pass
Workflow Routing
First: Determine the user's intent, then follow the matching path.
This is an abridged routing summary. For the full matrix and decision logic, see references/workflow-selection.md.
→ Full routing matrix: references/workflow-selection.md
| Intent | Path | Route |
|---|---|---|
| Build a production screen | Native Screen Generation | CC |
| Create next step / state variant from an existing screen | Native Screen Generation | CC |
| Prototype from HTML/URL | HTML-to-Figma Prototyping | CC |
| Read-only inspection | get_design_context / get_screenshot |
Direct |
| Review + Edit a screen | Screen Review Loop | CC |
| Apply design tokens | Color Tokenization | CC |
| Import + clean up Stitch export | Stitch Import Cleanup | CC |
| Discover variables/styles | Variable Discovery | Direct |
| Audit design system | Design System Cleanup | CC |
| Inspect finished design | Design Audit Review | Direct |
Image Delivery (MANDATORY after every write)
Screenshots must reach the user as Telegram photo attachments — not as inline base64 text.
Workflow:
-
Save to file — use
--out \x3Cpath>flag so the PNG is written directly:node scripts/figma-mcp-cli.mjs get_screenshot \ fileKey=\x3CfileKey> nodeId=\x3CnodeId> scale=2 \ --out ~/workspace-dev-botti/screenshots/\x3Cname>.png -
Deliver to user — put
MEDIA:\x3Cpath>on its own line in your reply:Hier ist der aktuelle Stand: MEDIA:screenshots/validate.pngOpenClaw extracts every
MEDIA:line and sends the file as a native Telegram photo. The path is workspace-relative (screenshots/...) or absolute.
Two different tools — don't mix them up:
| Tool | Purpose | Used for Image Delivery? |
|---|---|---|
image tool |
Send to Vision model for analysis | ❌ No — analysis only |
MEDIA:\x3Cpath> in reply text |
Send as Telegram attachment | ✅ Yes — actual delivery |
Why --out?
Without it, the Figma API returns base64-encoded JSON → renders as inline text in Telegram, not a photo. The --out flag decodes and writes a real PNG file that MEDIA: sends as an attachment.
Screenshot directory: ~/workspace-dev-botti/screenshots/ (create if missing)
Validation pattern (every write operation):
# After use_figma call — save screenshot → MEDIA: in reply
node scripts/figma-mcp-cli.mjs get_screenshot fileKey=\x3Ckey> nodeId=\x3Cid> scale=2 \
--out ~/workspace-dev-botti/screenshots/validate.png
# Reply with:
# MEDIA:screenshots/validate.png
Stitch comparison:
Stitch delivers via MEDIA:\x3CscreenshotUrl> (HTTP URL). Figma delivers via MEDIA:\x3Clocal-path> (file). Mechanism identical — only the source differs.
Hard Rules (Top 6)
These are non-negotiable. Full rule set: references/core-rules.md
- Validate after every write —
get_screenshotorget_metadataafter eachuse_figmacall. Never assume success. - Read → Understand → Fix → Retry — never blindly retry failed code, never rebuild as first response.
- Explicit over implicit — name exact variables, components, layout modes. Leave nothing to inference.
- Design-system-first — check local variables, styles, Code Connect, then libraries before creating anything raw.
- Component-instance-first — if a suitable existing design-system component exists, instantiate it instead of recreating it with local frames.
- Section-by-section — one logical section per
use_figmacall, validate between sections.
Known Gotchas
Before writing any use_figma code, know these failure modes:
→ Full reference: references/plugin-api-gotchas.md
- Paint binding:
setBoundVariableForPaintreturns a new paint — reassign the fills/strokes array (#paint-binding) - Opacity reset: Paint binding resets opacity to 1.0 — save and restore explicitly (#opacity)
- Page context: Always set page explicitly —
figma.currentPagemay reset between calls (#page-context) - FILL sizing: appendChild to auto-layout parent before setting
layoutSizingHorizontal: "FILL"(#append-before-fill) - Async: Always
awaitasync operations —loadFontAsync,importComponentByKeyAsync, etc. (#promises)
Prompting Guidance
→ Full patterns: references/prompting-patterns.md
Key patterns: variable-first code structure, section-by-section execution, explicit design-system usage, validation loops, error recovery framing.
Install / Setup
If dependencies are missing, install them from the skill repo root:
npm install
Then run one-time bootstrap:
Setup (One-Time Bootstrap)
node ~/.openclaw/skills/figma-agent/scripts/auth.mjs
Reads CC OAuth token from ~/.claude/.credentials.json, writes it into ~/.openclaw/openclaw.json. Then restart the OpenClaw gateway.
Token check: node ~/.openclaw/skills/figma-agent/scripts/auth.mjs --check
On 401 errors: Open CC → use any Figma tool (auto-refreshes token) → re-run bootstrap script.
URL Parsing
figma.com/design/:fileKey/:name?node-id=:nodeId
Convert - to : in nodeId (e.g. 123-456 → 123:456). For FigJam: figma.com/board/:fileKey/:name → use get_figjam.
Tool & Rate-Limit Reference
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install figma-agent - 安装完成后,直接呼叫该 Skill 的名称或使用
/figma-agent触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Figma Agent 是什么?
Figma MCP integration for OpenClaw. Use when the user wants to read Figma designs, inspect design tokens/variables, work with Code Connect, or create/edit Fi... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 187 次。
如何安装 Figma Agent?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install figma-agent」即可一键安装,无需额外配置。
Figma Agent 是免费的吗?
是的,Figma Agent 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Figma Agent 支持哪些平台?
Figma Agent 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Figma Agent?
由 Simeon(@rasimme)开发并维护,当前版本 v0.3.0。