figma-to-section
Skill141 starsChanged 34 days agoUnlicenseView on GitHub
Turn a Figma frame or node into components in this starter — the MCP call order, recording node IDs so later passes can re-fetch, downloading and verifying assets, mapping design values onto the three-tier token system, and choosing spring primitives for whatever motion the design implies. Use when the user provides a Figma URL, says "build this section", "implement the design", "match the Figma", or hands over a frame to code up.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- aeo-visibilitySkill
- i18n-seoSkill
- local-seoSkill
- mobile-device-qaSkill
- optimize-3d-sceneSkill
- optimize-loadSkill
- optimize-performanceSkill
- payload-adminSkill
- payload-analyticsSkill
- payload-cmsSkill
- qa-verifySkill
- schema-markupSkill
- seo-auditSkill
- seo-growSkill
- ship-checkSkill
- site-migrationSkill
- supabase-authSkill
- supabase-dbSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Write DESIGN-MAP.md at the repo root (gitignored or committed, user's call):
- Distinctive: line 38
Every section needs its node ID.
- Very specific: line 51
Verify each file after download: run file <path>. Figma often returns an SVG where you asked for a raster, or a PNG named .jpg.
- Very specific: line 56
Prefer .webp/.avif for photos.
- Distinctive: line 57
If a download fails: use a placeholder, add a comment saying why, and tell the user immediately — never silently skip an asset.
- Very specific: line 62
Before writing JSX, map the design's values onto the token system (obsidian/frontend/design-system.md):
- Very specific: line 65
Every colour becomes a --raw-* primitive plus a semantic Tier 2 token naming its purpose.
- Very specific: line 78
Follow obsidian/workflows/new-page.md.
- Distinctive: line 82
Do not invent visual features: No shadows, gradients, overlays, hovers or card wrappers that are not in the design.
- Very specific: line 107
Run the qa-verify skill against the section before reporting done, and report: new tokens added and why, values that could not map to …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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 → section
Build from live Figma data, never from a text description, a summary you wrote earlier, or memory. Descriptions lose exactly the values that matter.
1. Extract, in this order
get_metadata— file structure, pages, top-level frames. Gives you thefileKeyand the node IDs.get_design_contexton the target node — exact text, colours, typography, spacing, layout, asset URLs. This is the source of truth for values.get_screenshoton the same node — the source of truth for layout: column count, direction, alignment, order, positioning.
Both. get_design_context will not tell you a layout reads as three columns;
the screenshot will not tell you the gap is 28px.
2. Record what you fetched
Write DESIGN-MAP.md at the repo root (gitignored or committed, user's call):
**Figma file key:** `<fileKey>`
**Source URL:** <url>
**Frame width:** <px> ← the design base width; check it against the adaptive grid
| Section | Node ID | View / component | Background | Notes |
|---------|---------|------------------|------------|-------|
| Hero | `1:234` | views/home → Hero | full-bleed image | h1 lives here |Every section needs its node ID. QA and any later pass re-fetch from these — a section without a node ID cannot be verified against its design later.
3. Assets
get_design_context returns asset URLs that expire (~7 days). Download
immediately.
- Save to
public/assets/<section>/— one folder per section (obsidian/architecture/folder-structure.md). Meta/PWA assets stay atpublic/root. - kebab-case, prefixed by section:
hero-background.webp,team-jane-doe.webp,icon-arrow.svg. - Verify each file after download: run
file <path>. Figma often returns an SVG where you asked for a raster, or a PNG named.jpg. Rename to match the real type — a mismatched extension renders as a broken image. - Sanity-check size: a content photo under ~5KB is almost certainly a vector placeholder, not the intended export. Flag it; do not ship it.
- Prefer
.webp/.aviffor photos.next/imagewith explicitwidth/height. - If a download fails: use a placeholder, add a comment saying why, and tell the user immediately — never silently skip an asset.
4. Values → tokens (do not skip to markup)
Before writing JSX, map the design's values onto the token system
(obsidian/frontend/design-system.md):
- Every colour becomes a
--raw-*primitive plus a semantic Tier 2 token naming its purpose.--raw-color-brand-500+--action-primary, never--blue-500used directly in markup. - Spacing/radius/type values: reuse an existing token if one matches; otherwise add one, with a comment naming the Figma frame it came from.
- A value you cannot justify as a token is a design-review flag for your summary, not a magic number in a class name.
- This project scales the root font-size with the viewport, so design px map to
remcleanly at the design base width. Check the frame width against the breakpoints inglobals.cssbefore converting anything.
5. Build
Follow obsidian/workflows/new-page.md. Specific to design work:
- Copy is character-for-character from
get_design_context. Never rewrite, shorten or invent — even if the design's copy reads badly. Flag it instead. - Do not invent visual features. No shadows, gradients, overlays, hovers or card wrappers that are not in the design. An invented wrapper background is the single most common cause of "the logo disappeared".
- Do add the motion this starter is for — that is the one place we
deliberately go beyond a static Figma frame. Reveals, parallax and text
animation are the house style; use
Inview/SpringTrigger/ the text engine and keep it restrained. If the user wants a literal static translation, they will say so. - Content comes in as props (mocks under
src/data/mocks/<page>.tsuntil real data or the CMS exists) — never hardcoded in the component. - Semantic markup and the correct
tagon every animation component. - First-screen sections use the robot twins (
robot-spring,robot-text,robot-inview,robot-hoverinsrc/components/common/) so crawlers get the copy at rest; below-fold text engines takelazy; everyloop:readsuseMotionOff()(optimize-load/references/robot-path.md). - Phone frames are layouts, not coordinates. Build the phone design in flow
(flex/grid, a page gutter token) — absolutely positioning every element from a
390-wide frame made a later "1rem side padding" request a 30-file change on a
production site. Split-letter headlines group letters per word
(
white-space: nowrap) so they never break mid-word; checkscrollWidth === innerWidthat 320–430. Scene boxes arelvh, menusdvh+ safe area (mobile-device-qa).
6. Finish
Run the qa-verify skill against the section before reporting done, and report:
new tokens added and why, values that could not map to tokens, any asset that
failed or looked wrong, and any copy you flagged rather than changed.
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.

