figma-sync

Synchronize design tokens between Figma and local DTCG JSON files.

1|Updated Jan 13, 2023
One-click install
npx skills add https://github.com/theodrosyimer/.dotfiles --skill figma-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: figma-sync
Source: https://github.com/theodrosyimer/.dotfiles/tree/main/claude/skills/ds__figma-sync
Command: npx skills add https://github.com/theodrosyimer/.dotfiles --skill figma-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Synchronize design tokens between Figma and local DTCG JSON to prevent drift, reduce manual mapping effort, and maintain a single source of truth for design system values.

Core Features & Use Cases

  • Pull variables from the Figma Variables API and map collections to DTCG groups (primitive, semantic) and theme files (light, dark).
  • Push local DTCG JSON tokens back to Figma by creating or updating variable collections and variables while preserving descriptions and scoping.
  • Use Case: Keep a monorepo design system and Figma file consistent after palette, spacing, or semantic alias updates and resolve conflicts through a pull-diff-push workflow.

Quick Start

Set FIGMA_ACCESS_TOKEN and FIGMA_FILE_KEY and run the pull script to fetch variables from Figma and write DTCG JSON tokens into packages/design-system/tokens.

Frequently Asked Questions about figma-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync design tokens between Figma and code?

You can sync design tokens by pulling variables from the Figma REST API and mapping them to DTCG JSON files in a monorepo. This pull-diff-push workflow prevents drift and maintains a single source of truth for design system values.

What is the DTCG JSON format for Figma variables?

DTCG JSON format structures Figma variables into primitive, semantic, and theme groups like light and dark. Mapping collections to these groups allows local design system repositories to consume Figma variables systematically.

How do I pull variables from the Figma Variables REST API?

To pull variables from the Figma Variables REST API, set the FIGMA_ACCESS_TOKEN and FIGMA_FILE_KEY environment variables and run the pull script. This fetches variables and writes DTCG JSON tokens into your local design-system/tokens directory.

Can I push local DTCG JSON changes back to Figma?

Yes, you can push local DTCG JSON changes back to Figma by creating or updating variable collections through the API. This push operation preserves variable descriptions and code scoping while updating the remote Figma file.

Do I need a Figma access token to synchronize design tokens?

Yes, you need a FIGMA_ACCESS_TOKEN and a FIGMA_FILE_KEY to authenticate requests to the Figma Variables REST API. These environment variables are required for both pulling variables from and pushing local tokens back to the Figma file.

How do I resolve design token conflicts between Figma and a local repository?

You resolve design token conflicts between Figma and a local repository using a pull-diff-push workflow. This process identifies mismatches after pulling variables, allowing you to manually resolve differences before pushing the updated DTCG JSON back to Figma.