All skills
figma avatar

/figma-use-slides

@a5e7e04 official
by figmafigma/mcp-server-guide2k stars
194

This skill helps agents use Figma's use_figma MCP tool in the Slides context. Can be used alongside figma-use which has foundational context for using the use_figma tool.

Use this Skill: https://skilld.dev/gh/figma/mcp-server-guide/figma-use-slides

This session only. Nothing lands on disk.

referencesslide-grid.md

≈765 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Slide Grid

The slide grid is a 2D array of SlideNode objects, organized by rows.

Newly created files have an empty grid

A Slides file produced by create_new_file starts with zero rows and zero slides — figma.getSlideGrid() returns [], not a default first slide. The page's only child is the SLIDE_GRID node itself (typically id 0:3), which is empty until you create content. The first call to figma.createSlide() implicitly creates row 0 and inserts the new slide there; subsequent createSlide() calls append to the end of the last row.

// On a fresh Slides file
const grid = figma.getSlideGrid();
// → []   (NOT a one-element array — there is no default slide)

const slide = figma.createSlide();   // creates row 0 + the slide in one shot
const grid2 = figma.getSlideGrid();
// → [[slide]]

If your script assumes at least one slide exists (e.g. to read theme tokens off it), guard for the empty case or call createSlide() first.

Reading the grid

const grid = figma.getSlideGrid();
// Returns: SlideNode[][]
// Example shape:
// [
//   [slide1, slide2],          // Row 0
//   [slide3, slide4, slide5],  // Row 1
//   [slide6],                  // Row 2
// ]

return grid.map((row, rowIdx) => ({
  row: rowIdx,
  slides: row.map((slide, colIdx) => ({
    id: slide.id,
    name: slide.name,
    col: colIdx,
  })),
}));

The inner arrays are plain SlideNode[] — they are NOT SLIDE_ROW nodes. Setting .name or any other property on them mutates a JS array, not the underlying section. To touch the SLIDE_ROW itself (e.g. to rename a section), traverse the node tree via SLIDE_GRID.children. See slide-lifecycle.md — Slide sections.

Reordering the grid

setSlideGrid accepts a new 2D array. All existing slides must be present — you can change row grouping and ordering but cannot drop slides.

// Move the first row to the end
const grid = figma.getSlideGrid();
const [firstRow, ...rest] = grid;
figma.setSlideGrid([...rest, firstRow]);
// Flatten all slides into a single row
const grid = figma.getSlideGrid();
const allSlides = grid.flat();
figma.setSlideGrid([allSlides]);
// Reverse slide order within each row
const grid = figma.getSlideGrid();
const reversed = grid.map(row => [...row].reverse());
figma.setSlideGrid(reversed);
// Move a specific slide to a different row
const grid = figma.getSlideGrid();
const targetSlide = figma.getNodeById("SLIDE_ID");

const newGrid = grid.map(row => row.filter(s => s.id !== targetSlide.id));
// Add to the beginning of row 0
newGrid[0] = [targetSlide, ...newGrid[0]];
// Remove empty rows
const cleanGrid = newGrid.filter(row => row.length > 0);
figma.setSlideGrid(cleanGrid);

Notes

  • getSlideGrid / setSlideGrid are marked deprecated in favor of getCanvasGrid / setCanvasGrid, but both work in Slides.
  • All slides from the current grid must be passed back to setSlideGrid — you can reorganize freely but cannot omit slides.

Source: SKILL.md on GitHub

No alerts17d3 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides technical guidance for automating Figma Slides. It is categorized as low risk because its core functionality—generating scripts based on user-provided briefs—creates a surface area for indirect prompt injection and involves dynamic execution of code.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

Signed by skilld at a5e7e04. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
disable-model-invocation
false
  • MCP
  • Design
  • figma
  • slides
  • plugin-api
  • presentation
  • deck-building

README badge

README badge for figma/mcp-server-guide/figma-use-slides

This skill provides Slides-specific context for the use_figma MCP tool, covering critical positioning rules, theme management, and the slide grid structure that differ from Figma's Design API. It includes a two-phase deck-building workflow with design thinking guidance and batch validation patterns for building multi-slide presentations via the Plugin API.

Generated from the current SKILL.md.

Do I need to load figma-use as well as figma-use-slides?
Yes. figma-use-slides provides Slides-specific context, but figma-use contains foundational context for the use_figma MCP tool and advanced plugin API use cases not covered here.
Can I use figma.createPage() in Slides files?
No. createPage() is Design-file only and will throw a TypeError in Slides. Use the slide grid (SLIDE_GRID / SLIDE_ROW / SLIDE) to organize deck structure instead.
What's the critical rule about setting x and y coordinates on new nodes?
Always call appendChild before setting x/y. Setting coordinates before appending causes nodes to land 240 pixels off their intended position. Use the helper pattern in slide-gotchas.md to make the order impossible to get wrong.
Does get_metadata work on Slides files?
No. Use read-only use_figma scripts for validation instead, and return created node positions in closePlugin() output to verify no overlapping bounding boxes.
When modifying an existing deck, should I delete and rebuild slides or edit in place?
Always modify slides in place unless the user explicitly asks to start over or redo from scratch. Inspect the existing deck to match its color palette, typography, and spatial habits.

Generated from the current SKILL.md. These answers refresh after source changes.