Summary
Figma REST component and component-set metadata includes a description string, but Specs generation does not preserve it. Please add an optional component-level description field to the Specs schema and populate it from the selected Figma source record.
This would let generated specifications retain component guidance already authored in Figma without requiring consumers to maintain an out-of-schema companion artifact.
Current behavior
For a selected source node, the Figma file response exposes descriptions in one of two maps:
- A standalone
COMPONENT uses file.components[nodeId].description.
- A
COMPONENT_SET uses file.componentSets[nodeId].description.
Generated component output records the same node in metadata.source.nodeId and metadata.source.nodeType, but does not emit its description. The current Component schema has no description property and rejects additional root properties, so a consumer cannot add the value to api.yaml while retaining schema conformance. The configured transformer registry also provides no custom generation hook for this field.
A concrete example from our repo is Figma component-set node 3288:1275. Its REST metadata contains:
Radio Buttons allow users to select a single option from a set of multiple choices. Once selected, an option cannot be deselected without choosing another.
The generated Radio api.yaml identifies node 3288:1275 but contains no corresponding description.
Proposed schema
Add an optional string to the component definition:
export interface Component {
title: string;
description?: string;
// existing fields
}
Equivalent JSON Schema shape:
{
"description": {
"type": "string",
"minLength": 1
}
}
Mapping rules
- Use the source node selected for the generated component.
- For
COMPONENT_SET, read componentSets[nodeId].description.
- For
COMPONENT, read components[nodeId].description.
- Trim leading and trailing whitespace.
- Omit
description when the source value is absent or whitespace-only; do not emit an empty string.
- Preserve meaningful internal line breaks and Unicode.
- With split concerns enabled, place
description in api.yaml because it describes the component API/documentation surface rather than variants, examples, or styling.
- With non-split output, place it on the component root.
Compatibility
The field is optional and additive. Existing documents remain valid, existing consumers can ignore it, and generators continue producing the same output for Figma components without descriptions.
Acceptance criteria
- The Component TypeScript type and JSON Schema expose
description?: string.
- Figma REST generation covers both
COMPONENT and COMPONENT_SET source records.
- Split-concern generation writes the field to
api.yaml.
- Non-split generation writes the field to the component root.
- Empty descriptions are omitted.
- Multiline and Unicode descriptions round-trip through YAML and JSON serialization.
- Schema, transformer, split-output, and documentation tests cover the new field.
- The Component schema documentation and generate command documentation describe the behavior.
Consumer workaround
Until native support is available, our repo generates a schema-valid description.yaml beside each api.yaml, joined through metadata.source.nodeId and metadata.source.nodeType. Native support would allow that companion generator to be removed without migrating the description content itself.
Summary
Figma REST component and component-set metadata includes a
descriptionstring, but Specs generation does not preserve it. Please add an optional component-leveldescriptionfield to the Specs schema and populate it from the selected Figma source record.This would let generated specifications retain component guidance already authored in Figma without requiring consumers to maintain an out-of-schema companion artifact.
Current behavior
For a selected source node, the Figma file response exposes descriptions in one of two maps:
COMPONENTusesfile.components[nodeId].description.COMPONENT_SETusesfile.componentSets[nodeId].description.Generated component output records the same node in
metadata.source.nodeIdandmetadata.source.nodeType, but does not emit its description. The current Component schema has nodescriptionproperty and rejects additional root properties, so a consumer cannot add the value toapi.yamlwhile retaining schema conformance. The configured transformer registry also provides no custom generation hook for this field.A concrete example from our repo is Figma component-set node
3288:1275. Its REST metadata contains:The generated Radio
api.yamlidentifies node3288:1275but contains no corresponding description.Proposed schema
Add an optional string to the component definition:
Equivalent JSON Schema shape:
{ "description": { "type": "string", "minLength": 1 } }Mapping rules
COMPONENT_SET, readcomponentSets[nodeId].description.COMPONENT, readcomponents[nodeId].description.descriptionwhen the source value is absent or whitespace-only; do not emit an empty string.descriptioninapi.yamlbecause it describes the component API/documentation surface rather than variants, examples, or styling.Compatibility
The field is optional and additive. Existing documents remain valid, existing consumers can ignore it, and generators continue producing the same output for Figma components without descriptions.
Acceptance criteria
description?: string.COMPONENTandCOMPONENT_SETsource records.api.yaml.Consumer workaround
Until native support is available, our repo generates a schema-valid
description.yamlbeside eachapi.yaml, joined throughmetadata.source.nodeIdandmetadata.source.nodeType. Native support would allow that companion generator to be removed without migrating the description content itself.