Sandbox
@noemuch/bridge

Figma connector for Claude Code and Cursor

Bridge connects a terminal agent to Figma so you can describe a design, compile it, and send it to Figma with the project’s real components and tokens. It uses skills, a local compiler, hooks, and MCP transport to keep the output aligned with the design system and checked against rules before execution.

155 stars15 forksTypeScriptUpdated 3mo ago
Who it's for

Builders who want Claude Code or Cursor to generate Figma designs from design-system rules.

What it delivers

You can turn natural-language design requests into Figma output that follows your design system without re-explaining tokens, variants, or component rules.

What it does

Claude Code skills

Provides `using-bridge`, `generating-figma-design`, `learning-from-corrections`, `shipping-and-archiving`, and `extracting-design-system` skills for the main workflow.

Cursor plugin support

Includes `.cursor-plugin/` manifests so Cursor can use the same Bridge workflow.

Deterministic compiler

Compiles scene graph JSON into Figma Plugin API code and enforces 26 rules before anything is sent to Figma.

Living knowledge base

Stores registries, recipes, learnings, and guides in the repo and keeps them synced with Figma.

Session hooks

Runs hook logic around a session start to load rules and health checks.

Cron sync

Uses GitHub Actions cron to pull Figma changes, detect drift, and open a PR when the knowledge base changes.

How to get it

  1. 1In Claude Code, any session (one-time install)
    /plugin marketplace add noemuch/bridge
    /plugin install bridge-ds
  2. 2In your DS repo
    cd /path/to/ds-repo && claude
    setup bridge

README

Bridge

Compiler-grade trust for AI-generated Figma.
Deterministic compiler · Living KB · MCP-native

MIT License npm version Stars CI


Bridge compiles your design-system intent into Figma output that's guaranteed DS-compliant by construction — not by verification. 26 Figma API rules enforced automatically by a local compiler. Zero hardcoded values, zero raw Plugin API code, zero AI hallucinations.

Three pillars: a deterministic compiler (the moat), conversational UX via Claude Code skills (make / fix / done), and a living KB continuously synchronized with Figma via cron.

For designers

Design components and screens from natural language inside Claude Code. Bridge handles the rest:

# In Claude Code, inside your DS repo:
make a settings screen for account information

Bridge produces:

  1. A structured CSpec (YAML) describing the layout + tokens
  2. A scene graph JSON (validated against your DS registries)
  3. Compiled Figma Plugin API code (all 26 rules respected)
  4. Executed designs in Figma via MCP

Every output uses your real components, bound variables, and text styles. Zero hardcoded values.

Iterate with fix (capture manual Figma edits as learnings). Ship with done (archive + extract recipes).

For DS teams

Bridge keeps your knowledge base continuously synchronized with Figma.

  • setup bridge in Claude Code bootstraps your DS repo: registries, cron workflow, all in one flow.
  • Daily cron on GitHub Actions pulls Figma via REST, detects KB drift, opens a PR with the diff. Silent on no-change.
  • Recipe + CSpec ref-validity checks flag broken references when components are renamed or removed.

For engineers

The KB lives in your repo at bridge-ds/knowledge-base/registries/. Point your AI client at this directory or read it programmatically. Your generated code uses tokens, variants, and composition rules correctly — because it reads the source of truth, not guesses.

Quick start

In Claude Code, any session (one-time install):

/plugin marketplace add noemuch/bridge
/plugin install bridge-ds

In your DS repo:

cd /path/to/ds-repo && claude
setup bridge

One phrase. The skill handles pre-flight, scaffolding, extraction, GitHub secret, first commit, and optional cron test. ~10 minutes end-to-end.

Upgrading from v5.x? See BREAKING.md for the v6 migration guide.


Architecture

LayerTechnologyDescription
WorkflowClaude Code SkillsFive focused skills (see Skills below)
SpecCSpec YAMLStructured, human-readable compilable specifications
CompilerTypeScriptScene graph JSON → Figma Plugin API code (26 rules enforced)
TransportMCPfigma-console-mcp (preferred) or official Figma MCP server
TargetFigma Desktop / CloudProduction-ready designs in your real DS library
MemoryKnowledge BaseRegistries, guides, recipes, learnings — per-project
You describe → Claude writes CSpec → Compiler resolves tokens → MCP → Figma

Skills

SkillTriggerPurpose
using-bridgeSessionStart (auto)Force-loaded rules, command map, drop/status procedures
generating-figma-designmake <description>Spec + compile + execute + verify
learning-from-correctionsfixDiff Figma corrections, extract learnings, patch recipes
shipping-and-archivingdoneFinal gate, archive, extract recipes
extracting-design-systemsetup bridgeBootstrap a DS repo end-to-end

The compiler

Every scene graph JSON goes through a deterministic pipeline:

bridge-ds compile --input scene.json --kb <kb-path> --transport <console|official>
StagePurpose
ParseLoad scene graph JSON, validate schema
ResolveLook up every $token reference against the knowledge base registries
ValidateCheck structure, detect missing tokens with fuzzy suggestions, flag hardcoded values, validate requested variants against registry metadata
PlanChunk large graphs for transport limits; bridge nodeIds across chunks
GenerateEmit Figma Plugin API code respecting all 26 rules
WrapAdapt output for the target transport (console IIFE vs. official top-level await)

Errors are caught at compile time, before anything touches Figma.

Compiler reference → · Transport adapter → · Verification gates →

Bridge CLI

Direct CLI commands (typically invoked under the hood by skills):

CommandPurpose
bridge-ds setup --ds-name <name> --figma-key <key>Headless scaffold (used by setup bridge)
bridge-ds compile --input <json> --kb <path>Compile a scene graph JSON
bridge-ds doctorDiagnose config, connectivity, KB health
bridge-ds extract --headlessFigma REST extraction (CI-friendly, FIGMA_TOKEN required)
bridge-ds migrateUpgrade a legacy knowledge base to the current schema
bridge-ds cronRun the cron orchestrator (KB sync, opens PR on diff)

Recipes

Recipes are parameterized scene graph templates the compiler reuses across sessions. The fastest way to build one: generate a screen with make, then done to archive — Bridge auto-extracts a recipe when the layout is reusable.

Recipes live under bridge-ds/knowledge-base/recipes/ in your repo. Schema: { id, name, archetype, tags, scene_graph, confidence }. Each recipe is scored against the user's description on four axes (archetype match, tag overlap, structural similarity, confidence). High-scoring recipes pre-fill the CSpec.

Full schema: references/compiler-reference.md.

Project structure

bin/                                 CLI entry (bridge-ds binary)
lib/
  cli/                               Typed CLI (main, setup-orchestrator, token-handling, …)
  compiler/                          Scene graph compiler (TypeScript)
  config/                            YAML config parsing
  cron/                              GitHub Actions cron orchestrator (KB sync)
  extractors/                        Figma REST + MCP extractors
  kb/                                Knowledge base (registries, hashing, auto-detect)
  mcp/                               MCP transport adapter (console/official)

references/                          Shared repo-level references
  compiler-reference.md
  transport-adapter.md
  verification-gates.md
  red-flags-catalog.md

skills/
  using-bridge/                      Force-loaded process skill
  generating-figma-design/           make
  learning-from-corrections/         fix
  shipping-and-archiving/            done
  extracting-design-system/          setup

hooks/                               SessionStart health-line hook
scripts/                             validate-skills, bump-version
test/                                Integration + security tests

.claude-plugin/                      Claude Code plugin manifest
.cursor-plugin/                      Cursor plugin manifest

Plugin support

Bridge DS works as a plugin for:

  • Claude Code — Native skill via .claude-plugin/ and SessionStart hook injection.
  • Cursor — Plugin via .cursor-plugin/.

Both use the same MCP transport and compiler infrastructure.

Contributing

See CONTRIBUTING.md for development setup, code guidelines, and PR process.

License

MIT


Built by Noé Chagué — Design System @Finary

Files in the repo

Repository payload29 top-level entries
  • .claude-plugin
  • .cursor-plugin
  • .github
  • bin
  • docs
  • hooks
  • lib
  • packages
  • references
  • scripts
  • skills
  • test
  • .gitignore
  • .mcp.json
  • .npmignore
  • .nvmrc
  • .prettierignore
  • .prettierrc.json
  • BREAKING.md
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • eslint.config.js
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • SECURITY.md
  • tsconfig.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k