Node.js β design tokens + Stitch MCP integration for design-to-code generation.
Live site: withagents.dev/posts/post-10-stitch-design Field journal entry: withagents.dev/posts/post-10-stitch-design
Featured in the Agentic Development Blog series β Post #10: 21 AI-Generated Screens, Zero Figma Files
- Send date: Mon Jun 15, 2026
- LinkedIn: link added on send day
- Canonical blog post: https://ai.hack.ski/blog/
- Series hub: agentic-development-guide
A complete workflow template for AI-powered design-to-code using Stitch MCP + React + Puppeteer validation.
Turn natural language design prompts into production-ready React components β with automated visual validation proving every screen renders correctly. Zero Figma files. Zero hand-written CSS. 21 screens. 107 validation actions.
flowchart LR
A[ποΈ Craft Prompt\nEmbed design system\nDescribe layout + states] --> B[β‘ Stitch MCP\nGenerate visual design\nfrom structured prompt]
B --> C[π¨ Design Output\nReview for spec compliance\nCheck brand + colors]
C --> D[βοΈ React Conversion\nBuild components\nAdd data-testid attrs]
D --> E[π€ Puppeteer\nValidation\n107 actions / 21 screens]
E --> F{All Checks Pass?}
F -- Yes --> G[β
Ship It]
F -- No --> A
The brutalist-cyberpunk aesthetic that makes this system distinctive:
| Token | Value | Swatch |
|---|---|---|
| Background | #000000 |
β¬ Pure black |
| Primary Accent | #e050b0 |
π£ Hot pink |
| Secondary Accent | #4dacde |
π΅ Cyan |
| Surface | #111111 |
β¬ Dark cards |
| Surface Alt | #1a1a1a |
β¬ Elevated |
| Text Primary | #ffffff |
β¬ White |
| Text Secondary | #a0a0a0 |
π Gray |
| Border | #2a2a2a |
βͺοΈ Subtle |
Typography: JetBrains Mono β used exclusively at all sizes and weights.
Border Radius: 0px everywhere. No exceptions. Brutalist by design.
Component Library: shadcn/ui primitives, styled with custom CVA variants.
| Metric | Value |
|---|---|
| Screens generated | 21 |
| Puppeteer validation actions | 107 |
| Figma files opened | 0 |
| CSS written by hand | 0 lines |
| Design tokens | 47 |
| shadcn/ui components | 5 |
| Example components | 4 |
| Session transcript | ~13,432 lines |
stitch-design-to-code/
β
βββ design-system/
β βββ tokens.json # 47 design tokens (colors, type, spacing, shadows)
β βββ tailwind-preset.js # Tailwind theme consuming tokens.json
β βββ README.md # Token reference + installation guide
β
βββ prompts/
β βββ README.md # Prompt engineering guide + A/B/C strategy
β βββ public-screens.md # 7 screens: Home, Resources, Search, About, Categories (2)
β βββ auth-screens.md # 3 screens: Login, Register, Forgot Password
β βββ user-screens.md # 4 screens: Profile, Bookmarks, Favorites, History
β βββ admin-screens.md # 2 screens: Admin Dashboard (20 tabs), Suggest Edit
β βββ legal-screens.md # 2 screens: Privacy Policy, Terms of Service
β
βββ validation/
β βββ puppeteer-checks.js # 107-action check suite (21 screens)
β βββ run-validation.js # Puppeteer runner with pass/fail reporting
β βββ README.md # Methodology, action types, CI integration
β
βββ components/
β βββ ui/
β β βββ button.tsx # 7 variants (default, outline, ghost, link, secondary...)
β β βββ card.tsx # Card system (header, title, desc, content, footer)
β β βββ input.tsx # Input + Textarea + SearchInput
β β βββ tabs.tsx # Radix tabs + ScrollableTabs for 20-tab admin
β β βββ badge.tsx # 13 variants (primary, secondary, status, role...)
β β
β βββ home-hero.tsx # Hero section + StatsBar
β βββ resource-card.tsx # ResourceCard + ResourceGrid
β βββ auth-form.tsx # Unified login/register/forgot-password form
β βββ admin-tabs.tsx # 20-tab admin dashboard with content placeholders
β
βββ docs/
β βββ branding-checklist.md # The "Awesome Lists vs Video Dashboard" bug + prevention
β βββ workflow-guide.md # Step-by-step: design system β prompts β Stitch β React β validate
β
βββ package.json
βββ .gitignore
βββ LICENSE
βββ README.md
- Node.js 18+
- npm 9+
git clone https://github.com/krzemienski/stitch-design-to-code.git
cd stitch-design-to-code
npm installnpm run dev
# Visit http://localhost:3000# In a second terminal (while dev server runs)
npm run validate- Pass/fail output in terminal
- Screenshots in
./screenshots/ - Full report in
./validation-report.json
# Copy design-system/ to your project
cp -r design-system/ your-project/
# Install dependencies
npm install tailwindcss class-variance-authority clsx tailwind-merge @fontsource/jetbrains-mono// tailwind.config.js
module.exports = {
presets: [require('./design-system/tailwind-preset')],
content: ['./src/**/*.{ts,tsx}'],
}// In your root layout
import '@fontsource/jetbrains-mono/400.css';
import '@fontsource/jetbrains-mono/700.css';Open any file in prompts/ and use the embedded prompt blocks with Stitch MCP. Each prompt:
- Embeds the full design system spec inline
- Describes layout, key elements, and interactive states
- Can be used as-is or adapted for your own product
The critical rule: embed the full design system in every prompt.
Design a [SCREEN NAME] for "Your Product" β [one-line description].
DESIGN SYSTEM:
- Background: #000000 (pure black)
- Primary Accent: #e050b0 (hot pink)
- Secondary Accent: #4dacde (cyan)
- Surface/Card: #111111 background, #1a1a1a elevated
- Text: #ffffff primary, #a0a0a0 secondary
- Font: JetBrains Mono, monospaced, used everywhere
- Border radius: 0px β brutalist aesthetic
- Component library: shadcn/ui
- Borders: 1px solid #2a2a2a
LAYOUT:
[Describe structure here]
KEY ELEMENTS:
[List all UI elements with specifics]
See prompts/README.md for the full guide including A/B/C variation testing strategy.
The Puppeteer suite validates 21 screens with 107 actions:
| Group | Screens | Checks |
|---|---|---|
| Public | Home, Resources, Search, About, Categories, Category Detail, Resource Detail | 36 |
| Auth | Login, Register, Forgot Password | 14 |
| User | Profile, Bookmarks, Favorites, History | 18 |
| Admin | Admin Dashboard (20 tabs), Suggest Edit | 29 |
| Legal | Privacy Policy, Terms of Service | 16 |
| Total | 21 | 107 |
The Admin Dashboard alone accounts for 25 checks β one per tab plus KPI validation.
This template includes a documented case study of AI-generated branding drift. See docs/branding-checklist.md for:
- What went wrong (product name substitution across screens)
- Why it happens in long AI sessions
- An automated grep-based prevention script
- Treating brand name as a design token
TL;DR: Run this after every generation session:
grep -rn "Video Dashboard\|Placeholder\|lorem ipsum" src/ components/ app/design-system/README.mdβ Token reference and Tailwind setupprompts/README.mdβ Prompt engineering guidevalidation/README.mdβ Puppeteer methodologydocs/workflow-guide.mdβ Complete step-by-step workflowdocs/branding-checklist.mdβ Branding bug prevention
Start the Next.js dev server first: npm run dev. The validation suite needs a running server at http://localhost:3000.
Run npx puppeteer browsers install chrome to install the required browser. In CI, use --ci mode: npm run validate:ci.
Ensure your viewport is set correctly. The validation suite uses a default viewport of 1280x720. Custom viewports can be set per-check in puppeteer-checks.js.
This is expected for the template repo. The @/ path alias resolves via tsconfig.json paths when the full Next.js project is built.
Verify design-system/tokens.json is imported correctly. All 47 tokens use the brutalist palette (borderRadius: 0px is intentional).
MIT Β© Nick Krzemienski
Part of the Agentic Development Series β building production software with AI agents.