| name | figma-console-safe-execution |
| description | Execute Figma Console MCP code safely with timeout sizing, auto-layout guards, minimal-error retries, and compact failure reporting. Use when creating or editing Figma nodes via figma_execute or debugging figma_console errors. |
Figma Console Safe Execution
When to use
Use this skill when:
- running
figma_console.figma_execute
- debugging Figma errors (auto-layout, variables, fonts, timeouts)
- building large spec frames/tables that can timeout
Execution checklist
Copy and follow this checklist during work:
Figma Execute Checklist
- [ ] Search components for fresh node ids
- [ ] Keep this execute block focused (single logical unit)
- [ ] Timeout set to >= 5000ms for multi-node operations
- [ ] Fonts loaded before text mutation
- [ ] Child appended before setting FILL sizing
- [ ] Screenshot captured after changes
- [ ] If failed, patch once and retry once
- [ ] Report only compact error context (no full transcript/image blob)
Required guardrails
-
Timeout sizing
- trivial: 2000-3000ms
- normal multi-node scripts: 5000-10000ms
- avoid 1000ms unless tiny changes
-
Auto-layout FILL safety
- only set
layoutSizingHorizontal = "FILL" after append
- ensure parent is auto-layout (
layoutMode !== "NONE")
-
Retry policy
- do not spam identical retries
- patch code first, then one retry
- if second failure, stop and summarize root cause
-
Context-size protection
- never return entire terminal logs
- never include raw screenshot payloads
- include only minimal failing snippet + message
Safe code patterns
table.appendChild(row);
if (row.parent && row.parent.layoutMode !== "NONE") {
row.layoutSizingHorizontal = "FILL";
}
const text = figma.createText();
await figma.loadFontAsync(text.fontName);
await text.setTextStyleIdAsync(styleId);
text.characters = content;
Failure response format
Use this compact format:
Tool: figma_console.figma_execute
Error: <exact error message>
Likely cause: <1 sentence>
Patch: <1-2 sentence fix>
Retry plan: timeout=<n>, one retry after patch
Suggested iteration loop
- execute focused block
- capture screenshot
- visual check + spacing/alignment review
- patch
- repeat (max 3 iterations)