figma_generate_component_doc
Generate structured Markdown component docs from a Figma component, including anatomy, color and spacing tokens, typography, content guidelines, annotations, 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), design annotations (animation timings, interaction specs, accessibility notes from Dev Mode), 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. Pass history: { figma: true, git: true } to add an ongoing '## History' section: per-version design changes pulled from Figma version history and scoped to this component, plus recent git commits touching its source files.
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. | |
| history | No | Pull an ongoing changelog from Figma version history and/or git. When enabled, replaces the manual '## Changelog' section with a richer '## History' section. Both sources are off by default so existing callers are unaffected. | |
| 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 |