Agent skill

Spellbook Figma to Code Skill: React and Tailwind

The figma-to-code skill in majiayu000/spellbook turns Figma MCP output into React and Next.js components with TypeScript and Tailwind, using strict rules about positioning, fonts and fixed heights.

Install
git clone https://github.com/majiayu000/spellbook.git
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the spellbook figma-to-code skill?

The spellbook figma-to-code skill is one folder in the majiayu000/spellbook library. Its SKILL.md gives an AI coding agent numbered rules for converting Figma MCP output into production React and Next.js components with TypeScript and Tailwind, covering positioning, dimensions, fonts, inline SVG and text heights.

Rule 1 is never to truncate code: every className in the Figma MCP output must be kept. That sets the tone for a skill built around lossless extraction and then careful cleanup of a few known problems.

It lives in majiayu000/spellbook, a library the README presents as cross-runtime skills for Claude Code and Codex. The skill's stated aim is production-ready React and Next.js components in TypeScript and Tailwind.

The rules, in order

  1. Keep every className from the Figma MCP output, with nothing dropped.
  2. Flatten nested absolute contents wrappers and keep child positions as they are.
  3. Read page width and height from get_metadata instead of hardcoding them.
  4. Load fonts from the Google Fonts CDN, map Figma font names, and test weights visually.
  5. Add critical CSS so wide pages scroll and keep their layout intact.
  6. Replace simple line images with CSS and use inline SVG for vector assets.
  7. Remove fixed heights from multi-line text blocks so text can wrap naturally.

Two details worth knowing

On positioning, the SKILL.md draws a line. A parent with the contents class means the child's top and left are already absolute. A parent without it means you add parent and child values.

On fonts, it warns that Figma's weight names may not match CSS. A Figma Bold can look lighter than weight 700, so it suggests trying one step lighter and comparing against the Figma screenshot.

Who the figma-to-code skill suits

Best for

  • React or Next.js projects using TypeScript and Tailwind that receive Figma MCP output.
  • Pixel-faithful conversion of fixed-size frames, since the examples use absolute positioning and widths such as 1920px.
  • Teams that keep hitting text-wrapping and font-rendering drift between Figma and the browser.

Not for

  • Projects outside React and Next.js. The output target is fixed in the skill's description.
  • Anyone without Figma MCP access, because the skill works from that server's output.
  • Responsive-first builds that need a design system mapping. See openai-figma-use or design-handoff.

Use it with UiChemy

Both routes start from a Figma file, but they end differently. This skill produces React code for an app. For a WordPress site, UiChemy Figma to WordPress converts the frames into editable pages directly. Click Get Started on uichemy.com.

If you stay on the code route, figma-implement-design and tailwind-design-system cover neighbouring ground.