component_map
Map Figma component instances to existing local code components for reuse. Joins grounded Figma names with project AST to find matches and reports missing props.
Instructions
Map the Figma component instances in a selection/subtree to existing local code components, so they can be reused instead of regenerated. Joins the grounded Figma component names (and their variant axes) against an AST scan of the project; an explicit docs/figma-component-map.md row overrides the fuzzy match. Each distinct component is mapped once with all its instance ids. A mapped candidate also reports matchedProps (Figma axes the component already has) and unmatchedProps (axes it lacks → component-extension TODOs). Returns { mappings (candidate + confidence + status high/medium/low/unmapped), unmapped, profile }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | No | Root node id; omit to use the selection or current page | |
| rootDir | No | Project root to scan; defaults to the server cwd | |
| threshold | No | Confidence at/above which a match counts as a reliable reuse (default 0.7) |