figma_execute
Run JavaScript directly in Figma's plugin context to modify designs programmatically, with built-in checks for design-system compliance.
Instructions
Run JavaScript in the Figma plugin context. Full Plugin API available. Use fileKey or figmaUrl to target a specific file. v1.8.1+: Static analysis detects design-system discipline violations (hardcoded colors, missing token bindings, no-instance usage, hardcoded typography). SEVERE warnings are promoted to the top of the response as _designSystemViolations — Claude must read and self-correct. Also detects gotchas: FILL/ABSOLUTE before appendChild, sync API usage, missing loadFontAsync, sync currentPage assignment. For component instances: use setProperties({...}), NOT findAll(TEXT). v1.9.6+: Post-execute scan — eğer kod return { createdNodeIds: [...] } veya nodeIds/ids/frameId/rootId/nodeId döndürürse plugin oluşturulan node'ları otomatik tarar, unbound fill/padding/radius/text-style varsa response'a _POST_EXECUTE_SCAN_BLOCKING: true ve _postExecuteViolations alanı ekler. Bu flag varsa execute geçersiz sayılır — kodu düzelt (setBoundVariable/setTextStyleIdAsync ekle) ve tekrar çalıştır.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "figma_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| fileKey | No | Target a specific connected file. | |
| timeout | No | ||
| figmaUrl | No | Figma or FigJam file URL for routing. |