← All work

03 / Design tooling

Stitchwand

Fieldhaus

Role
Designer and engineer, Fieldhaus
Scope
A companion app for Google Stitch and open-source tooling for DESIGN.md
Outcome
Live with no sign-in. Core, CLI and MCP server on npm under MIT. 614 tests passing.
Presented
Google Cloud Next 2026, Las Vegas
A one-minute walkthrough of the Stitchwand web app: the DESIGN.md library, importing a design system from a URL, Starter Kits, generating components from HTML, the Figma bridge and a live changelog. It has sound and no captions. 1:02 · With sound
stitchwand.com. Presented at Google Cloud Next 2026 in Las Vegas.

The problem

Google Stitch turns a prompt into screens. What it needs around it is a design system to follow, prompts that steer it somewhere new, and a way to check what comes back. Stitchwand is that workspace.

Design tokens live in many formats: Style Dictionary, Tokens Studio, Tailwind, plain CSS variables. DESIGN.md gives a design system one readable file for people and for AI tools. Getting tokens into that file, checking a page against it and seeing what changed between two versions were all jobs done by hand.

AI design tools add a problem of their own. Left alone they drift to the same look: purple gradients, Inter everywhere, sparkle icons, bento grids. Something has to tell them what not to do.

How it works

I built the core first, with no interface attached, and put every surface on top of it. The terminal, the assistant and the browser always give the same answer, and a fix lands in all three at once.

  1. 01

    One core, three ways in

    npm workspaces with Turborepo, TypeScript 5.9 in strict mode with ES modules, and Vitest. All processing lives in @stitchwand/core; the CLI is 256 lines and the MCP server 144, and the web app runs core in the browser for most tools.

    The stitch CLI, run from the repository.
  2. 02

    Convert

    Four parsers, for Style Dictionary, Tokens Studio, a Tailwind theme and CSS variables, feed one TokenCollection, which becomes a design system and then a DESIGN.md. Colours get generated names such as Blue Ribbon.

    Token formats in, DESIGN.md out.
  3. 03

    Validate

    Cheerio reads the HTML; inline styles and Tailwind classes are mapped to values; colours match tokens by CIEDE2000 distance with a threshold of 10; contrast is checked against WCAG and touch targets against 44 px. Findings fall into 8 rule categories, and the grade is plain arithmetic: start at 100 and take 5 per error, 2 per warning and half a point per info.

    Sample HTML validated against the active DESIGN.md.
  4. 04

    Lint, with exit codes

    The lint has 8 rule IDs from 6 rule files, citing 6 WCAG criteria. In the CLI, validate and lint exit with code 1 when they find errors, so a build can fail on design or accessibility: the sample card goes from 64.5 and exit code 1 to 100 and exit code 0.

    Accessibility lint on a sample card, then the fix.
  5. 05

    Diff

    Diff compares two DESIGN.md files token by token and reports colour changes with their deltaE, in the CLI and the MCP server.

    diff, token by token, with deltaE on colours.
  6. 06

    The MCP server

    createServer() registers six tools with Zod schemas and returns Markdown or JSON; index.ts connects a stdio transport. A twenty-line client lists the six tools and calls one. The server is listed in the official MCP Registry at 0.1.1.

    A small client lists the six tools over stdio and calls one.
  7. 07

    The playground

    The MCP Playground in Labs calls the same core functions in the browser, with the request and the response shown as JSON.

    The MCP Playground runs core tools in the browser.
  8. 08

    Import from a URL

    An API route fetches the page and up to eight linked stylesheets, pulls out colours, type, spacing, radii and shadows, and writes a DESIGN.md. It refuses private addresses and gives up after 15 seconds.

    A web address becomes a design system.
  9. 09

    Components and more

    Core holds five framework generators, HTML to Figma plugin code, test generation and parity scoring. The CLI's generate command writes a component straight from HTML.

    One block of HTML, shown in React, Vue, Svelte and Angular.
  10. 10

    The web stack

    Next.js 16.2.1 App Router, React 19.2.4, Tailwind 4.2.2, Framer Motion, the Monaco editor and React Flow for the token graph. Four API routes wrap core, and everything a user saves stays in localStorage under sw: keys. The visualisers draw a built-in sample token set.

    Five visualisers in turn. They draw a built-in sample token set.
  11. 11

    Design Swarm as a product

    Design Swarm is a cartesian product of components, layouts and visual styles, each combination written out as a full prompt for Stitch.

    Design Swarm: components times layouts times styles.
  12. 12

    Prompts that carry the system

    Every generated prompt opens with CRITICAL: Use Attached DESIGN.md, a fix tracked as P1-003 in the launch plan.

    The prompt to paste into Stitch, opening with CRITICAL: Use Attached DESIGN.md.
  13. 13

    Tests

    614 tests in 48 files, all passing: 376 in core, 149 in the web app, 50 in the MCP server and 39 in the CLI. Core has one test file per engine; the web tests cover hooks, storage, three API routes and three components.

  14. 14

    Shipped in numbered tasks

    165 commits on 13 days. The packages first appear on 4 April; 65 commits land between 5 and 7 April; on 11 April 40 commits, most named for a numbered task. A setup report describes three coding agents in separate git worktrees, one each for core, MCP plus CLI, and web, merged core first. npm publishing followed on 16 April and the registry listing on 18 April.

The solution

Stitchwand is one core library with three surfaces. Developers run the CLI in a terminal, AI assistants call six tools through the MCP server, and everyone else opens the web app at stitchwand.com with no sign-in.

The three packages are on npm under MIT. Accounts, a database and paid plans are planned and not built; what a user saves stays in the browser.

Decisions along the way

  • Core first

    Every engine lives in one library with no interface attached. The command line, the MCP server and the web app are thin, so a fix lands in all three at once.

  • Soft constraints

    The anti-pattern list steers, it does not forbid. Ask outright for a purple gradient hero and you get one. You just never get one by accident.

  • Rule IDs and locations

    A validation result names the rule it broke and where, so a person or an assistant can fix the exact line instead of guessing.

  • Free of accounts for now

    Settings, systems and templates persist in the browser. Sign-in, a database and paid plans are planned and deliberately not built yet.

What I delivered

  • The core library: convert, validate, diff, lint, components, Figma export, test generation and parity scoring
  • A CLI with five commands
  • An MCP server with six tools, listed in the official MCP Registry
  • A Next.js web app with a library of 116 design systems
  • A list of 82 named anti-patterns in eight groups
  • 614 tests across 48 files

Value added

  • For design engineers

    Tokens move between formats in one step, and a page can be checked against its design system before anyone opens a review.

  • For AI assistants

    The checks a person runs are tools an assistant can call, so generated UI can be converted, validated and linted in the same conversation that made it.

By the numbers

614 tests, by package

Core library376
Web app149
MCP server50
CLI39
View as table
ItemValueNote
Core library37616 files, one per engine
Web app14916 files
MCP server509 files
CLI397 files

Source: Vitest, run in each package at HEAD a19aac0, 21 Nov 2026

Commits per week, spring 2026

164 of the 165 commits fall between 29 March and 30 April; one more came on 21 November.

23 Mar
30 Mar
6 Apr
13 Apr
20 Apr
27 Apr
View as table
PeriodValue
23 Mar11
30 Mar25
6 Apr97
13 Apr28
20 Apr0
27 Apr3

Source: git history of the Stitchwand repo

The result

The web app runs at stitchwand.com with no sign-in. The core library, the CLI and the MCP server are on npm under MIT, published in April 2026, and the MCP server is listed in the official MCP Registry. All 614 tests pass across 48 files. Accounts, a database and paid plans are planned and not built. I presented it at Google Cloud Next 2026 in Las Vegas.

Results

  • 614tests passing across 48 files
  • 116design systems to start from
  • 82named anti-patterns, as soft constraints

Live stitchwand.com ↗ (opens in a new tab)

What I took from it

Putting every engine in one library paid off in the tests: the core carries 376 of the 614, and the CLI, the MCP server and the web app only test their own thin layers. Rule IDs and locations on every result did the same for fixes, because a person or an assistant can go straight to the line that broke. Accounts, a database and paid plans are planned and deliberately not built yet.

Background

Stitchwand sits between a few open pieces. Stitch is Google's tool for generating interface designs. The Model Context Protocol is an open protocol that lets AI assistants call outside tools, which is how an assistant reaches Stitchwand's six. Style Dictionary is one of the token formats it converts from, the Design Tokens Community Group publishes the format the field is converging on, and WCAG sets the contrast floors the linter checks.