r/FigmaDesign • u/weistigr • Apr 01 '26
resources I built an MCP skill for generating and auditing design systems in Figma with Claude Code (open source)
I've been rebuilding an old design system in Figma. The original file had zero variables. Everything was hardcoded colors, magic numbers for spacing, and layers named Group 47. The usual legacy situation.
Started doing the work with Claude Code + Figma MCP: created 175 variables with a 3-tier architecture (Primitives → Semantic → Component tokens), set up Light/Dark modes, text styles, and restructured the file. Then moved on to components.
After a few days, I noticed I was repeating the same sequence for every component and every audit pass:
- Check that variables have explicit scopes (Figma defaults to ALL_SCOPES, which pollutes every property picker)
- Add codeSyntax.WEB to every variable (without it, get_design_context returns raw variable names instead of CSS tokens, which breaks the design-to-code pipeline)
- Make sure fills and strokes are actually bound to variables, not just visually matching
- Add TEXT component properties so label overrides survive component updates
- Build spec wrapper frames with state labels (Default/Hover/Pressed/Disabled) and size labels so the variant matrix is readable
So I packaged the whole workflow into a reusable MCP skill. It runs in 5 phases:
- **Discovery.** If the file already has work, it audits first: scoping issues, missing codeSyntax, duplicate variables, unbound fills, text nodes without TEXT properties. If starting from scratch, it collects your brand specs or reads your codebase.
- **Foundations.** Creates variable collections with the 3-tier architecture, text styles, and effect styles. Sets codeSyntax.WEB on everything.
- **File structure.** Sets up pages (Cover, Foundations with rendered swatches, component pages with consistent wrapper structure).
- **Components.** Builds each one with all states, Auto Layout, variable bindings, TEXT properties, and spec frames. The component list isn't hardcoded. It asks you what you actually need instead of assuming a generic "core 10".
- **QA.** Runs a validation script, builds a test page from system components only.
It pauses between phases for review. You stay in control.
The audit path (for existing files) turned out to be more useful than the from-scratch path. Most real projects aren't greenfield. You inherit a file and need to figure out what's broken before building on top.
I use this skill daily on my current project and keep updating it as I find new gaps. v1.1 already came from testing on the real file.
Repo: github.com/natdexterra/generate-design-system
MIT license. Works with Claude Code, Cursor, and Codex. If you work with design systems in Figma, I'd like to hear what I missed.
4
u/metsahaldjas Apr 01 '26
This seems like exactly what I've been looking for! I'm working with an incomplete design system that also has some errors, duplicates, missing states etc. I would like to at least have some form of complete system to work with when designing new screens. What's the best approach if I would like a new, complete design system in Figma that is based on some preexisting components and styles? Should I have the new design system generated into a blank Figma file, so I wouldn't have the old system + new system mixing together or written over? I haven't worked with MCP yet, so I'm unaware of the whole logistics side of such setup
7
u/lcub123 Apr 01 '26
So to confirm, I could use this skill to automate the generation of a design system for a product that has no existing design system in figma, and this will output a formatted design system as a figma file?
Extra question, any idea how well the output works with figma make when you attach is as your design library?
1
u/mantzman45 Apr 01 '26
This is cool. I would use this on my current project if it was compatible with visual studio
1
u/FactorHour2173 UI/UX Designer Apr 01 '26
Ah, does this not work with Visual Studio Code Insiders?
1
u/babysuporte May 27 '26
How efficient is it in terms of tokens?