figma_generate_component_doc
Generate structured component documentation from Figma components by merging design details with optional source-code info, covering anatomy, variants, tokens, and design-code parity.
Instructions
Generate AI-complete component documentation from a Figma component. Produces structured markdown with anatomy, per-variant color tokens, typography, content guidelines (parsed from Figma description), icon mapping, spacing tokens, and design-code parity analysis. Merges Figma design data with optional code-side info (CVA definitions, sub-component APIs, source files). Output works with any docs platform. For richest output, read the component source code first and pass codeInfo.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"nodeId": "<nodeId>"
},
"name": "figma_generate_component_doc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enrich | No | Enable enrichment for token data | |
| nodeId | Yes | Component node ID (e.g., '695:313') | |
| fileUrl | No | Figma file URL. Uses current URL if omitted. | |
| codeInfo | No | Code-side documentation info. Read the component source code first, then fill in relevant sections. Include variantDefinition for CVA/variant code, subComponents for composable sub-parts, sourceFiles for all related files, and baseComponent for attribution. | |
| sections | No | Toggle which sections to include | |
| outputPath | No | Suggested output file path | |
| systemName | No | Design system name for headers | |
| includeFrontmatter | No | Include YAML frontmatter metadata |