Zoe Addamssance

Figma Plugin Writer

开发编程v1.0.0
作者:Zoe Addamssance更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-03-23figma-plugin-writer@clawhub_zerozlw/figma-plugin-writer
代码生成前端开发

据 AlphaMoat 统计,截至 2026-09,Figma Plugin Writer 累计下载 1,271 次、获 0 个星标,在全部 5,078 个 AI 技能中排名第 4,906 位,在「开发编程」分类(577 个)中排名第 567 位。

累计安装
159
累计下载
1,271
星标
-
全站排名
#4,906
全站前 97% · 「开发编程」前 99%
平台累计安装累计下载星标评论
ClawHub ↗281,136--
SkillHub ↗1591,271-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

需要用户提供插件目录和代码文件,可选提供目标 Figma 文件作上下文。生成代码运行后会修改设计;默认模板可能清空页面内容,运行前应审阅代码,并优先操作副本或命名框架。 需要现有插件目录及 manifest,生成代码由用户在 Figma 中运行。创建文字前加载可用的所需字体,并核对实际受影响节点;不能把代码生成当作已修改设计。

资料发布于 2026-10-27

可以用来做什么

  • 通过插件代码创建界面原型
  • 自动生成设计系统或应用屏幕

什么时候用

  • 已明确目标文件并可审阅生成代码时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

为这个副本编写 Figma 插件代码,只替换指定框架,不清空页面。
先解释代码会修改哪些元素,再生成文件。

月度数据趋势

累计下载1,271
2267871,3482026-03 · 累计下载 3032026-05 · 累计下载 6582026-06 · 累计下载 7812026-07 · 累计下载 9842026-08 · 累计下载 1,1312026-09 · 累计下载 1,27126-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-091,271—-
2026-081,131+14.9%-
2026-07984+26.0%-
2026-06781+18.7%-
2026-05658—-
2026-03303—-

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

5.3 KB · ClawHub v1.0.0
---
name: figma-plugin-writer
description: Write Figma plugin code to automate UI design in Figma files. Activate when user wants to create UI mockups, design systems, app screens, or visual prototypes directly in Figma via plugin code. NOT for: Figma API REST calls, file management, or commenting.
---

# Figma Plugin Writer

Write plugin code (`code.js`) to automate design in Figma files. After updating the code, notify the user to run the plugin.

## Prerequisites
展开全部(共 224 行)

The user must provide:
1. **Plugin directory** — folder containing `code.js` and `manifest.json`
2. **Code file** — typically `code.js`
3. **Target Figma file** — optional, for context

## Workflow

1. Receive design requirements from the user
2. Write plugin code to `code.js`
3. Notify user: `Plugins → Development → <plugin-name>`
4. Iterate based on feedback

## API Reference

### Font Loading (required before creating text)

```js
await figma.loadFontAsync({ family: "Inter", style: "Regular" });
await figma.loadFontAsync({ family: "Inter", style: "Medium" });
await figma.loadFontAsync({ family: "Inter", style: "Semi Bold" });
await figma.loadFontAsync({ family: "Inter", style: "Bold" });
```

### Frame (Container)

```js
var frame = figma.createFrame();
frame.name = "MyFrame";
frame.resize(width, height);
frame.cornerRadius = 12;
frame.fills = [{ type: "SOLID", color: { r: 1, g: 1, b: 1 } }];
frame.x = 0;
frame.y = 0;
```

### Text

```js
var text = figma.createText();
text.characters = "Hello World";
text.fontSize = 16;
text.fontName = { family: "Inter", style: "Regular" };
text.fills = [{ type: "SOLID", color: { r: 0, g: 0, b: 0 } }];
```

### Rectangle

```js
var rect = figma.createRectangle();
rect.resize(100, 50);
rect.fills = [{ type: "SOLID", color: { r: 0.9, g: 0.2, b: 0.2 } }];
rect.cornerRadius = 8;
```

### Nesting Nodes

```js
frame.appendChild(text);
parentPage.appendChild(frame);
```

### Drop Shadow

```js
frame.effects = [{
  type: "DROP_SHADOW",
  color: { r: 0, g: 0, b: 0, a: 0.1 },
  offset: { x: 0, y: 4 },
  radius: 12,
  spread: 0,
  visible: true,
  blendMode: "NORMAL",
}];
```

### Stroke

```js
frame.strokes = [{ type: "SOLID", color: { r: 0.8, g: 0.8, b: 0.8 } }];
frame.strokeWeight = 1;
```

### Text Alignment

```js
text.textAlignHorizontal = "CENTER"; // LEFT | CENTER | RIGHT | JUSTIFIED
text.textAlignVertical = "CENTER";   // TOP | CENTER | BOTTOM
```

### Auto Layout (inside Frame)

```js
frame.layoutMode = "VERTICAL"; // or "HORIZONTAL"
frame.primaryAxisAlignItems = "CENTER";   // MIN | CENTER | MAX | SPACE_BETWEEN
frame.counterAxisAlignItems = "CENTER";
frame.paddingTop = 16;
frame.paddingBottom = 16;
frame.paddingLeft = 16;
frame.paddingRight = 16;
frame.itemSpacing = 8;
```

### Page Navigation

```js
var pages = figma.root.children;
var targetPage = pages[pages.length - 1];
await figma.setCurrentPageAsync(targetPage);
```

### Clear Page Content

```js
var old = targetPage.children.slice();
for (var i = 0; i < old.length; i++) {
  old[i].remove();
}
```

### Viewport

```js
figma.viewport.scrollAndZoomIntoView([frame]);
```

### Notifications

```js
figma.notify("Done!", { timeout: 3000 });
figma.notify("ERROR: " + e.message, { timeout: 10000 });
```

### Page Info

```js
var pages = figma.root.children;
var count = pages.length;
var pageName = pages[0].name;
```

## Code Template

```js
async function main() {
  try {
    // 1. Load fonts
    await figma.loadFontAsync({ family: "Inter", style: "Regular" });
    await figma.loadFontAsync({ family: "Inter", style: "Bold" });

    // 2. Get target page
    var pages = figma.root.children;
    var target = pages[pages.length - 1];
    await figma.setCurrentPageAsync(target);

    // 3. Clear old content
    var old = target.children.slice();
    for (var i = 0; i < old.length; i++) old[i].remove();

    // 4. Create design...
    var frame = figma.createFrame();
    frame.name = "Screen";
    frame.resize(375, 812);
    frame.fills = [{ type: "SOLID", color: { r: 1, g: 1, b: 1 } }];
    frame.x = 0;
    frame.y = 0;
    target.appendChild(frame);

    // 5. Done
    figma.viewport.scrollAndZoomIntoView([frame]);
    figma.notify("Design complete!", { timeout: 3000 });

  } catch (e) {
    figma.notify("ERROR: " + e.message, { timeout: 10000 });
  }
}

main();
```

## Pitfalls & Gotchas

### documentAccess: "dynamic-page" Mode

If `manifest.json` has `"documentAccess": "dynamic-page"`:
- ❌ `figma.currentPage = page` → ✅ `await figma.setCurrentPageAsync(page)`
- ❌ `figma.getNodeById()` → ✅ `await figma.getNodeByIdAsync()`
- ❌ `figma.closePlugin()` → ✅ `await figma.closePluginAsync()`

### Error Handling

- Always wrap code in `try-catch`
- Show errors via `figma.notify("ERROR: " + e.message, { timeout: 10000 })`
- Do not use emoji in text content (font may not support the glyph)
- Do not call `figma.closePlugin()` automatically (let user close manually)

### Free Tier Limits

- Max 3 Pages — do not create new Pages
- Work within existing Pages (clear and rebuild)

### Fonts

- Default: Inter (built into Figma)
- Supported styles: "Regular", "Medium", "Semi Bold", "Bold"
- Colors use `{ r, g, b }` format with 0-1 range

## Iteration Pattern

On each design iteration:
1. Clear old elements: `page.children.slice().forEach(c => c.remove())`
2. Recreate design with changes
3. Notify user to re-run the plugin

「开发编程」分类下的热门技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。