Generate markdown documentation from a Figma component URL. Triggers on "/figma-to-markdown", "document this component", or "generate docs from Figma".
Generate structured markdown documentation from a Figma component using the existing documentation generation pipeline.
/figma-to-markdown <figma-url>
/figma-to-markdown https://figma.com/design/ABC123/File?node-id=1:234
Takes a Figma component URL and generates comprehensive markdown documentation including:
The generated documentation follows the structure defined in templates/component.md. Always ensure output matches this template format including:
Check that a Figma URL was provided as an argument:
https://figma.com/... or https://www.figma.com/...Valid URL formats:
https://figma.com/design/ABC123/File-Name?node-id=1:234https://www.figma.com/file/ABC123/File-Name?node-id=1:234https://figma.com/design/ABC123/branch/XYZ/File?node-id=1:234Verify the FIGMA_TOKEN environment variable is set:
echo $FIGMA_TOKEN
If not set, inform the user:
FIGMA_TOKEN environment variable is required.
Set it with: export FIGMA_TOKEN=your_token_here
Execute the generate script with the provided URL:
npm run docs:generate -- --url="<figma-url>"
The script will:
docs/components/{atoms|molecules|organisms}/After generation completes:
name, description, category, status, version, updatedtokens (colours, spacing, typography)accessibility infoAdd an entry to CHANGELOG.md with today's date:
## {Date}
| Change | Type | JIRA | Figma | Notes |
|--------|------|------|-------|-------|
| Generated documentation for {ComponentName} | š¢ Added | NA | [Figma]({figma-url}) | Auto-generated via /figma-to-markdown |
If updating existing documentation, use:
| Updated documentation for {ComponentName} | š” Updated | NA | [Figma]({figma-url}) | Regenerated via /figma-to-markdown |
Summarize what was generated:
Generated file: docs/components/{category}/{component-name}.md
The documentation follows the standard GDS format with:
"FIGMA_TOKEN environment variable is required"
export FIGMA_TOKEN=your_token"Invalid Figma URL"
node-id parameterhttps://figma.com or https://www.figma.com"Node not found"
"Rate limit exceeded"
/figma-to-markdown https://figma.com/design/ABC123/GDS?node-id=1:234
Output:
ā Successfully generated: docs/components/atoms/button.md
Component: Button
Category: atoms
/figma-to-markdown https://figma.com/design/ABC123/GDS?node-id=5:678
Output:
ā Successfully generated: docs/components/molecules/card.md
Component: Card
Category: molecules
/figma-make-guidelines - Generate Tailwind configuration from foundations/project-summary - Update project summary with documentation coverage