
create-component-md produces one markdown file per component, covering API, structure, color, and screen-reader behavior. The file is the artifact: LLM tools can build from it, and humans can query it. The other uSpec skills render documentation back into Figma; this one writes a portable spec to disk.
The
.md output works with any LLM workflow: Claude in Cursor, Claude Design, GPT agents, Gemini, local models, and anything else that reads Markdown.What it generates
A singlecomponents/{componentSlug}.md file with five sections:
| Section | Content |
|---|---|
| Overview | Component name, variant axes summary, and composition (constitutive and referenced children) |
| API | Properties, values, defaults, required vs. optional, sub-component tables, and configuration examples |
| Structure | Dimensions, spacing, padding, and sub-component variant walks across every size and density |
| Color | Per-element token mapping for fills, strokes, and effects across every variant |
| Voice / Screen reader | Focus order, merge analysis, and platform tables for VoiceOver, TalkBack, and ARIA |
What you need
This skill runs in two steps: extract, then generate. You need both pieces set up once.Install the uSpec Extract plugin
The plugin produces a This produces
_base.json file that captures every variant, token binding, and sub-component in one pass. Build it locally and import it into Figma Desktop.npx uspec-skills installs only the AI skills into your project. The Figma plugin is a separate piece that has to live inside Figma Desktop. Cloning the uSpec repo is the supported way to get the plugin source today.Clone the uSpec repository
Clone uSpec anywhere on your machine — it does not need to be inside the project where you ran
npx uspec-skills init. The plugin only needs to live somewhere Figma Desktop can reach to import the manifest.Build the plugin
dist/code.js and dist/ui.html next to the manifest. Both files are required for the import in the next step.Import the manifest
In Figma Desktop, go to Plugins → Development → Import plugin from manifest… and select
uSpec/figma-plugin/manifest.json from your local clone.For Node version requirements, the watch-mode dev loop, and common failure modes, see the Figma Extract plugin troubleshooting tab.
Set up uSpec
You also need the
create-component-md skill. From your project root, run npx uspec-skills init and choose your agent host (Cursor, Claude Code, or Codex). The CLI installs every skill — including create-component-md — into the platform-specific directory. If you have not set up your agent host yet, follow Getting Started. The Component Markdown path does not require Figma MCP setup or firstrun — those are only needed for the Figma-native skills.How to use
Extract the component
In Figma:
- Select a single
COMPONENTorCOMPONENT_SET. Selecting a variant auto-promotes to its component set. - Run Plugins → uSpec Extract (or Plugins → Development → uSpec Extract if you dev-installed).
- Review the sub-component checklist. The plugin pre-guesses whether each child is constitutive (owned by this component) or referenced (an instance of a widely-reused component). Flip any guess you disagree with.
- Optionally paste design intent, open questions, or constraints into the text area.
- Click Extract & download to save
{componentSlug}-_base.jsonto~/Downloads/, or Copy JSON to put the full payload on your clipboard.
When the run finishes, a new
.md appears under ./components/ in the working directory (e.g., components/text-field.md). Open it to verify the five sections are populated and the Provenance block at the bottom references your Figma file.Optional: pair with a Figma link
If you pass a Figma URL alongside the JSON, the agent can run a targeted measurement delta when a sub-skill flags a gap:How it works
The skill runs a four-way interpretation pipeline against the_base.json produced by the extractor. The deterministic reconciliation loop catches cross-section disagreements before the .md is written.
Deterministic extraction
Parallel AI interpretation
Reconciliation gate
Preflight
The orchestrator validates
_base.json against the plugin schema, stages it into .uspec-cache/{componentSlug}/, and reviews any designer-in-the-loop classifications from the plugin.API dictionary (solo)
extract-api runs first, inline in the parent context. It produces the component’s property dictionary and writes api-dictionary.json. The dictionary keeps the three downstream specialists aligned on property names and state vocabularies.Parallel fan-out
The orchestrator dispatches
extract-structure, extract-color, and extract-voice as three parallel subagents in a single batch. Each specialist holds its own _base.json and dictionary context; the parent only keeps the returned summaries.Reconciliation
The orchestrator compares the three specialist artifacts for typed disagreements (conflicting child classifications, mismatched axes, missing states). When the
reconciliation.autoRetry flag is on, the offending specialist is re-dispatched with the mismatch attached, up to a bounded retry count.Integrity check
Before rendering, the orchestrator validates every cache file’s shape, cross-checks axis consistency, and confirms the structure coverage matrix is complete.
Using the output with LLMs
The generated.md is self-contained. Hand it to any LLM as context and ask it to:
- Implement the component in React, SwiftUI, Jetpack Compose, or your platform of choice.
- Generate unit tests that cover every documented state and variant.
- Write platform-specific accessibility code from the Voice section tables.
- Build a Storybook file with one story per variant axis value.
- Create a design-review checklist from the Known gaps block.
What the plugin captures
The extractor walks every variant and resolves every binding, which is what makes the.md pixel-perfect:
- Every variant. No default-variant sampling. Cross-variant diffs and axis classification are computed inside the plugin sandbox.
- Library-linked variables with name,
codeSyntax, alias chains, and remote collection metadata. - Inline font properties alongside text style IDs, so typography survives when a library style cannot be resolved.
- Sub-components walked across their own variant axes. A Button inside a Text Field is measured across its own size and density variants, not only the configuration the parent embeds.
- Designer-in-the-loop classification. You confirm or flip whether each top-level child is constitutive, referenced, or decorative before extraction runs.
_base.json contract.
Tips for better output
- Use Opus 4.7 High or better. Lower-capacity models may truncate mid-reconciliation and leave one of the four sections incomplete.
- Start a fresh agent session for every run. Accumulated history reduces available context. This skill uses parallel subagents and works best with a clean session.
- Review the plugin’s sub-component checklist carefully. The downstream spec inherits your classifications. Getting constitutive vs referenced right saves reconciliation cycles.
- Add design intent in the plugin’s text area when a component has behavior that is not visible in the static design: focus-order intent, conditional states, or platform-specific variants.
- Run the plugin on the component set, not a single variant. The plugin auto-promotes selected variants to their set, but starting from the set makes the axes explicit.
- Diff the
.mdbetween runs. After a design change, re-extract and re-generate. The resulting diff is a clean record of what changed semantically, not just pixel-wise.
Troubleshooting
The accordions below cover issues with the generated.md itself. For plugin install or build issues — Figma can’t find the plugin, npm run build fails, the canvas selection is rejected — see the Figma Extract plugin troubleshooting tab.
Validation error: _base.json does not match schema
Validation error: _base.json does not match schema
The plugin output failed Ajv schema validation.
- Confirm the plugin version matches the skill version. If you updated one without the other, the schema can drift.
- Re-run the plugin and try again.
- If the problem persists, run the validator directly to see the full diagnostic:
The generated .md has `—` in structure cells
The generated .md has `—` in structure cells
The structure section renders
— when the plugin could not measure a sub-component variant.- Confirm the sub-component checklist in the plugin marks the missing child as constitutive. Referenced children intentionally skip deep measurement.
- If the sub-component has more than 20 variant combinations, the extractor caps the walk and emits a
skippedmarker. For very large sub-components, document them in their owncreate-component-mdrun and reference the resulting file.
One section (e.g., Voice) is noticeably shorter than the others
One section (e.g., Voice) is noticeably shorter than the others
A specialist may have hit a reconciliation budget limit.
- Check the Known gaps block at the top of the
.md. Unresolved reconciliation items are listed there. - Re-run on a higher-capacity model, or re-run with
reconciliation.autoRetryset totrueinuspecs.config.json.
Token cost is higher than 200k
Token cost is higher than 200k
Very complex components (many variants, many sub-components, or large property matrices) can exceed the typical range.
- Break the component into smaller units and spec them separately.
- For compound components, spec the parent and reference the children rather than re-specifying each child inline.
Related
Getting Started
Install your agent host (Cursor, Claude Code, or Codex). The Component Markdown path skips MCP and template library setup.
How It Works
See the two rendering paths uSpec supports and where this skill fits.
Plugin troubleshooting
Build, install, and recovery instructions for the uSpec Extract plugin.
Screen reader spec
Render VoiceOver, TalkBack, and ARIA tables directly into Figma.