Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/XRenSiu/claude-code-forgenpx agentmods add skills/xrensiu/claude-code-forge/figma-to-codeWrote 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.
[](https://agentmods.dev/skills/xrensiu/claude-code-forge/figma-to-code)<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/figma-to-code"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/figma-to-code/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.
<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/figma-to-code"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/figma-to-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00097 | $0.05602 |
| Opus 5.5 | $0.00039 | $0.02241 |
| Sonnet 5.5 | $0.00019 | $0.01120 |
| Haiku 4.5 | $0.00010 | $0.00560 |
Grade A, and why
figma-to-code scanned grade A with 1 finding 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 1mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
使用 curl 下载所有资产到本地,**命名要语义化**: How it starts
The opening of the file, as written. The whole thing — 481 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Figma to Code
核心原则
使用项目组件库生成代码,而非 Figma MCP 的原始输出。 MCP 返回的代码有语法问题且不使用项目组件,必须经过修复和转换。
前提条件
- Figma MCP 已连接
- 可选:项目配置了 local-code-connect(有组件库时)
package.json中有localCodeConnect.registry配置- 或项目内存在
.figma-registry.json文件(通过 glob 搜索发现) - 组件库已导出注册表文件
- 强烈推荐:Figma API Token(用于获取完整组件属性)
- 环境变量
FIGMA_TOKEN或 CLI--figma-token - 或项目
.env文件中定义FIGMA_TOKEN=figd_xxx - 没有 Token 时约 60% 的组件 props 会为空,严重影响代码准确性
- MCP 不返回组件 variant/boolean 属性值,REST API 能补全
- 环境变量
何时使用
digraph {
rankdir=TB;
start [label="收到 Figma URL" shape=oval];
use [label="使用此 Skill" shape=box style=filled fillcolor=lightgreen];
skip [label="不需要此 Skill" shape=box];
start -> use [label="要求生成代码"];
start -> skip [label="只是查看设计"];
}
流程概览
digraph {
rankdir=TB;
s1 [label="Step 1\n读取项目上下文" shape=box];
q1 [label="有 localCodeConnect\n配置?" shape=diamond];
s2 [label="Step 2\n获取设计稿" shape=box];
s3 [label="Step 3\n修复 MCP Code" shape=box];
s4 [label="Step 4\nCLI transform" shape=box style=filled fillcolor=lightyellow];
s5 [label="Step 5\n下载 MCP 资产" shape=box style=filled fillcolor=lightblue];
s6a [label="Step 6\n根据 JSON + 注册表\n生成代码" shape=box];
s6b [label="Step 6\n根据 MCP 代码\n生成代码" shape=box];
s7 [label="Step 7\n验证" shape=box];
s1 -> q1;
q1 -> s2 [label="是"];
q1 -> s2 [label="否"];
s2 -> s3;
s3 -> s4 [label="有组件库"];
s3 -> s5 [label="无组件库"];
s4 -> s5;
s5 -> s6a [label="有组件库"];
s5 -> s6b [label="无组件库"];
s6a -> s7;
s6b -> s7;
}
标注说明:
- 黄色:Step 4 仅在有组件库时执行
- 蓝色:Step 5 下载资产是必须步骤,所有流程都要执行
流程
必须按顺序执行,不允许跳过任何步骤。
Step 1: 读取项目上下文
在调用任何 Figma MCP 之前:
1a. 发现组件注册表
按优先级依次检查,任一方式找到即可:
- 读取
package.json,检查localCodeConnect.registry配置 - 如果第 1 步未找到:用 glob 搜索项目内的
**/.figma-registry.json文件 - 如果找到注册表:读取它,了解可用组件及其 props
// package.json 配置示例(可选,但推荐)
{
"localCodeConnect": {
"registry": "./node_modules/@xrs/vue/dist/.figma-registry.json"
}
}
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 1mo ago First seen · 481 lines · 97 tokens per session scan A c1ee7d599b13
figma-to-code is a skill published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 29d ago), licensed MIT. It adds 97 tokens to every session and 5,602 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.
Other skills, from other repositories
anti-slop-design
Autonomous Principal Design Technologist. Cures vibe-coded software from AI frontend slop using curated token archetypes and 7-axis quality gating.
chakra-ui-builder
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…
visual-ralph
Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ultragoal with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.
frontend-ui-dark-ts
Build dark-themed React applications using Tailwind CSS with custom theming, glassmorphism effects, and Framer Motion animations. Use when creating dashboards, admin panels, or data-rich interfaces with a refined dark aesthetic.
open-design-setup
Prepare or repair a project's prototyping environment so open-design can build prototypes with the project's own component library and render them through the project's toolchain. Use when the library target is needed and docs/design/prototyping.md is missing, stale, or failing; excludes HTML-only design work and…
frontend-visual-qa
Audits rendered UI and specific task/object-link handoffs; excludes ordinary source citations alone. Audits already-rendered UI and Markdown/Obsidian image layout — web app, deck/slide, dashboard, design-system, or Electron/native app — via real-browser/native-app journeys and a Playwright sweep. Use after UI…