agentleFS
memi-designmemi-design/design-skills/skills/figma-sync/SKILL.md

figma-sync

Skill7 starsChanged 4 months agoMITView on GitHub

Figma sync workflow patterns — bidirectional design-code sync, conflict resolution, incremental updates, multi-file orchestration

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never overwrite Figma components that have been modified since last pull

    line 50
  2. Very specific:

    Use figma.currentPage.findOne() to target specific nodes, not blind creation

    line 52
  3. Distinctive:

    When both sides have changes:

    line 56
  4. Distinctive:

    When syncing across multiple Figma files:

    line 103
  5. Distinctive:

    Always pull before push — ensure local state is current

    line 155
  6. Distinctive:

    Keep sync operations idempotent — safe to retry

    line 157
  7. Distinctive:

    Never modify Figma pages the user is actively editing (check selection first)

    line 158

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Figma Sync Patterns — Memoire Connect Skill

Orchestrates reliable bidirectional sync between Figma and the local codebase through the Memoire bridge.


Sync Modes

1. Pull Sync (Figma to Code)

Trigger: memi pull, document-changed event, or manual

Pipeline:

Figma Plugin
  -> getVariables + getComponents + getStyles (parallel)
  -> Parse raw data to DesignSystem
  -> Diff against existing registry
  -> Update changed tokens/components only
  -> Auto-spec new components
  -> Regenerate affected specs

Incremental strategy:

  • Compare token values by name + collection — only update changed
  • Compare components by figmaNodeId — detect added/removed/modified
  • Track lastSync timestamp to skip unchanged files

2. Push Sync (Code to Figma)

Trigger: memi sync --push, agent canvas operations

Pipeline:

Local Specs + Tokens
  -> Diff against Figma state
  -> Generate Figma Plugin API calls
  -> Execute via bridge
  -> Self-heal (screenshot + verify)
  -> Update Code Connect mappings

Safety rules:

  • Never overwrite Figma components that have been modified since last pull
  • Prompt user if Figma-side changes detected since last sync
  • Use figma.currentPage.findOne() to target specific nodes, not blind creation

3. Bidirectional Merge

When both sides have changes:

ScenarioResolution
Token value changed in Figma onlyAccept Figma
Token value changed in code onlyPush to Figma
Both changed same tokenPrompt user — show diff
New component in FigmaPull + auto-spec
New spec in codePush to Figma on next sync
Component deleted in FigmaFlag in CLI, don't auto-delete spec
Spec deleted locallyFlag, don't auto-delete in Figma

Change Detection

Token Diffing

interface TokenDiff {
  added: DesignToken[];
  removed: DesignToken[];
  modified: { before: DesignToken; after: DesignToken }[];
  unchanged: number;
}

Compare by: name + collection as composite key. Modified = same key but different values object (deep equal).

Component Diffing

interface ComponentDiff {
  added: DesignComponent[];
  removed: DesignComponent[];
  modified: { before: DesignComponent; after: DesignComponent; changes: string[] }[];
}

Compare by: figmaNodeId as primary key, name as fallback. Track changes: name, description, variants, properties.


Multi-File Orchestration

When syncing across multiple Figma files:

  1. Enumerate files: Each connected plugin reports its fileKey
  2. Parallel pull: Pull from all connected plugins simultaneously
  3. Namespace tokens: Prefix with file name to avoid collisions
  4. Merge design systems: Combine into single registry with source tracking
  5. Conflict resolution: Same-name tokens from different files prompt user

Event-Driven Sync

The Memoire bridge emits these sync-relevant events:

EventWhenSuggested Action
document-changedAny node modified in FigmaDebounced pull (3s)
selectionUser selects different nodesUpdate context, no sync
page-changedUser switches Figma pagesRefresh page tree
sync-dataPlugin sends bulk dataProcess and update registry

Operator Console

Widget V2 exposes the bridge as an operator console:

  • Jobs shows sync, capture, inspect, and healer activity as tracked job state
  • Selection shows current node IDs, styles, variants, and layout facts
  • System shows bridge status, ports, latency, reconnect state, and buffered changes
  • agent-status surfaces on-canvas task visibility from the orchestrator
  • connection-state, job-status, sync-result, and healer state are better sources of truth than raw bridge logs

Debounce Strategy

  • document-changed: 3 second debounce — batch rapid edits
  • Multiple changes within window: single pull covers all
  • Ignore events while a pull is already in progress
  • Queue one follow-up pull if changes arrive during active pull

Error Recovery

ErrorRecovery
Plugin disconnected mid-syncRetry on reconnect and re-run the affected operation explicitly
Timeout on getVariablesRetry once with 2x timeout, fall back to cached data
Rate limitedBack off 5s, retry with exponential backoff
Corrupted responseLog warning, skip this sync cycle, retry next event
Registry write failsKeep in-memory state, retry disk write

Best Practices

  • Always pull before push — ensure local state is current
  • Log every sync with timestamp, direction, and counts
  • Keep sync operations idempotent — safe to retry
  • Never modify Figma pages the user is actively editing (check selection first)
  • Preserve user's undo stack — batch Figma operations into single undo group

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.