ワンクリックで
mcp-figma
Figma CLI orchestrator: drives figma-ds-cli for terminal Figma design work, with an optional Figma MCP via Code Mode.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Figma CLI orchestrator: drives figma-ds-cli for terminal Figma design work, with an optional Figma MCP via Code Mode.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Routes non-trivial requests to matching skills through standalone MCP metadata and stable advisor tool ids.
Unified spec-folder workflow + context preservation: Levels 1-3+, validation, Spec Kit Memory. Required for file modifications.
OpenCode CLI orchestrator: external dispatch, in-OpenCode parallel sessions, cross-AI handback with full runtime context.
Shared deep-loop runtime: executor + prompt-pack + validation + atomic state + coverage-graph + Bayesian scoring + fallback routing.
Iterative codebase-context-gathering deep loop. Runs a configurable pool over a shared scope in parallel (native-only by default; optional heterogeneous CLI seats) and synthesizes a reuse-first Context Report for planning/implementation. Use before /speckit:plan or /speckit:implement to map existing code, integration points, and conventions.
Unified deep-loop workflow skill: routes a request to one of five modes (context, research, review, ai-council, improvement) over the shared deep-loop-runtime backend. Holds no per-mode logic — it dispatches by workflowMode through mode-registry.json. Use for codebase-context gathering, autonomous research, iterative code review, multi-seat AI Council planning, and evaluator-first agent/model/skill/non-dev-system improvement.
| name | mcp-figma |
| description | Figma CLI orchestrator: drives figma-ds-cli for terminal Figma design work, with an optional Figma MCP via Code Mode. |
| compatibility | Requires Figma Desktop (open with a file), Node.js >=18, and the silships figma-ds-cli on PATH. macOS is the supported baseline; the optional Figma MCP uses this project's Code Mode. |
| allowed-tools | ["Read","Bash","Grep","Glob","mcp__code_mode__call_tool_chain"] |
| version | 1.0.0.0 |
| user-invocable | true |
Drive Figma Desktop from the terminal through the silships figma-cli (published as figma-ds-cli) so a coding agent can read, author, modify, and export designs, tokens, and components, and optionally pull design context out of Figma through a Figma MCP via Code Mode. The CLI is the primary surface. The MCP is opt-in. Deep operational detail lives in references/figma_cli_reference.md.
Naming trap (read first). The silships tool publishes to npm as
figma-ds-cli(the unambiguous binary). The npm package literally namedfigma-cliis an UNRELATED tool (unic/figma-cli, binfigma), so nevernpm i -g figma-cli. Thefigma-clicommand only exists when installed from the silships repo (main, exposes bothfigma-ds-cliandfigma-cli). This skill usesfigma-ds-clias the canonical command throughout.Version trap. npm publishes only
figma-ds-cli@1.0.0, a minimal build with no--safe, nodaemon, noextractand ~12 commands. The full surface this skill documents (safe connect, daemon, extract/import, ~130 commands) is 1.2.0, available only from the silships repo. Install viascripts/install.sh(--source repo, or--source autowhich upgrades when npm is stale), then confirmfigma-ds-cli --versionis>= 1.2.0.
Use when the user wants to:
var:name binding, shadcn primitives.extract to DESIGN.md, export PNG/SVG/JSX/CSS/Tailwind/Storybook, screenshots, a11y audits.tokens.json, or Storybook.figma) through Code Mode.Keyword Triggers: "figma cli", "figma-ds-cli", "figma desktop", "render in figma", "figma tokens/variables", "extract DESIGN.md", "export from figma", "connect to figma", "figma daemon", "figma mcp".
Connect / setup (CLI). Verify the binary, choose a connect mode (safe plugin vs yolo patch), bring up the daemon, confirm health.
Inspect / export (CLI, read-only). List/find nodes, get properties, extract a DESIGN.md, export assets/CSS/Tailwind/JSX/Storybook, run a11y audits, none of which change the Figma document.
Author / modify (CLI, gated). Render JSX, create frames/components/icons, set properties, bind variables, generate variants. Every one changes the document and is gated.
Design-system / tokens (CLI, gated). Create token collections, import from Tailwind/CSS/tokens/Storybook, bind var:name.
Optional MCP context pull (Code Mode). When the agent needs Figma design context as model input (design data, variables, screenshots), call the Framelink figma manual through Code Mode.
Skip this skill when:
sk-code.sk-interface-design, and this skill is the transport.mcp-chrome-devtools.mcp-open-design.Detect the workflow direction first. Almost everything is the CLI, and the optional Figma MCP is opt-in and only when the agent must pull context FROM Figma.
# Direction detection (pseudo)
echo "$REQUEST" | grep -qiE 'mcp|code mode|design context|pull .*figma|get_design_context|figma-developer-mcp' && DIR="OPTIONAL_MCP"
# default for create/modify/export/tokens/connect/inspect:
: "${DIR:=CLI}"
# Binary detection (canonical = figma-ds-cli; figma-cli is ambiguous with an unrelated npm package)
command -v figma-ds-cli >/dev/null && BIN="figma-ds-cli"
[ -z "${BIN:-}" ] && command -v figma-cli >/dev/null && BIN="figma-cli" # verify it's silships, not unic/figma-cli
TASK CONTEXT
|
+- STEP 0: Verify the binary on PATH (figma-ds-cli, else silships figma-cli) + Figma Desktop open
+- STEP 1: Score intent -> CREATE_RENDER | DESIGN_SYSTEM_TOKENS | INSPECT_EXPORT | CONNECT_SETUP_DAEMON | MCP_CONTEXT | TROUBLESHOOT
+- Phase 1: Connect / daemon (safe default; yolo only on consent) [CONNECT_SETUP_DAEMON]
+- Phase 2: Inspect / export (read-only; explicit output paths, no overwrite) [INSPECT_EXPORT]
+- Phase 3: Author / modify / tokens (MUTATING -> gate; DESTRUCTIVE -> confirm+target+rollback) [CREATE_RENDER / DESIGN_SYSTEM_TOKENS]
+- Phase 4: Optional MCP context pull via Code Mode (Framelink figma) [MCP_CONTEXT]
+- Phase 5: Verify (daemon healthy, output captured, no unconfirmed mutation)
The router discovers markdown resources recursively from references/ and assets/, then applies intent scoring. References are the primary loaded resources. Assets are paste-ready snippets for the optional MCP path.
references/figma_cli_reference.md # CLI/daemon/connect model + command examples
references/tool_surface.md # read-only / mutating / destructive taxonomy + gating
references/mcp_wiring.md # optional Figma MCP (Framelink) via Code Mode
references/troubleshooting.md # failure modes + fixes
assets/utcp_figma_manual.md # paste-ready Framelink figma .utcp_config.json manual + .env note
assets/env_template.md # the prefixed figma_FIGMA_API_KEY .env line
| Level | When to Load | Resources |
|---|---|---|
| ALWAYS | Every invocation | references/figma_cli_reference.md (binary/daemon/connect baseline) |
| CONDITIONAL | Author/modify/tokens intent | references/tool_surface.md (gating taxonomy) |
| CONDITIONAL | MCP_CONTEXT intent | references/mcp_wiring.md (Code Mode Framelink path) |
| CONDITIONAL | Setup / error intent | references/troubleshooting.md |
| ALWAYS (design work) | A read/export feeds a design decision | sk-interface-design principles, applied before deciding |
Resilience pattern: see sk-doc smart-router template. Guard paths, discover at runtime, score intents, fall back when unsure.
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parent
RESOURCE_BASES = (SKILL_ROOT / "references", SKILL_ROOT / "assets")
DEFAULT_RESOURCE = "references/figma_cli_reference.md"
INTENT_MODEL = {
"CREATE_RENDER": {"keywords": [("create", 3), ("render", 4), ("frame", 3), ("component", 3), ("icon", 3), ("layout", 3), ("import", 3)]},
"DESIGN_SYSTEM_TOKENS": {"keywords": [("token", 4), ("variable", 4), ("var:", 4), ("collection", 3), ("shadcn", 3), ("design system", 4)]},
"INSPECT_EXPORT": {"keywords": [("inspect", 3), ("extract", 4), ("export", 4), ("screenshot", 3), ("DESIGN.md", 4), ("a11y", 3), ("audit", 3)]},
"CONNECT_SETUP_DAEMON": {"keywords": [("connect", 4), ("safe", 3), ("patch", 4), ("unpatch", 4), ("daemon", 4), ("diagnose", 3), ("reconnect", 3)]},
"MCP_CONTEXT": {"keywords": [("mcp", 4), ("code mode", 4), ("design context", 4), ("figma-developer-mcp", 4), ("pull", 2)]},
"TROUBLESHOOT": {"keywords": [("error", 4), ("failed", 4), ("not connected", 4), ("binary not found", 4), ("unauthorized", 3)]},
}
RESOURCE_MAP = {
"CREATE_RENDER": ["references/figma_cli_reference.md", "references/tool_surface.md"],
"DESIGN_SYSTEM_TOKENS": ["references/figma_cli_reference.md", "references/tool_surface.md"],
"INSPECT_EXPORT": ["references/figma_cli_reference.md", "references/tool_surface.md"],
"CONNECT_SETUP_DAEMON": ["references/figma_cli_reference.md", "references/troubleshooting.md"],
"MCP_CONTEXT": ["references/mcp_wiring.md", "assets/utcp_figma_manual.md", "assets/env_template.md", "references/figma_cli_reference.md"],
"TROUBLESHOOT": ["references/troubleshooting.md", "references/figma_cli_reference.md"],
}
UNKNOWN_FALLBACK_CHECKLIST = [
"Confirm the direction: drive the CLI (default) or pull context via the optional Figma MCP",
"Confirm figma-ds-cli is on PATH (NOT the unrelated npm 'figma-cli') and Figma Desktop is open",
"For any author/modify/delete, confirm the target node/file and that a mutation is intended",
"For destructive verbs, confirm an explicit target and a one-line rollback before running",
]
AMBIGUITY_DELTA = 1
def _guard_in_skill(relative_path: str) -> str:
resolved = (SKILL_ROOT / relative_path).resolve()
resolved.relative_to(SKILL_ROOT) # raises if path escapes the skill
if resolved.suffix.lower() != ".md":
raise ValueError(f"Only markdown resources are routable: {relative_path}")
return resolved.relative_to(SKILL_ROOT).as_posix()
def discover_markdown_resources() -> set[str]:
docs = []
for base in RESOURCE_BASES:
if base.exists():
docs.extend(p for p in base.rglob("*.md") if p.is_file())
return {d.relative_to(SKILL_ROOT).as_posix() for d in docs}
def classify_intents(request: str):
text = (request or "").lower()
scores = {i: 0 for i in INTENT_MODEL}
for intent, cfg in INTENT_MODEL.items():
for kw, w in cfg["keywords"]:
if kw in text:
scores[intent] += w
ranked = sorted(scores.items(), key=lambda kv: kv[1], reverse=True)
primary, top = ranked[0]
if top == 0:
return ("CONNECT_SETUP_DAEMON", None, scores) # unrouted -> start by verifying setup
secondary, second = ranked[1]
if second > 0 and (top - second) <= AMBIGUITY_DELTA:
return (primary, secondary, scores)
return (primary, None, scores)
def route_figma_resources(request: str):
inventory = discover_markdown_resources()
primary, secondary, scores = classify_intents(request)
intents = [primary] + ([secondary] if secondary else [])
loaded, seen = [], set()
def load_if_available(rel: str):
guarded = _guard_in_skill(rel)
if guarded in inventory and guarded not in seen:
load(guarded); loaded.append(guarded); seen.add(guarded)
load_if_available(DEFAULT_RESOURCE)
if max(scores.values() or [0]) < 1:
return {"intents": intents, "needs_disambiguation": True,
"disambiguation_checklist": UNKNOWN_FALLBACK_CHECKLIST, "resources": loaded}
for intent in intents:
for rel in RESOURCE_MAP.get(intent, []):
load_if_available(rel)
return {"intents": intents, "intent_scores": scores, "resources": loaded}
# Canonical binary = figma-ds-cli. The npm package 'figma-cli' is an UNRELATED tool (unic/figma-cli).
BIN=""
command -v figma-ds-cli >/dev/null && BIN="figma-ds-cli"
[ -z "$BIN" ] && command -v figma-cli >/dev/null && BIN="figma-cli" # only if installed from silships repo
[ -z "$BIN" ] && { echo "figma-ds-cli not found, see INSTALL_GUIDE.md (do NOT 'npm i -g figma-cli')"; exit 1; }
"$BIN" --version; "$BIN" --help | head -1
Figma Desktop must be open with a file, since figma-cli drives the live Desktop session (no Figma API key). Node >=18. macOS is the supported baseline.
figma-ds-cli connect --safe runs the FigCli plugin bridge, with no patch. Import plugin/manifest.json once, then keep Plugins → Development → FigCli open each session.figma-ds-cli connect patches Figma Desktop app.asar, codesigns on macOS, restarts Figma with CDP on port 9222. May need Full Disk Access/admin and breaks when Figma updates. Never run without explicit consent + a stated rollback (figma-ds-cli unpatch).127.0.0.1:3456 (not a socket), auth via X-Daemon-Token at ~/.figma-ds-cli/.daemon-token, PID ~/.figma-cli-daemon.pid, idle ~60 min, not reboot-persistent. Verbs: daemon status | diagnose | start | stop | restart | reconnect. "Unauthorized" → daemon diagnose then daemon restart (never auto-delete the token).The full per-command taxonomy lives in references/tool_surface.md. Summary:
status, var list/find, get, find, inspect, node tree, extract, export*, export-jsx, export-storybook, analyze*, a11y*, files, --dry-run variants. (Local exports still write files, so require an explicit output path, never silently overwrite.)create*/render*/tokens */var create|bind|set|rename|visualize, bind *, set *, layout verbs, duplicate, use/theme, node to-component, slot/sizes/variants/combos, shadcn add, import, lint --fix, screenshot-url, recreate-url, gradient mesh. App-level: connect, unpatch, daemon start/stop/restart, config set, init-agent.var delete-all, var delete-batch, delete/remove, node delete, undo, unwrap, fj delete, plugins uninstall, dev unlink, component prop delete, grid clear, annotate clear.eval, raw, run.The skill works fully with the CLI alone. When the agent must pull design context FROM Figma, use the Framelink figma manual already registered in Code Mode (figma-developer-mcp, stdio, needs a Figma personal token). Calls go through call_tool_chain() with naming figma.figma_<tool>. The token must be in .env as figma_FIGMA_API_KEY (Code Mode prefixes the manual name). Always discover first with search_tools() / tool_info() before invoking. Full detail + the snippet: references/mcp_wiring.md.
figma-ds-cli, and only use figma-cli if it resolves to the silships tool (--version/--help), since the npm figma-cli package is unrelated. Fail closed with install guidance if neither is the silships tool.daemon status/diagnose; endpoint 127.0.0.1:3456, token present).connect --safe for setup, and treat the yolo patch as a gated, consented action.eval, raw, and run as arbitrary mutation, reviewing the code/command before running, even when the prompt sounds exploratory.extract/export/export-jsx) and never silently overwrite existing files.sk-interface-design when a Figma read/export feeds a design decision. This skill owns the transport, and that skill owns the taste.npm i -g figma-cli, because that installs the unrelated unic/figma-cli. Install figma-ds-cli (npm) or the silships repo.app.asar patch without explicit consent and a stated figma-ds-cli unpatch rollback. Never patch during install or routine startup.~/.figma-ds-cli/.daemon-token) in user-facing output, and keep all local services bound to 127.0.0.1.init-agent by default, because it writes AGENTS.md/.cursor/rules into the working repo.list_tools()/tool_info()) confirms the figma manual and its tool names.figma-ds-cli (npm) or the silships repo build. Do not guess.eval/raw/run is requested, describing the effect + rollback, then wait for confirmation..env (figma_FIGMA_API_KEY) requirement. Do not paste credentials.eval/raw/run rule, and the export no-overwrite rule.figma) via Code Mode: the registered manual, the .env token, discovery, and a call_tool_chain example.figma .utcp_config.json manual entry, the .env note, and a call_tool_chain example for the optional Code Mode path.figma_FIGMA_API_KEY .env line for the optional Figma MCP token.figma_cli_reference.md is the baseline (always). Load tool_surface.md for author/modify/token work, mcp_wiring.md only for MCP intent, troubleshooting.md for setup/errors.assets/ snippets only for MCP_CONTEXT intent, alongside mcp_wiring.md.Connect complete when:
figma-ds-cli or confirmed-silships figma-cli), Figma Desktop is open, the chosen connect mode ran, and daemon status is healthy.Read / export complete when:
Author / modify complete when:
get/verify).Optional MCP context complete when:
figma manual + tool names, the token was configured, and the context was pulled without claiming unverified tools.Always:
figma-ds-cli operations (connect, daemon, inspect, export, author, tokens).mcp__code_mode__call_tool_chain) owns the optional Figma MCP calls (Framelink figma).sk-interface-design owns the design judgment and is applied whenever a Figma read/export feeds a design decision (grounding, token/type/layout choices). This skill is the transport, and that skill is the taste.sk-code owns adapting extracted tokens / DESIGN.md / exported code into a real application, and verifying it.mcp-chrome-devtools is used only for a last-mile browser preview of an implemented page, never to operate Figma.figma-ds-cli) or the silships repo, and see INSTALL_GUIDE.md. Requires Figma Desktop open. Not vendored into this repo.figma-developer-mcp manual already in this project's Code Mode .utcp_config.json, which needs figma_FIGMA_API_KEY in .env.Required: references/figma_cli_reference.md (binary/daemon/connect baseline). Conditional: tool_surface.md (gating), mcp_wiring.md (MCP), troubleshooting.md (errors).
The router (Section 2) discovers reference and asset docs dynamically. Start from references/figma_cli_reference.md for the CLI/daemon/connect model, load references/tool_surface.md for the gating taxonomy, references/mcp_wiring.md for the optional Code Mode path, and references/troubleshooting.md for failures. References stay the primary loaded resources.
Assets: assets/utcp_figma_manual.md (paste-ready Framelink figma .utcp_config.json manual + .env note) and assets/env_template.md (the prefixed figma_FIGMA_API_KEY line), loaded only for the optional MCP_CONTEXT path.
Scripts: scripts/install.sh (install + verify), scripts/doctor.sh (report-only diagnostics), scripts/connect-safe.sh, scripts/connect-yolo.sh, scripts/daemon.sh, scripts/unpatch.sh, scripts/print-utcp-snippets.sh.
Related skills: sk-interface-design (the design judgment, applied whenever a read/export feeds a decision), sk-code (adapting exports into an app), mcp-code-mode (the optional MCP transport), mcp-open-design (sibling terminal-driven design tool), mcp-chrome-devtools (browser preview only), and system-spec-kit when packet documentation or memory continuity applies.
Install guide: INSTALL_GUIDE.md.
Upstream: figma-cli is silships/figma-cli (npm figma-ds-cli, MIT). The optional MCP is the community Framelink figma-developer-mcp. This skill documents driving the installed tool from the terminal, and it does not vendor or redistribute it.