ardot-use — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ardot-use (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
通过 batch_edit DSL 进行所有 Ardot 写操作的核心技能。提供关键规则、操作符参考、变量绑定模式、验证策略和错误恢复。
1. 每个 `batch_edit` 调用最多 25 个操作。 将较大的工作拆分为多个调用。建议保持在 20 个或更少以留出余量。
2. 绑定名称在每次 `batch_edit` 调用后过期。 在一次调用中分配的绑定名称(例如 btn1 = I(...))仅在同一调用内有效。在下一个 batch_edit 中,你必须使用真实节点 ID(例如 "3:544")— 绝不使用先前调用的绑定名称。
3. I() 中的 TEXT 节点仅支持 `fill: "#HEX"` 字符串格式。 在 I() 中创建 TEXT 节点时不能使用 fills: [{..., boundVariables: {...}}]。 解决方法:在 I() 中使用 fill: "#HEX" 创建 TEXT 节点,然后在后续的 batch_edit 调用中使用 U() 应用带有 boundVariables 的 fills。
4. `updated: {}` 不代表失败。 U() 操作通常返回 updated: {} 而不是 updated: {"nodeId": {...}}。操作可能已成功 — 通过立即运行 batch_read 验证节点,而不是信任返回值。
5. 跨页面插入需要在 I() 中明确指定 `pageId`。 默认情况下,I() 在当前活动页面上创建节点。要在不同页面上创建,使用 I("pageId", {...})。
6. M() 目标必须是 pageId,不是 frameId。 M() 仅支持在页面之间移动节点。要在同一页面内重新设置父节点,删除并重新创建或通过 U() 重新构建。
7. 不支持 cornerRadius 变量绑定。 Ardot 目前不支持 cornerRadius 的 boundVariables。使用硬编码数值代替(例如 cornerRadius: 6)。
8. 框架上的 variableModes 不可靠。 设置 variableModes: {"3:2": "3:3"} 来切换颜色模式可能不会生效。使用专门的页面来表示浅色/深色模式。
9. 始终 `return` 所有创建/修改的节点 ID。 每个 batch_edit 响应都包含绑定名称和节点 ID。记录这些 — 在后续调用中需要它们。
10. 增量构建。 先用占位符构建骨架,然后逐个区块填充细节。每个 use_figma 脚本失败都是原子性的 — 文件不会被修改。
11. 截图与编辑分离。 不要在 batch_edit 操作中混合 capture_screenshot 调用。截图作为单独的验证步骤。
| 操作符 | 语法 | 用途 | 关键说明 | |
|---|---|---|---|---|
I | I("pageId", {type, name, ...}) | 插入新节点 | reusable: true 用于组件;`width: "hug_contents"\ | "fill_container"` |
U | U("nodeId", {props...}) | 更新现有节点 | 必须使用真实节点 ID,不能使用先前调用的绑定名称 | |
M | M("nodeId", "pageId") | 在页面之间移动节点 | 目标必须是 pageId,不是 frameId | |
D | D("nodeId") | 删除节点 | 删除父节点会级联到所有子节点 | |
C | C("componentId") | 创建组件实例 | 实例继承组件属性;通过后续 U() 设置 x/y | |
G | G(...) | AI 生成的图像/图形 | 较慢;结果是非确定性的 |
// 在 Components 页面上创建可复用按钮组件
btn = I("3:1672", {
"type": "FRAME",
"name": "Button/Primary/sm",
"reusable": true,
"width": "hug_contents",
"height": 24,
"paddingLeft": 12,
"paddingRight": 12,
"paddingTop": 4,
"paddingBottom": 4,
"layout": "horizontal",
"cornerRadius": 6,
"primaryAxisAlignItems": "CENTER",
"fills": [{"type": "SOLID", "color": {"r": 0.91, "g": 0.44, "b": 0.29},
"boundVariables": {"color": {"id": "VariableID:3:14", "type": "VARIABLE_ALIAS"}}}],
"children": [
{"type": "TEXT", "name": "label", "characters": "Button",
"fontSize": 12, "fill": "#FFFFFF"}
]
})关键点:
width: "hug_contents" — 收缩以适应内容(需要自动布局)width: "fill_container" — 扩展以填充父元素layout: "horizontal" — 启用水平自动布局(需要 padding)fill 在 I() 中必须是 "#HEX" 字符串格式primaryAxisAlignItems: "MIN" / "CENTER" / "MAX"counterAxisAlignItems: "MIN" / "CENTER" / "MAX"// 将颜色变量绑定到 TEXT 节点的填充
U("3:1676", {
"fills": [{
"type": "SOLID",
"color": {"r": 0.61, "g": 0.59, "b": 0.56},
"boundVariables": {"color": {"id": "VariableID:3:12", "type": "VARIABLE_ALIAS"}}
}]
})M("3:544", "3:1672") // 将节点 3:544 移动到 Components 页面C("3:544") // 创建组件 3:544 的实例"boundVariables": {
"color": {"id": "VariableID:<variable-id>", "type": "VARIABLE_ALIAS"}
}fills[] 中:每个填充对象上的 boundVariables.colorstrokes[] 中:相同格式,在每个描边对象上cornerRadius 绑定:不支持(见关键规则 7)第一步 — 在 I() 中使用 fill: "#HEX" 创建:
I("0:1", {
"type": "TEXT", "characters": "Hello",
"fontSize": 14, "fill": "#333333"
})第二步 — 在单独的 batch_edit U() 调用中绑定变量:
U("<textNodeId>", {
"fills": [{
"type": "SOLID",
"color": {"r": 0.2, "g": 0.2, "b": 0.2},
"boundVariables": {"color": {"id": "VariableID:3:12", "type": "VARIABLE_ALIAS"}}
}]
})"VariableID:3:14" — 前缀 "VariableID:" + 变量节点 ID从 apply_variables 返回值或 fetch_variables 获取变量 ID。
在每批 U() 操作之后:
batch_read 以验证属性更改updated: {} — 它可能具有误导性capture_screenshotbatch_edit 调用中修复batch_edit 调用都是原子性的 — 如果脚本失败,文件不会被更改在提交任何 batch_edit 调用之前,验证:
fill: "#HEX"(不是带有 boundVariables 的 fills 数组)layout + padding* 属性fetch_editor_state(includeSchema: true)| 错误/症状 | 可能原因 | 修复方法 |
|---|---|---|
U() 返回 updated: {} | 正常 — 操作可能已成功 | 使用 batch_read 验证,不要信任返回值 |
| 节点创建在错误的页面上 | I() 中缺少明确的 pageId | 使用 I("pageId", {...}) 代替 I({...}) |
| TEXT 变量绑定不工作 | 在 I() 中使用了 fills+boundVariables | 两步法:I() 使用 fill:"#HEX",然后 U() 使用 fills+boundVariables |
| 绑定名称未识别 | 使用了先前 batch_edit 的绑定名称 | 在下一个调用中使用真实节点 ID(例如 "3:544") |
| cornerRadius 变量未绑定 | Ardot 不支持此功能 | 使用硬编码值(例如 cornerRadius: 6) |
| M() 将节点移到错误位置 | 目标是 frameId,不是 pageId | 确保目标是页面 ID,不是框架 ID |
| 无法发现其他页面 ID | 不带 nodeIds 的 batch_read 只返回当前页面 | 从 create_new_page 返回值记录页面 ID |
| variableModes 未生效 | 功能可能不稳定 | 使用单独的页面表示浅色/深色模式变体 |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.