openclaw-skills/figma/SKILL.md
Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.
npx skillsauth add seaworld008/commonly-used-high-value-skills figmaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Figma MCP 是连接设计稿与生产代码的超级引擎。它通过 Figma API 获取结构化设计上下文、变量定义及原始素材,并结合大模型的推理能力,将视觉稿一键转化为符合项目规范的 React/Tailwind/Vue 代码。
# 确保已安装 Figma MCP Server
mcp_call({ action: "search", keyword: "figma" });
# 获取访问令牌 (PAT)
# 详见 references/figma-mcp-config.md
为了确保 1:1 的视觉还原度和高性能的代码实现,必须严格遵循以下流程:
get_metadata 获取高层级节点地图,再精准抓取需要的子节点。get_screenshot 获取节点的实时渲染图片,作为实现时的绝对参考。cornerRadius: 8)映射到项目的 Design Tokens(如 rounded-lg)。tailwind.config.js 对比。mcp_call({ name: "get_design_context", arguments: { fileKey, nodeIds } })。children 数组,识别 TEXT, VECTOR, INSTANCE 等节点类型。#3B82F6 -> brand-primary)。get_file_variables 获取全局主题定义。variable-id 而非硬编码颜色。get_screenshot 的结果传入多模态模型进行视觉校验。image_edit 技能在截图上标注出具体的像素间距,辅助编码。icon-user-profile.svg)。svgr 转化为 React 组件。### 🎨 设计稿信息
- **File Key**: [例如:vO3S...]
- **Node ID**: [例如:12:456]
- **截图参考**: [URL 或本地路径]
### 🛠️ 实现要求
- **框架**: Next.js + Tailwind CSS
- **组件库**: 优先复用 `src/components/ui/` 下的 ShadcnUI。
- **交互**: 悬浮状态需增加 `hover:scale-105` 动画。
### 📦 素材处理
- 所有图标导出为 Inline SVG。
- 背景图放在 `public/images/`。
// 示例:获取整个 Figma 文件的页面结构
mcp_call({
name: "get_metadata",
arguments: {
fileKey: "XYZ789..."
}
});
i18n-expert 技能,自动生成多语言 JSON 文件并替换设计稿中的占位符。get_screenshot 调用有严格限制,需注意缓存。undefined。header, nav, main)。SVGO 压缩,禁止直接引入未经过滤的大型图片。MEMORY.md。webapp-testing 技能中运行一次视觉差异分析。.env.local,严禁提交到代码仓库。development
Enumerating failure modes via pre-mortem analysis. Systematically identifies failure scenarios for plans, designs, and features, scoring them with RPN/AP. Does not write code.
testing
Orchestrating specialist AI agent teams as a meta-coordinator. Decomposes requests into minimum viable chains, spawns each as an independent session in AUTORUN modes, and drives to final output. Use when a task spans multiple specialist domains, requires parallel agent execution, or needs hub-and-spoke routing across the skill ecosystem.
development
Converting document formats (Markdown/Word/Excel/PDF/HTML). Converts specs from Scribe and reports from Harvest into distributable formats; generates reusable conversion scripts. Use when converting documents, building accessibility-compliant PDFs, or creating Pandoc/LibreOffice pipelines.
testing
Curating cross-agent knowledge and guarding institutional memory. Extracts patterns from agent journals into METAPATTERNS.md, detects knowledge decay, propagates best practices, prevents organizational forgetting. Use when consolidating cross-agent insights, curating memory, or auditing knowledge decay.