generate-component-doc-figma

generate-component-doc-figma is a skill for Claude Code from southleft/skills-for-figma. It costs 150 tokens per session (1,292 once invoked), scanned A, a copy of figma-generate-component-doc, MIT.

A skill that turns a Figma component—a reusable design element such as a button or card—into Markdown documentation.

In plain words
What is it for?
Use it to prepare design handoff documentation and, when requested, compare the Figma design with its code version.
Why use it?
It records the component's layers, visual settings, versions, states, accessibility notes, and content rules in a consistent document.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the skills-for-figma plugin — 18 skills shipped together

Good fit Use it to prepare design handoff documentation and, when requested, compare the Figma design with its code version.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/southleft/skills-for-figma/generate-component-doc-figma
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add southleft/skills-for-figma --skill generate-component-doc-figma
Clone the repo
git clone --depth 1 https://github.com/southleft/skills-for-figma

Made for: Claude Code.

Or install skills-for-figma, the plugin that ships this one along with the rest of its 18 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-component-doc-figma

README.md
[![agentmods](https://agentmods.dev/badge/skills/southleft/skills-for-figma/generate-component-doc-figma/github.svg)](https://agentmods.dev/skills/southleft/skills-for-figma/generate-component-doc-figma)
Your own site
<a href="https://agentmods.dev/skills/southleft/skills-for-figma/generate-component-doc-figma"><img src="https://agentmods.dev/badge/skills/southleft/skills-for-figma/generate-component-doc-figma/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-component-doc-figma

Your own site · 80×15
<a href="https://agentmods.dev/skills/southleft/skills-for-figma/generate-component-doc-figma"><img src="https://agentmods.dev/badge/skills/southleft/skills-for-figma/generate-component-doc-figma.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,292 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00150 $0.01292
Opus 5.5 $0.00060 $0.00517
Sonnet 5.5 $0.00030 $0.00258
Haiku 4.5 $0.00015 $0.00129

Measured 1mo ago against content hash b0a55dea5169, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

generate-component-doc-figma scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/collect-component-data.js, scripts/generate-doc.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to figma-generate-component-doc — 12 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/generate-component-doc-figma/SKILL.md · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

generate-component-doc-figma — Figma component → Markdown docs

Produce a complete documentation page for one component or component set: overview, anatomy tree, design tokens, variants/states matrix, typography, accessibility, content guidelines, and (optionally) design-code parity and YAML frontmatter. This skill collects structured data from the file via use_figma, then a deterministic Node converter (scripts/generate-doc.mjs) emits the Markdown — the same collected JSON always produces identical Markdown. Do not freehand the doc from prose.

Skill boundaries

  • use_figma rules — load the official figma-use skill first; it is the full Figma Plugin API reference. Essentials these scripts rely on: plain JS with top-level await + return (no IIFE, no figma.closePlugin(); console.log is not returned), inputs inlined as const at the top of each script, colors in 0–1 range, load fonts before any text op, await figma.getNodeByIdAsync(...), and atomic errors (a failed script applies nothing — read the error, fix, retry).
  • The collect script runs anywhere (use_figma); the converter is Node and runs in a terminal (node scripts/generate-doc.mjs ...). Same split as export-tokens-figma. If you can't run Node, you can't produce the doc — say so rather than freehanding it.
  • Markdown section layout + the cleanVariantName rule → references/doc-template.md. The converter already implements every rule in that file; treat it as the spec, not a checklist for hand-assembly.
  • Reading/writing annotations as standalone specs → use the annotations-figma skill.
  • Exporting the whole token system (not just one component's tokens) → use export-tokens-figma.

Workflow

  1. Identify the target. Get the component or component-set node ID from the current selection or a URL/ID the user provides. Component sets (with variants) produce the richest docs. Set NODE_ID in the collect script. Also note the file URL (for the figma: link / frontmatter).
  2. Collect data → save JSON. Run scripts/collect-component-data.js via use_figma (skillNames: "generate-component-doc-figma"). It returns the anatomy tree, per-variant colors (with bound token id + name), typography (font family, numeric weight + name, size, line height, letter spacing), spacing tokens, component property definitions (variants/booleans/text props), the description, and annotations (with category names). Save the returned JSON to a file (e.g. collected.json).
  3. Generate the Markdown (deterministic). Run the Node converter in a terminal:
    node scripts/generate-doc.mjs collected.json [--code-info codeInfo.json] [--out docs/components/Button.md] [--frontmatter] [--file-url <figma-url>]
    
    It ports the source generator's section logic exactly: Overview (+ When to / When NOT to Use parsed from the description), Component Anatomy, Variants (matrix + icon mapping + configurable props), Token Specification (color + spacing tables), Typography, Content Guidelines, Accessibility, Design Annotations, and — with --code-info — Implementation, Design-Code Parity, and Changelog. cleanVariantName is applied automatically (Type=Image, Size=12 → Image / 12). Same input → identical output.
  4. Optional code parity. To add Implementation / Parity / [View Source] & [Storybook] links, read the component source and write a codeInfo.json (props, importStatement, sourceFiles, baseComponent, changelog, …), then pass --code-info codeInfo.json.
  5. Optional frontmatter. Pass --frontmatter to prepend YAML frontmatter (title, status, version, tags, figma URL, lastUpdated).
  6. Review & deliver. Read the emitted Markdown, sanity-check it, then write/return it. Report the path and a one-line summary (variant count, token count).

Read the full file on GitHub · 61 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 61 lines · 150 tokens per session scan A b0a55dea5169

Subscribe to this mod's changes

generate-component-doc-figma is a skill published in the GitHub repository southleft/skills-for-figma (20 stars, last pushed 4mo ago), licensed MIT. It adds 150 tokens to every session and 1,292 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 92% identical to figma-generate-component-doc, differing in 12 lines, and is treated as a copy.

Related

Other skills, from other repositories

accessibility-per-component

Audit one design system component's accessibility against WCAG 2.2 AA: keyboard, screen reader, contrast, focus, ARIA, target size. Trigger: a11y audit, is this accessible, WCAG check, screen reader support, keyboard navigation check. Not for page- or product-wide audits.

murphytrueman/design-system-ops · 68 tokens

figma-variable-audit

Audit Figma variable collections: tier mapping, naming, alias chains, modes, orphans; can fix in place with Figma Console MCP. Triggers: audit my Figma variables, review variable collections, Figma variable health. For token files in code use token-audit.

murphytrueman/design-system-ops · 63 tokens

theme-audit

Audit theme parity: tokens missing or unchanged per theme, component tokens bypassing semantics, contrast within each theme, resolver contexts, theme-switch regressions. Triggers: dark mode audit, theme coverage, brand variant parity. For general token structure use token-audit.

murphytrueman/design-system-ops · 57 tokens

token-audit

Audit how design tokens are defined: tiers, naming, alias chains, raw values, orphans, DTCG readiness. Triggers: audit my tokens, token architecture review, token health check. Not for code consuming tokens (token-compliance), theme parity (theme-audit) or Figma variables (figma-variable-audit).

murphytrueman/design-system-ops · 72 tokens

token-compliance

Find hardcoded colour, spacing and type values and wrong-tier token references in consuming code. Trigger: find hardcoded values, any hex in the code, are we using tokens correctly, token compliance. Do NOT use for token definitions — token-audit; token file format — schema-validator.

murphytrueman/design-system-ops · 62 tokens

ai-component-description

Write a six-section prose description (purpose, props, anti-patterns, composition, accessibility, examples) for a Figma component's description field so LLMs read it via MCP. Triggers: describe this component for AI, Figma MCP description. JSON metadata files: use metadata-schema-generator.

murphytrueman/design-system-ops · 65 tokens