figma_execute
Execute JavaScript in the Figma plugin context to automate design modifications, enforce design system rules, and detect violations like hardcoded colors or missing token bindings.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| figmaUrl | No | Figma or FigJam file URL for routing. | |
| fileKey | No | Target a specific connected file. | |
| code | Yes | ||
| timeout | No |