figma-to-design-init
Initialize Design System
You are initializing the design-to-code workflow for this project. Your job is to deeply understand the existing codebase's design patterns and produce a design-tokens.json file at .claude/design-tokens/design-tokens.json.
Pre-check: Incremental Update
Before scanning, check if .claude/design-tokens/design-tokens.json exists.
- If it does not exist: create the
.claude/design-tokens/directory and proceed with a full scan (Steps 1-8). - If it does exist: read it into context. Then run a targeted scan:
- Check if the styling approach or config file has changed. If yes, re-extract tokens (Step 2).
- Scan only for new, modified, or deleted components and hooks since the file was last generated (compare file paths in the existing JSON against what's on disk).
- Check if
package.jsondependencies have changed — compare installed packages against thepreferred_librariessection. If new libraries were added to an existing category, or a new category now has libraries, re-run Step 5 for those categories only. Ask the user to re-choose if a new competing library was added to a category that previously had only one. - Merge changes into the existing
design-tokens.json— add new entries, update changed entries, remove entries for deleted files. - Skip Steps 7-8's Playwright/pixelmatch install if already installed.
This avoids re-reading the entire codebase when only a few components have changed.
Step 1: Identify the Styling Approach
More from codestate-cs/figma-to-design
figma-to-design-build
Build production-ready Next.js/React code from a Figma design. Pulls design context and screenshots from Figma, generates code using your project's tokens and conventions, then visually verifies and iterates using Playwright screenshots until the result matches the design. Requires /figma-to-design-init to have been run first.
16design-system-aware
Enforces design token usage, component reusability, SOLID, DRY principles, and API call conventions when writing or editing React/Next.js frontend code. Activates when any .tsx or .jsx file inside src/ or app/ is being created or modified, AND .claude/design-tokens/design-tokens.json exists.
15figma-to-design-audit
Audit your codebase for design token drift. Finds hardcoded colors, spacing, and font values that should use design tokens. Reports unused tokens and components not following the design system. Run periodically to keep your codebase consistent.
13init
Initialize the design-to-code workflow. Scans your codebase for styling patterns, extracts design tokens, discovers reusable components, and generates a design-tokens.json file. Run this once per project before using /figma-to-design-build.
1build
Build production-ready Next.js/React code from a Figma design. Pulls design context and screenshots from Figma, generates code using your project's tokens and conventions, then visually verifies and iterates using Playwright screenshots until the result matches the design. Requires /figma-to-design-init to have been run first.
1