Skip to main content
Glama
ui-forge
by lemuayala
README.md
<div align="center">

  <br/>
  <h1>UIForge</h1>
  <p><b>Design systems your AI won't break — tuned in OKLch, verified for WCAG AA, and compiled to DESIGN.md.</b></p>
  <br/>

  <p>
    Explore 24 canonical brand systems and 9 visual presets across 8 full-page archetypes in a live playground,<br/>
    then ship exact tokens into your repo via the CLI, an official MCP server, or a 9-section DESIGN.md spec.
  </p>

  <br/>

  [![Live Demo](https://img.shields.io/badge/Live%20Demo-ui--forge--play.vercel.app-000000?style=for-the-badge&logo=vercel&logoColor=white)](https://ui-forge-play.vercel.app)
  [![Playground](https://img.shields.io/badge/Open-Playground-111827?style=for-the-badge)](https://ui-forge-play.vercel.app/play)
  [![npm core](https://img.shields.io/npm/v/@lemuayala/ui-forge-core?style=for-the-badge&logo=npm&label=ui-forge-core&color=cb3837)](https://www.npmjs.com/package/@lemuayala/ui-forge-core)
  [![npm mcp](https://img.shields.io/npm/v/@lemuayala/ui-forge-mcp?style=for-the-badge&logo=npm&label=ui-forge-mcp&color=cb3837)](https://www.npmjs.com/package/@lemuayala/ui-forge-mcp)
  <br/>
  [![Next.js](https://img.shields.io/badge/Next.js-16-black?style=for-the-badge&logo=nextdotjs)](https://nextjs.org)
  [![React](https://img.shields.io/badge/React-19-149eca?style=for-the-badge&logo=react&logoColor=white)](https://react.dev)
  [![Tailwind CSS](https://img.shields.io/badge/Tailwind-v4-38bdf8?style=for-the-badge&logo=tailwindcss&logoColor=white)](https://tailwindcss.com)
  [![TypeScript](https://img.shields.io/badge/TypeScript-Strict-3178c6?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org)
  [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-Active-0f172a?style=for-the-badge)](https://registry.modelcontextprotocol.io)
  [![License](https://img.shields.io/badge/License-MIT-black?style=for-the-badge)](LICENSE)
  [![PRs Welcome](https://img.shields.io/badge/PRs-Welcome-black?style=for-the-badge)](CONTRIBUTING.md)

  <br/>

  <img width="1440" alt="UIForge 3-column playground previewing a Glassmorphism dashboard alongside live DESIGN.md output" src="public/screenshots/playground.png" />

  <br/><br/>

  <img width="1440" alt="UIForge landing page with live Brand DNA inspector and OKLch WCAG AA readout" src="public/screenshots/landing.png" />

  <br/>
  <br/>

  [Why UIForge](#why-uiforge) · [Get started](#get-started) · [AI agents](#use-it-with-your-ai-agent) · [Systems & screens](#systems-and-screens) · [DESIGN.md & exports](#designmd-and-token-exports) · [How it works](#how-it-works) · [What's new](#whats-new) · [Roadmap](#roadmap) · [Contributing](#contributing)

</div>

<hr/>

## Why UIForge

Ask a coding agent to "build a clean dashboard" and you get the same purple gradients, mismatched radii, and unreadable muted text every time. Style guides live in Figma or scattered docs, so the model invents hex codes and spacing on every file it touches.

UIForge turns a visual direction into a single deterministic contract: **DESIGN.md**. You start from one of 24 real brand systems (*Linear, Stripe, Anthropic, Apple HIG, Vercel, Supabase, Spotify*, and others) or 9 style presets, tune perceptual OKLch hue, spacing, font scale, and surface opacity across *iPhone*, *iPad*, and *Desktop* frames, fix any WCAG 2.1 AA contrast failure in one click, and export the spec alongside `:root` CSS, Tailwind v4 `@theme`, or W3C Design Tokens JSON.

Everything runs off one zero-dependency core package (`@lemuayala/ui-forge-core`), so the web workbench, the CLI, and the MCP server always produce identical tokens and rules.

## Get started

Pick whichever workflow fits how you build. They all compile from the same engine.

| I want to… | Do this |
| :--- | :--- |
| Tune a system visually across devices | Open the [playground](https://ui-forge-play.vercel.app/play) |
| Initialize `DESIGN.md` + `tokens.css` in my repo | `npx @lemuayala/ui-forge-core init --brand linear` |
| Connect my coding agent over MCP | `claude mcp add ui-forge -- npx -y @lemuayala/ui-forge-mcp` |
| Audit and fix contrast from the terminal | `npx @lemuayala/ui-forge-core audit "#93c5fd" "#ffffff" --fix` |
| Browse 137 reference brand cards | Open [`design-systems/`](design-systems/_catalog.md) |

### CLI

The CLI inspects `package.json` in your working directory to detect your stack (`next`, `tailwind`, `react`, `vue`, `svelte`, or `html-css`) and writes `DESIGN.md` plus your chosen token file. No config file required.

```bash
# Compile Linear's system for a dashboard, export Tailwind v4 @theme, and add Cursor rules
npx @lemuayala/ui-forge-core init --brand linear --ui dashboard --tokens tailwind-v4 --auto-fix-aa --agent-rules

# Export W3C Design Tokens JSON (tokens.json) for Stripe
npx @lemuayala/ui-forge-core init --brand stripe --tokens w3c-json --force

# List all 24 brand systems, 9 presets, 8 screen archetypes, and 6 target stacks
npx @lemuayala/ui-forge-core list
```

Other flags: `--preset <id>`, `--stack <id>`, `--name <BrandName>`, `--dark <true|false|both>`, `--density <compact|normal|spacious>`, `--hue <0-360>`, `--dir <path>`.

## Use it with your AI agent

`@lemuayala/ui-forge-mcp` is an official [Model Context Protocol](https://modelcontextprotocol.io) server registered in the MCP Registry as `io.github.lemuayala/ui-forge`. Once connected, your agent queries real brand palettes, audits WCAG contrast in OKLch, and writes `DESIGN.md` directly instead of guessing colors.

**Claude Code**

```bash
claude mcp add ui-forge -- npx -y @lemuayala/ui-forge-mcp
```

**Cursor, Windsurf, Antigravity** (add to `mcp.json`)

```json
{
  "mcpServers": {
    "ui-forge": {
      "command": "npx",
      "args": ["-y", "@lemuayala/ui-forge-mcp"]
    }
  }
}
```

What the server exposes to your agent:

| Tool / Resource | What it does |
| :--- | :--- |
| `list_design_systems` | Search and filter the 24 brand systems, 9 presets, 8 UI archetypes, and 6 stacks |
| `compile_design_md` | Compile a 9-section `DESIGN.md`, Quick Prompt, and WCAG 2.1 AA report (with `autoFixContrast`) |
| `export_design_tokens` | Generate `:root` CSS, Tailwind v4 `@theme inline`, or W3C Design Tokens JSON |
| `audit_and_fix_contrast` | Compute WCAG 2.1 contrast and return the nearest passing HEX + OKLch lightness adjustment |
| `uiforge://catalog/systems` | Full JSON catalog of presets, brand systems, archetypes, and defaults |
| `uiforge://spec/rules` | Canonical anti-slop, state matrix, and accessibility rules sent on agent initialization |

When you choose the `glassmorphism` preset, UIForge also links directly to [`@lemuayala/glass-ui-core`](https://www.npmjs.com/package/@lemuayala/glass-ui-core) so agents can pair system-wide tokens with typed React and Expo glass primitives.

## Systems and screens

### 9 style presets

`glassmorphism` · `neobrutalism` · `minimalist` · `cyberpunk` · `corporate-saas` · `retro-80s` · `nature-organic` · `editorial` · `aurora-dark`

### 24 interactive brand design systems

| Category | Brand systems |
| :--- | :--- |
| **SaaS & Productivity** | Linear, Notion, Slack, Atlassian, Raycast, Cal.com |
| **Payments & Commerce** | Stripe, Shopify, Airbnb, Wise |
| **Devtools & Cloud** | Vercel, Supabase, GitHub Primer, Tailwind UI, shadcn/ui, Cloudflare, Sentry |
| **AI & Research** | Anthropic, OpenAI |
| **Design & UI** | Apple HIG, Figma, Material 3, Framer |
| **Media & Social** | Spotify, Netflix, Discord |

An extended reference folder in [`design-systems/`](design-systems/_catalog.md) holds **137 Markdown cards** with computed `HEX` and `oklch()` tables.

### 8 responsive page archetypes

| Key | Archetype | Included layout sections |
| :---: | :--- | :--- |
| `1` | **Landing** | Navigation bar, hero, social proof, feature grid, pricing preview, CTA |
| `2` | **Dashboard** | Collapsible sidebar, KPI cards, revenue chart, filterable activity table |
| `3` | **E-commerce** | Category header, product grid, badges, ratings, cart summary |
| `4` | **Auth** | Split brand panel, OAuth buttons, credentials form, validation states |
| `5` | **Profile** | Workspace header, avatar settings, domain inputs, danger zone |
| `6` | **Pricing** | Billing toggle, 3-tier comparison cards, highlighted Pro plan, FAQ |
| `7` | **Blog** | Editorial masthead, featured story, metadata, multi-column article list |
| `8` | **Components** | Buttons, inputs, badges, alerts, tabs, and token specimen cards |

## DESIGN.md and token exports

Every `DESIGN.md` compiled by UIForge follows a deterministic 9-section layout:

1. **Meta & Brand Context** — product name, target framework, voice tone, density, theme strategy.
2. **Perceptual Color System** — semantic roles in `HEX` and `oklch()`, plus live contrast ratios.
3. **Typography Scale** — heading, body, and monospace stacks with `rem` fluid sizing.
4. **Spacing & Layout Grid** — base unit (`4px` / `8px` / `12px`), section rhythm, breakpoints.
5. **Shape & Elevation** — border-radius scale, backdrop blur, and shadow hierarchy.
6. **Component Inventory** — required anatomy for the selected page archetype and brand rules.
7. **9-State Matrix** — Default, Hover, Focus-visible, Active, Disabled, Loading, Empty, Error, Success.
8. **Accessibility (WCAG 2.1 AA)** — contrast floors, `44×44px` hit targets, keyboard and motion rules.
9. **Tokens** — copy-paste `:root` custom properties with companion `.dark` / `[data-theme="light"]` blocks.

From the **Tokens** tab (or CLI / MCP), the same resolved state exports to:

- **`:root` CSS** (`tokens.css`) — standard CSS custom properties with light/dark companion selectors.
- **Tailwind CSS v4** (`tailwind-theme.css`) — `@import "tailwindcss"` + `@theme inline` token mapping.
- **W3C Design Tokens** (`tokens.json`) — `$value` / `$type` JSON schema with `oklch()` extensions for Figma and Style Dictionary.
- **Standalone HTML, PNG & PDF** — self-contained preview markup and visual snapshots from the stage toolbar.

## How it works

`@lemuayala/ui-forge-core` is the single source of truth. It has zero runtime dependencies and no Node-only globals in its main entry, so every surface shares the exact same code:

```text
packages/core  (OKLch math, WCAG AA solver, presets, 24 brands, HTML templates, DESIGN.md & token builders)
   ├── CLI            npx @lemuayala/ui-forge-core init | list | audit
   ├── packages/mcp   @lemuayala/ui-forge-mcp (stdio MCP server for coding agents)
   └── web app        Landing (/) and 3-column Playground (/play) on Next.js 16
```

Token priority is strictly deterministic:

```text
User manual overrides  >  Selected Brand System  >  Base Style Preset  +  Live sliders (Hue, Spacing, Scale, Opacity)
```

## What's new

Full release notes live in [CHANGELOG.md](CHANGELOG.md) and [GitHub Releases](https://github.com/lemuayala/Ui-design-md/releases).

- **0.6**: Monorepo extraction (`@lemuayala/ui-forge-core` + `ui-forge` CLI and `@lemuayala/ui-forge-mcp`), published to npm and the official MCP Registry with OIDC provenance and automated release versioning on `main`.
- **0.5**: 1-click OKLch WCAG 2.1 AA contrast auto-fix (`ensureContrastOklch`), Tailwind v4 `@theme` and W3C JSON exports, `localStorage` project profile persistence, Vercel Analytics + Speed Insights, dynamic OpenGraph image, and Vitest CI coverage gate.
- **0.4**: Dedicated Landing page (`/`) with scroll-driven zoom and reveal scenes, `/play` route split, URL state sharing, and bilingual `EN` / `ES` interface.

## Roadmap

Done:

- [x] 9 style presets, 24 interactive brand systems, 8 responsive screen archetypes, and 137 reference `.md` cards
- [x] Perceptual OKLch color engine with 1-click WCAG 2.1 AA contrast auto-fix
- [x] 9-section `DESIGN.md`, `:root` CSS, Tailwind v4 `@theme`, and W3C Design Tokens JSON exports
- [x] `@lemuayala/ui-forge-core` zero-config CLI published on npm
- [x] `@lemuayala/ui-forge-mcp` server published on npm and listed in the official MCP Registry

Next:

- [ ] Custom URL / website palette extractor to bootstrap a `DESIGN.md` from an existing domain
- [ ] Figma Variables import/export plugin synced with UIForge W3C JSON tokens
- [ ] Playwright visual regression suite across all 8 page archetypes and viewports

Have a brand system or workflow you'd like supported? [Open an issue](https://github.com/lemuayala/Ui-design-md/issues/new/choose).

## Run it locally

Requires Node 20.9+ (CI runs on Node 22) and **pnpm**.

```bash
git clone https://github.com/lemuayala/Ui-design-md.git
cd Ui-design-md
pnpm install
pnpm dev
```

The landing page runs at [localhost:3000](http://localhost:3000) and the playground at [localhost:3000/play](http://localhost:3000/play). Optional public URL variables are documented in [`.env.example`](.env.example).

| Command | What it does |
| :--- | :--- |
| `pnpm dev` | Build workspace packages and start Next.js dev server |
| `pnpm build` | Build workspace packages and production Next.js app |
| `pnpm lint` | Run ESLint 9 flat config |
| `pnpm typecheck` | Type-check `core`, `mcp`, and the Next.js app |
| `pnpm test` | Run Vitest unit and in-memory MCP protocol tests |
| `pnpm test:coverage` | Run tests enforcing `v8` coverage thresholds |
| `pnpm release:pack` | Dry-run npm tarballs for `packages/*` |
| `pnpm version:bump` | Synchronize version across packages, MCP manifest, UI, and `CHANGELOG.md` |
| `pnpm generate:design-systems` | Regenerate `design-systems/*.md` cards with computed OKLch values |

<details>
<summary><b>Playground keyboard shortcuts</b></summary>

| Shortcut | Action |
| :--- | :--- |
| `1`–`8` | Switch page archetype (`Landing` through `Components`) |
| `P` / `Cmd+K` | Open Presets & Brand Systems menu |
| `D` | Cycle preview theme (`Light` / `Dark` / `System`) |
| `T` | Toggle playground shell theme |
| `L` | Switch UI language (`EN` / `ES`) |
| `S` | Copy shareable `/play?...` URL |
| `?` | Open keyboard shortcuts dialog |
| `Esc` | Close active menu or dialog |

</details>

## Tech stack

| Layer | Technology |
| :--- | :--- |
| Framework | [Next.js 16](https://nextjs.org) (App Router, Turbopack) |
| UI | [React 19](https://react.dev) |
| Styling | [Tailwind CSS v4.3](https://tailwindcss.com) + `gg-glass` design tokens |
| Language | [TypeScript](https://www.typescriptlang.org) (strict mode across monorepo) |
| Color & Accessibility | Custom zero-dependency `sRGB ↔ OKLab ↔ OKLch` & WCAG 2.1 AA solver |
| AI Agent Protocol | [Model Context Protocol SDK](https://modelcontextprotocol.io) + [Zod](https://zod.dev) |
| Testing & Quality | [Vitest](https://vitest.dev) (`v8` coverage), ESLint 9, GitHub Actions CI |
| Publishing & Supply Chain | npm OIDC Trusted Publishing (`--provenance`) + Sigstore Cosign MCP Registry |
| Hosting & Telemetry | [Vercel](https://vercel.com) (`@vercel/analytics` + `@vercel/speed-insights`) |

## Contributing

Contributions of any size are welcome: bug fixes, new brand systems, page archetypes, token exporters, documentation improvements, or tests.

- [CONTRIBUTING.md](CONTRIBUTING.md) covers branch workflow (`dev` → `main`), Conventional Commits, and local setup.
- [AGENTS.md](AGENTS.md) and [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) document module boundaries and step-by-step checklists.
- Please read our [Code of Conduct](CODE_OF_CONDUCT.md), and report security vulnerabilities privately via [SECURITY.md](SECURITY.md).

<br/>

<div align="center">

  <p>Built by <a href="https://github.com/lemuayala">lemuayala</a></p>

  <a href="https://github.com/lemuayala/Ui-design-md">Star on GitHub</a> ·
  <a href="https://ui-forge-play.vercel.app/play">Open the Playground</a> ·
  <a href="https://www.npmjs.com/package/@lemuayala/ui-forge-mcp">Install MCP Server</a> ·
  <a href="https://github.com/lemuayala/Ui-design-md/issues/new/choose">Report an Issue</a>

  <br/><br/>

  <sub>MIT License</sub>

</div>