A small demo showing how an AI agent can detect inconsistencies between a Figma design and its codebase implementation — in both directions (things in Figma but not in code, and vice versa).
- React + TypeScript + Vite app.
- Source under src/:
- src/pages/home/ — the demo page.
- src/components/ — UI components (button, card, footer, header, round-button).
- src/tokens.css — design tokens (colors, spacing, radius, typography, sizes) the agent uses as the source of truth when comparing.
- Figma file: Codebase-Figma-Demo.
pnpm install
pnpm dev-
Get a Figma personal access token and put it in
.env:FIGMA_API_KEY=figd_...
-
Open this repo in VS Code. The Figma MCP server is configured in .vscode/mcp.json and starts automatically.
-
In Chat (agent mode), run the
/design-checkprompt. The agent reads AGENTS.md for the rules, writes the report to figma-code-audit.html, dropsTODO design-check:comments at mismatched code spots, posts[design-check]comments on the matching Figma nodes, and commits everything locally. Review the diff and push when you're happy with it. -
For a PR-style preview limited to currently staged files, run
/design-check-changesinstead. It writes a read-only report to code-changes-audit.html and does not modify code, post Figma comments, or commit.
- AGENTS.md — task definition, what to compare, exact report format.
- .github/prompts/design-check.prompt.md
— the
/design-checkslash command that triggers the agent in VS Code. - .vscode/mcp.json — Figma MCP server (Framelink
figma-developer-mcp) so the agent can read Figma frames as a simplified, token-aware tree.