8. Quick actions

Quick actions (AI-10) run on the selection from the context menu, the panel's action row and Ctrl+/ (UI-6).

Esta página está em inglês; a tradução está a caminho.

Quick actions (AI-10) run on the selection from the context menu, the panel’s action row and Ctrl+/ (UI-6). Each is a fixed prompt plus a fixed tool list, so they are fast and predictable. All run on a proposal unless ud.ai.applyDirectly is set; all are one undo step. Each action’s --allowedTools and ud mcp --allow list contains exactly the tools and commands of its “Tool calls” column (§6.3), so a quick action cannot be talked into doing anything else; the change list of §6.1 shows its text, name and plugin-data changes explicitly, which for Rename, Fill, Translate and Alt text is the whole change.

Action Tier Tool calls
Rename layers quick get_metadata of the selection → one use_figma that sets name on each node ({ renamed: [[id, old, new], …] }). Naming rules from references/naming.md: role-based names (“Header”, “Avatar”, “Price”), no “Frame 12”, components keep their names.
Fill with realistic content quick get_metadata + ud_run inspect --fields text,componentProperties → one use_figma that loads fonts and sets characters or text component properties; images get no content (the result lists them). Content matches the field’s role (names, emails, prices, dates) and the document locale.
Translate quick as above, with a target locale chosen in a picker. Option “into a copy” duplicates the frame first (ud_run node.duplicate) and renames it “Login — de-DE”. Text that overflows its box is reported, not shrunk.
Generate variants assistant get_metadata + search_design_system (variables for state colours) → use_figma that clones the component per requested state/size, binds the state variables, combineAsVariants, lays out the grid (scripts/variant-grid.js) → get_screenshot of the set.
Suggest auto layout assistant ud_run layout.suggest (the editor’s own inference, LAY-7) for direction and gap → use_figma that applies auto layout, sizing and padding bound to spacing variables → get_screenshot before/after; the result says which children moved more than 2 px.
Write component descriptions quick get_metadata of components and sets + get_screenshot of each → one use_figma that sets description on COMPONENT/COMPONENT_SET nodes only: purpose, when to use, properties.
Generate alt text quick get_screenshot of each image-filled node (and its frame for context) → ud_apply of a11y.set commands with altText (DEV-8). Decorative images get role: "presentation" instead.

Command ids such as layout.suggest, node.duplicate and a11y.set are registry commands; CLI-001 and ud commands have the exact ids and parameters.