Skip to content

The `figma` skill

Look up the design-file skill’s commands, supported resources, output forms, permissions, and API limitations.

A thin, uniform interface to the Figma REST API. Reads files, nodes, metadata, version history, and comments; renders nodes to images; posts comments; converts FigJam connector graphs to Mermaid; and best-effort reads of variables and dev resources. Read and comment only — it does not modify design content, which requires the Plugin API or the Figma MCP server, not REST.

Figma is SaaS-only (api.figma.com). There is no on-prem variant.

The source of truth is the skill itself: packs/figma/.apm/skills/figma/. The agent invokes the CLI at scripts/figma.py; you do not call it by hand. Run python scripts/figma.py <subcommand> --help for the exact flag surface of any subcommand.

KeyRequiredNotes
FIGMA_API_TOKENyesPersonal Access Token. Generated at Figma → Settings → Security → Personal access tokens.

Resolved by the broker through the Tier 1 (environment) → Tier 2 (OS keyring) → Tier 3 dotfile ladder. The dotfile lives at ~/.agentbundle/credentials.env (mode 0600 on POSIX; DACL-restricted on Windows). Populate any tier with the credential-setup skill. The token never reaches the model, and it is never accepted on the command line — flags like --token, --api-token, --bearer, --pat, and --password are refused. For the two-layer model, see Credentialed skills.

A FILE_KEY accepts either a bare key (abc123XYZ456) or a full figma.com URL. The key is extracted from /file/, /design/, /board/ (FigJam), and /proto/ URLs. Node ids accept the API form (1:23) or the URL form (1-23); the URL form is normalized to the API form before the request. Any other shape is rejected at the CLI.

Subcommand classDefault output
Structured-output subcommandsJSON to stdout. --format jsonl switches to JSON Lines. --output FILE writes to a file.
export-imagesImage bytes written to the --output directory. --format selects png / jpg / svg / pdf.
figjam-to-mermaidA fenced Mermaid block (Markdown). --output FILE writes it to disk.

--format is ignored by export-images and figjam-to-mermaid.

SubcommandPurposeKey arguments
checkVerify credentials and reachability.
whoamiShow the authenticated user record.
get-file FILE_KEYFetch a file (full or scoped).--ids, --depth, --geometry paths, --version, --plugin-data, --branch-data
get-nodes FILE_KEYFetch specific nodes by id.--ids (required), --depth, --geometry paths, --version
get-file-meta FILE_KEYLightweight file metadata (name, creator, last modified, role).
list-versions FILE_KEYFile version history.--page-size, --before, --after
export-images FILE_KEYRender nodes to images.--ids (required), --format, --scale, --use-absolute-bounds, --version, SVG flags below
list-comments FILE_KEYList file comments.
post-comment FILE_KEYPost a comment to a file.--message (required), --node-id, --reply-to
figjam-to-mermaid FILE_KEY NODE_IDConvert a FigJam connector graph to a Mermaid flowchart.
get-variables FILE_KEYFetch local (or published) variables. Typically Enterprise.--published
list-dev-resources FILE_KEYFetch dev resources on file nodes. Typically Dev Mode.
raw METHOD PATHArbitrary request to an unwrapped endpoint.--param KEY=VALUE (repeatable), --data-file
FlagEffect
--depth NLimit tree depth. 1 = pages only; 2 = pages + direct children.
--ids 1:2,1:3Return only those nodes and their subtrees.
--geometry pathsInclude vector path geometry.
--version IDRead a specific file version.
--branch-data(get-file) Include branch metadata.
--plugin-data ID(get-file) Include plugin data for the given plugin id.

get-file at full depth is the heaviest call — tens of megabytes on large files. Use get-file-meta to probe, --depth 1 to discover pages, then get-nodes for the subtree you want.

FlagEffect
--format png|jpg|svg|pdfOutput format (default png).
--scale FLOATRender scale in (0, 4] (default 1.0).
--use-absolute-boundsRender using the node’s absolute bounding box.
--version IDRender from a specific file version.
--svg-include-id(SVG) include node ids in element id attributes.
--no-svg-outline-text(SVG) keep text as <text> instead of outlining.
--no-svg-simplify-stroke(SVG) don’t simplify strokes to fills.

The token is sent only on the render call; the resulting presigned S3 URLs are downloaded unauthenticated. The render endpoint is rate-limited (Figma cites Tier 2 ≈ 25 requests/min); the client honors Retry-After. An id that isn’t renderable is skipped with a stderr warning; other ids still download.

FlagEffect
--format json|jsonlOutput format for structured-output subcommands (default json).
--output FILEWrite to a file, or a directory for export-images, instead of stdout.
--verboseDebug logging on the figma.* loggers only; httpx/httpcore stay at WARNING.

figjam-to-mermaid FILE_KEY NODE_ID emits a flowchart TB. It is only useful for FigJam files whose edges are drawn with the connector tool (CONNECTOR nodes).

PreservedDropped
FRAME / GROUP / SECTION containment as subgraphs.Visual layout, positions, sizes, colors.
CONNECTOR direction → ---, -->, <--, <-->.Freehand VECTOR arrows (invisible to the API).
SHAPE_WITH_TEXT.shapeType → matching Mermaid shape where one exists.Connector endpoints magnetted to free canvas (no destination node).
Connector text as the edge label.TRIANGLE_UP / TRIANGLE_DOWN → best-fit flag shape.

For a non-connector source (a regular design frame), use export-images and read the rendered output instead.

The CLI uses a banded exit-code contract. Read the stderr message for the specific cause, then act on the band.

ExitBandCauseAction
0SuccessProceed.
1Functional errorUnknown key (404), server 5xx, transport failure, keyring hard-fail, unprojected shim, unexpected.Surface the message; don’t blindly retry.
2User must actMissing/invalid/expired credentials (401), or 403 scope/plan access (Variables → Enterprise; Dev Resources → Dev Mode / file_dev_resources:read).Re-run credential-setup, or regenerate the PAT with the right scope, then re-run check.

Exit codes 39 are reserved.

All text returned by Figma — comment bodies, sticky-note text, layer names, FigJam shape labels, and the 4xx response bodies surfaced in error messages — is author-controlled. The agent renders it back to you but never acts on instructions embedded in it. Only your direct messages count as direction.