Design Guard logo

Design Guard

Community
FReptar0

Stitch Forge — CLI framework for automating web design with Google Stitch MCP

PublisherFReptar0
Repositorydesign-guard
LanguageTypeScript
Forks
5
Stars
13
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Design Guard exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    13 stars and 5 forks from the linked repository.

Design Guard



Packages

This is a monorepo with two packages:

PackagenpmDescription
@design-guard/corenpmDesign intelligence engine — research, synthesis, validation, tokens
design-guardnpmCLI + TUI + Claude Code skills — the full design-to-deploy pipeline

What It Does

  1. Research a business — scrape the site, extract palette/typography/layout, infer business model and audience
  2. Synthesize a DESIGN.md — 8-section design system tailored to the business (not boilerplate)
  3. Generate screens — via Google Stitch MCP or Claude Direct, with prompt guardrails
  4. Validate output — 18 lint rules across 7 categories catch AI slop (default fonts, purple gradients, icon grids, SaaS-speak...)
  5. Build production sites — export to Static HTML, Astro, or Next.js

Built for Claude Code. Design Guard ships with 7 skills (/dg-discover, /dg-generate, /dg-build...) that turn Claude into your design co-pilot.

Quick Start

bash
# Install
npm install -g design-guard

# Initialize and configure
dg init

# Research your business and generate a design system
dg discover "Acme Coffee, food & beverage, young professionals, warm minimal" --url https://acmecoffee.com

# Generate a screen
dg generate "A landing page with hero, menu highlights, and location CTA"

# Validate it
dg lint screens/landing.html

# Build
dg build --framework static --auto

How It Works

Business name or URL
│
▼
┌──────────────────────┐
│  Research Engine      │  Scrape site, extract palette, infer business model
│  (@design-guard/core) │
└────────┬─────────────┘
         │
┌────────▼─────────────┐
│  DESIGN.md           │  8-section design system + business context
│  Synthesis           │  Industry-aware, anti-slop rules built in
└────────┬─────────────┘
         │
┌────────▼─────────────┐
│  Generator           │  Google Stitch (MCP) or Claude Direct
│  + Prompt Guardrails │  Length, single-screen, vague detection
└────────┬─────────────┘
         │
┌────────▼─────────────┐
│  Anti-Slop Validator │  18 rules, 7 categories, 0-100 score
│  (@design-guard/core) │  Tailwind-aware, SARIF output
└────────┬─────────────┘
         │
┌────────▼─────────────┐
│  Site Builder        │  Static HTML | Astro | Next.js
│  + Preview           │  Local server or inline in Claude Code
└──────────────────────┘

CLI Commands

dg init                              Setup project, auth, MCP config
dg discover "brief" [--url URL]      Research business + generate DESIGN.md
dg design "brief"                    Generate DESIGN.md from preset templates
dg generate "description"            Generate a screen via Stitch or Claude
dg lint [file|dir]                   Validate HTML against DESIGN.md (18 rules)
dg preview [name]                    Open screen in browser
dg build --framework static          Build site (static | astro | nextjs)
dg sync [project-id]                 Pull screens from Stitch project
dg research                          Check for Stitch API updates
dg tokens export                     Export DESIGN.md as W3C DTCG tokens
dg workflow [redesign|new-app]       Guided multi-step workflow
dg tui                               Interactive terminal UI

Claude Code Skills

/dg-discover   Research business + generate tailored DESIGN.md
/dg-design     Generate DESIGN.md from a brand brief
/dg-generate   Generate screens with guided prompts + guardrails
/dg-build      Build and export to your chosen framework
/dg-preview    Preview screens inline
/dg-research   Check for Stitch API updates
/dg-sync       Pull latest from a Stitch project

MCP Setup

Design Guard connects to Google Stitch via MCP. Add to .mcp.json:

json
{
  "mcpServers": {
    "stitch": {
      "command": "npx",
      "args": ["@_davideast/stitch-mcp", "proxy"],
      "env": { "STITCH_API_KEY": "${STITCH_API_KEY}" }
    }
  }
}

dg init creates this file automatically.

Using @design-guard/core Directly

The core library can be used independently in your own tools:

typescript
import { validateOutput, scoreDesignMd, designMdToDTCG } from '@design-guard/core';

// Validate AI-generated HTML
const result = validateOutput(html, designMdContent);
console.log(`Score: ${result.score}/100`);

// Score a DESIGN.md
const quality = scoreDesignMd(designMdContent);
console.log(`Quality: ${quality.total}/100`);

// Export as design tokens
const tokens = designMdToDTCG(designMdContent);

See the @design-guard/core README for the full API.

Project Structure

design-guard/                       # Monorepo root (npm workspaces)
├── packages/
│   ├── core/                       # @design-guard/core (245 tests)
│   │   └── src/
│   │       ├── research/           # Business researcher, synthesizer, cache
│   │       ├── validation/         # Design scorer, output validator, 18 lint rules
│   │       ├── tokens/             # W3C DTCG converter
│   │       ├── templates/          # DESIGN.md generator, prompt builder
│   │       └── utils/              # Validators, prompt enhancer
│   └── cli/                        # design-guard CLI (98 tests)
│       └── src/
│           ├── commands/           # init, discover, design, generate, build, lint, sync...
│           ├── tui/                # Ink terminal UI (Dashboard, PromptBuilder, DesignEditor)
│           ├── mcp/                # MCP client with retry + backoff
│           ├── generators/         # Stitch MCP + Claude Direct adapters
│           ├── adapters/           # Framework builders (static, astro, nextjs)
│           └── research/           # Stitch docs crawler, differ, updater
├── .claude/skills/                 # 7 Claude Code skills
├── docs/                           # Guides (design, prompting, known state)
└── public/                         # Landing page + demo pages

Development

bash
git clone https://github.com/FReptar0/design-guard.git
cd design-guard
npm install
npm run build         # Build both packages
npm run test          # Run all 343 tests
npm run test:core     # Core only (245 tests)
npm run test:cli      # CLI only (98 tests)
npm run typecheck     # Type-check both packages
npm run dev           # Launch TUI in dev mode

Contributing

See CONTRIBUTING.md for setup instructions and guidelines.

License

MIT

Author

Built by Fernando Rodriguez Memije.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "freptar0-design-guard": {
      "command": "npx",
      "args": [
        "-y",
        "design-guard-monorepo"
      ]
    }
  }
}

Use Design Guard MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Design Guard is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Design Guard as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Design Guard MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "freptar0-design-guard": {
      "command": "npx",
      "args": [
        "-y",
        "design-guard-monorepo"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Design Guard MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Design Guard MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Design Guard to help me with this task?
Design Guard
Sure. I read it.
Here is what I found using Design Guard.

Frequently asked questions

What is the Design Guard MCP server used for?

Design Guard is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Design Guard MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Design Guard with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Design Guard MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Design Guard connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Design Guard MCP to TypingMind?

Design Guard runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Design Guard MCP provide in TypingMind?

Design Guard exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Design Guard MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Design Guard requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇