extract-contract

A design-to-code specification generator for a selected Figma component set, variant, or instance. It produces a JSON file describing the component’s properties, structure, design tokens, variants, and accessibility contrast.

In plain words
What is it for?
Use it to document Figma components for developers or to provide structured input for code generation.
Why use it?
It gathers the design details needed for implementation in one consistent specification, reducing manual inspection and handoff mistakes.

Skill for Claude CodeCodex

Part of the figma-mcp-bridge plugin — 28 skills, 11 commands, 4 agents, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/atezer/fmcp/extract-contract
Any agent
npx skills add atezer/FMCP --skill extract-contract
Clone the repo
git clone --depth 1 https://github.com/atezer/FMCP

Made for: Claude Code, Codex.

Or install figma-mcp-bridge, the plugin that ships this one along with the rest of its 28 skills, 11 commands, 4 agents, 1 MCP server.

Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00089 $0.01817
Opus 5 $0.00044 $0.00908
Sonnet 5 $0.00018 $0.00363
Haiku 4.5 $0.00009 $0.00182

Measured 3d ago against content hash f42ce8089b38, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

extract-contract scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/extract-contract/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Contract Extractor

Seçili bir Component Set'i (veya içindeki bir variant'ı / instance'ını) analiz ederek tam bir design contract JSON spec üret. Contract; props, anatomy (token bindings), variant overrides, resolved tokens (mode bazlı alias chain), base specs ve WCAG kontrast denetimini tek dosyada toplar — design-to-code handoff'un ve bileşen codegen'inin tek doğruluk kaynağıdır.

Tetikleme

Kullanıcı bir Component Set (veya içindeki bir variant) seçtiğinde ya da nodeId/URL verdiğinde ve şu ifadeleri kullandığında: "contract çıkar", "JSON spec üret", "contract extract", "bileşen speci", "design contract", "component spec".

Birincil Yol — figma_extract_contract (tek çağrı)

v1.9.14+ sunucuda bu iş tek araca indirgendi:

figma_extract_contract({ nodeId?: "12:345", figmaUrl?, fileKey?, importPathTemplate? })
  • nodeId verilmezse aktif Figma seçimi kullanılır. COMPONENT_SET, COMPONENT veya INSTANCE kabul edilir (variant/instance otomatik set'e çözülür).
  • Araç 3 aşamalı okur: structure (props + default variant ağacı) → overrides (her variant değerinin default'a karşı token diff'i) → tokens (tüm mode'larda alias-chain çözümü). Birleştirme sunucu tarafında yapılır.
  • Dönüş: { success, contract, report }.
    • contract — aşağıdaki şemada tam spec (status: "draft").
    • report — prop sayısı, çözülen token sayısı, a11y fail sayısı, orphan prop listesi, önerilen dosya adı.
  • importPathTemplate ile anchors.code.importPath şablonu değiştirilebilir (default @ds/components/{Name}).

Araç çıktısında otomatik olan davranışlar

  • Boolean-like variant: Seçenekleri tam olarak True/False olan VARIANT prop'ları boolean tipine ve is prefix'li camelCase ada çevrilir (SelectedisSelected).
  • State detection: "State" / "Durum" / "Interaction" adlı variant prop değerleri states dizisine normalize edilir (pressedactive, focusfocus-visible).
  • Semantic naming: Generic adlar (Frame 1, Group 2) bağlama göre anlamlı ada çevrilir (label, divider, content); instance'lar main component set adının kebab-case halini alır; çakışmalar -2 soneki alır.
  • A11y kontrast: Her stil varyantı için root background × text foreground token çifti tüm renk mode'larında (Light/Dark vb.) WCAG 2.1 oranıyla hesaplanır. Alpha'lı renkler alpha-blend edilir (opak varsayımı yapılmaz — 8 haneli hex'lerde oran bu yüzden daha düşük/doğru çıkabilir). Şeffaf zeminli stiller (ghost/clear) çift üretmez.
  • Orphan tespiti: Default variant ağacında hiçbir katmanın referans vermediği BOOLEAN/TEXT/INSTANCE_SWAP prop'ları rapora yazılır.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 96 lines · 89 tokens per session scan A f42ce8089b38

Subscribe to this mod's changes

extract-contract is a skill published in the GitHub repository atezer/FMCP (9 stars, last pushed 1mo ago), licensed MIT. It adds 89 tokens to every session and 1,817 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

system-pitch

Write a design system investment pitch with a business case and ROI framing. Trigger when someone says: pitch the design system, make the case for the system, sell this to leadership, justify the investment, business case for design systems, why should we invest in a design system, or anything about building an…

murphytrueman/design-system-ops · 72 tokens

token-audit

Audit a design system's token definitions for naming violations, missing semantic tiers, and structural debt. This audits how tokens are defined and organised, NOT how they are consumed in code. Trigger when someone says: audit my tokens, token naming review, are my tokens consistent, token health check, review my…

murphytrueman/design-system-ops · 93 tokens

ai-component-description

Generate AI-optimised text descriptions for components, formatted for Figma's MCP server and LLM consumption. This produces prose descriptions in a six-section format (purpose, props, anti-patterns, composition, accessibility, examples), NOT JSON schemas or structured data files. Trigger when someone says: write…

murphytrueman/design-system-ops · 132 tokens

context-engine-builder

Generate a context engine — seven structured blueprint files (UX, UI, content, accessibility, ethical, technical, business intelligence) that encode everything an AI agent needs to work with a design system. This produces YAML infrastructure in .ai/context-engine/, NOT a health score or quality assessment. Trigger…

murphytrueman/design-system-ops · 135 tokens

stakeholder-brief

Write a one-page stakeholder brief translating design system health or status into business language. Trigger when someone says: stakeholder update, exec brief, leadership summary, status report for leadership, system status for non-designers, write a brief for the business, or anything about communicating design…

murphytrueman/design-system-ops · 73 tokens

token-compliance

Check a codebase or implementation for token compliance — finding hardcoded values, wrong-tier token references, and inconsistent token application in consuming code. This checks how tokens are used in code, NOT how the tokens themselves are defined or structured. Trigger when someone says: are we using tokens…

murphytrueman/design-system-ops · 120 tokens