figma-design-build
Skill1 starsChanged 5 months agoMITView on GitHub
Build, design, edit, or read designs in Figma through the Figma MCP (the cloud connector: use_figma plugin-API calls + get_screenshot feedback loop), and do design-to-code. Use whenever the task is to create or change a Figma file, mock up a UI / logo / infographic / design system, build Figma styles or components, or pull a Figma design into code. Encodes the hard-won rules: server-side font limits, load-before-edit, page/layer access, geometry and shear math, styles + components, and organize-as-you-go layer hygiene so the file is clean by construction, not cleaned up after.
In this repository8 other files it gives its agents.
- after-effects-extendscriptSkill
- claude-code-hooksSkill
- cloudflare-pages-deploySkill
- kie-image-editSkill
- langgraph-agentSkill
- langsmith-evalsSkill
- n8n-figma-workflow-mapSkill
- video-app-walkthroughSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Design-to-code: read an existing design with get_design_context / get_metadata / get_screenshot, or capture a web page with …
- Very specific: line 45
Foundations first: Create paint / text / effect styles (guard by name to avoid duplicates).
- Very specific: line 47
Build, named + bound + grouped as you go: Use a reusable helper block (assets/helpers.js) for rect, roundedRect, text, chip, shadows, shear …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Figma design + build via the MCP
The Figma MCP runs JavaScript against the Figma Plugin API (use_figma) and renders server-side. You drive it like a headless design tool and verify with get_screenshot. This skill is the operating manual: the loop, the limits, and the hygiene.
Two modes
- Build from scratch / edit (the common case): author UI, logos, infographics, design systems with
use_figma, verifying each step withget_screenshot. This is most of this skill. - Design-to-code: read an existing design with
get_design_context/get_metadata/get_screenshot, or capture a web page withgenerate_figma_design. Seereference/07-design-to-code.md.
Before you touch a tool
- Many Figma tools are deferred. Load their schemas with ToolSearch first (e.g.
select:mcp__claude_ai_Figma__use_figma,mcp__claude_ai_Figma__get_screenshot,mcp__claude_ai_Figma__whoami). - The server instructions say load the
/figma-useskill beforeuse_figmawhen it exists. If it is not installed, proceed using this skill's rules. - Confirm the account with
whoami(returns theplanKeyyou need to create files). Right account matters: edits fail silently on a view-only account. Seereference/01-setup-and-auth.md.
Core principles (do not skip)
- The screenshot loop is the work. Build a small piece,
get_screenshot, read it, fix, repeat. Never author a large design blind. Hand-authoring without rendering is how you ship ugly.reference/06-screenshot-loop.md. - Fonts render server-side from Figma's built-in library (Google Fonts). Locally-installed / Adobe Creative Cloud fonts are invisible to the cloud MCP, even when the user has them. If a brand font is not in the library, mock with the closest available twin and ship the real font in production. Always
loadFontAsyncbefore setting or editing any text.reference/02-fonts.md. - Organize and label as you go, never as an afterthought. This is a requirement, not a nicety:
node.name = "..."on every node you create (text → its content, rects → their role:bg,divider,card). DefaultRectangle/Textnames are not acceptable.- Build each section inside a named container (frame or group), or group it the moment the section is finished. Use stable section names (
Nav,Hero,Stat band, ...). - Bind to styles from the first draw (
fillStyleId,textStyleId,effectStyleId), not after. If the design system does not exist yet, create the styles first, then build against them. - Name components semantically with
/folders (Logo/Mark,Button/Primary,Model-chip/Haiku). A file built this way needs no cleanup pass.reference/05-pages-and-layers.md.
- Verify state before mutating.
await figma.setCurrentPageAsync(page)before readingpage.children(otherwise it returns[]). Noteuse_figmaoften reports "Code executed with no return value" even with a trailing expression — do not rely on its return. Name every node you create, then retrieve ids afterward withget_metadataon the parent frame (find by name). Seereference/08-gotchas.md. - Text needs breathing room inside its container. Never set text flush to a box edge. Either size the box to the text plus padding (measure
t.width/t.heightafter settingcharacters, thenbox.resize(t.width + 2*padX, t.height + 2*padY)), or, for a fixed-size box, verify the longest label fits with margin before committing. A centered label in a fixed box silently clips or kisses the edges the moment the content is wider than you guessed. Sensible minimums: ~14-16px horizontal and ~10-12px vertical for pills/chips/buttons; more for cards. Build boxes from content, not content into boxes. (assets/helpers.jspill()does this for you.)
Standard playbook (build-from-scratch)
whoami→ account +planKey.create_new_fileif needed → capturefileKey.- Foundations first. Create paint / text / effect styles (guard by name to avoid duplicates). This locks the palette + type ramp and makes step 4 bindable.
reference/04-styles-and-components.md. - Discover fonts you intend to use with
listAvailableFontsAsyncfiltered to your candidates; record exact style names (they vary:Semi BoldvsSemiBold).loadFontAsyncall of them up front. - Build, named + bound + grouped as you go. Use a reusable helper block (
assets/helpers.js) forrect,roundedRect,text,chip, shadows, shear bars, etc. Draw backgrounds before text (z-order = append order). get_screenshotthe frame (real node id,enableBase64Response: trueif you cannot fetch URLs). Read, fix, repeat.- Components: promote repeated UI to
createComponent; group variants withcombineAsVariants. - Raster images (screenshots, logos, photos): the sandbox has no filesystem — bring them in with
upload_assetsonto a named holder rect.reference/09-raster-images.md. - Keep the file clean: one page per purpose, delete rejected explorations as decisions land, never accumulate orphan boards.
Geometry you will need
Rects, ellipses, text only get you so far. For slanted/parallelogram shapes use a shear matrix via relativeTransform; for arbitrary line segments use a thin rect + matrix; for two-tone text use setRangeFills. Exact formulas in reference/03-geometry-and-drawing.md. Rectangles cannot have children, and later-appended siblings render on top.
Reference (read on demand)
reference/01-setup-and-auth.md— accounts, planKey, file/node id extraction.reference/02-fonts.md— the server-side font reality, load rules, style-name gotchas, twin pattern.reference/03-geometry-and-drawing.md— z-order, shear/parallelogram math, lines, two-tone, rotation vs skew.reference/04-styles-and-components.md— create + bind styles, components, variants.reference/05-pages-and-layers.md— page access, the organize-as-you-go discipline, naming conventions.reference/06-screenshot-loop.md— screenshot ids, base64 vs URL, the iteration cadence.reference/07-design-to-code.md— reading designs + web capture + Code Connect.reference/08-gotchas.md— the specific errors hit in practice and their fixes.reference/09-raster-images.md— importing screenshots / logos / photos viaupload_assets, FILL vs FIT, pre-crop, framing a screenshot.assets/helpers.js— copy-paste helper library foruse_figmacalls.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

