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
(file key
i3MTtBKiPbLq7bEIJqL4yc).
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 and writes the report to Inconsistencies report. Commit the updated report when you're happy with it.
- 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.