
ui-forge
io.github.lemuayala/ui-forge
Compile DESIGN.md specs, OKLch/Tailwind v4/W3C tokens, and WCAG AA fixes across 24 brands.
Documentation
UIForge
Design systems your AI won't break — tuned in OKLch, verified for WCAG AA, and compiled to DESIGN.md.
Explore 24 canonical brand systems and 9 visual presets across 8 full-page archetypes in a live playground,
then ship exact tokens into your repo via the CLI, an official MCP server, or a 9-section DESIGN.md spec.
Why UIForge · Get started · AI agents · Systems & screens · DESIGN.md & exports · How it works · What's new · Roadmap · Contributing
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 |
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/ |
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.
# 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 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
claude mcp add ui-forge -- npx -y @lemuayala/ui-forge-mcp
Cursor, Windsurf, Antigravity (add to mcp.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 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/ 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:
- Meta & Brand Context — product name, target framework, voice tone, density, theme strategy.
- Perceptual Color System — semantic roles in
HEXandoklch(), plus live contrast ratios. - Typography Scale — heading, body, and monospace stacks with
remfluid sizing. - Spacing & Layout Grid — base unit (
4px/8px/12px), section rhythm, breakpoints. - Shape & Elevation — border-radius scale, backdrop blur, and shadow hierarchy.
- Component Inventory — required anatomy for the selected page archetype and brand rules.
- 9-State Matrix — Default, Hover, Focus-visible, Active, Disabled, Loading, Empty, Error, Success.
- Accessibility (WCAG 2.1 AA) — contrast floors,
44×44pxhit targets, keyboard and motion rules. - Tokens — copy-paste
:rootcustom properties with companion.dark/[data-theme="light"]blocks.
From the Tokens tab (or CLI / MCP), the same resolved state exports to:
:rootCSS (tokens.css) — standard CSS custom properties with light/dark companion selectors.- Tailwind CSS v4 (
tailwind-theme.css) —@import "tailwindcss"+@theme inlinetoken mapping. - W3C Design Tokens (
tokens.json) —$value/$typeJSON schema withoklch()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:
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:
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 and GitHub Releases.
- 0.6: Monorepo extraction (
@lemuayala/ui-forge-core+ui-forgeCLI and@lemuayala/ui-forge-mcp), published to npm and the official MCP Registry with OIDC provenance and automated release versioning onmain. - 0.5: 1-click OKLch WCAG 2.1 AA contrast auto-fix (
ensureContrastOklch), Tailwind v4@themeand W3C JSON exports,localStorageproject 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,/playroute split, URL state sharing, and bilingualEN/ESinterface.
Roadmap
Done:
- 9 style presets, 24 interactive brand systems, 8 responsive screen archetypes, and 137 reference
.mdcards - Perceptual OKLch color engine with 1-click WCAG 2.1 AA contrast auto-fix
- 9-section
DESIGN.md,:rootCSS, Tailwind v4@theme, and W3C Design Tokens JSON exports -
@lemuayala/ui-forge-corezero-config CLI published on npm -
@lemuayala/ui-forge-mcpserver published on npm and listed in the official MCP Registry
Next:
- Custom URL / website palette extractor to bootstrap a
DESIGN.mdfrom 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.
Run it locally
Requires Node 20.9+ (CI runs on Node 22) and pnpm.
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 and the playground at localhost:3000/play. Optional public URL variables are documented in .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 |
Playground keyboard shortcuts
| 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 |
Tech stack
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack) |
| UI | React 19 |
| Styling | Tailwind CSS v4.3 + gg-glass design tokens |
| Language | TypeScript (strict mode across monorepo) |
| Color & Accessibility | Custom zero-dependency sRGB ↔ OKLab ↔ OKLch & WCAG 2.1 AA solver |
| AI Agent Protocol | Model Context Protocol SDK + Zod |
| Testing & Quality | Vitest (v8 coverage), ESLint 9, GitHub Actions CI |
| Publishing & Supply Chain | npm OIDC Trusted Publishing (--provenance) + Sigstore Cosign MCP Registry |
| Hosting & Telemetry | Vercel (@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 covers branch workflow (
dev→main), Conventional Commits, and local setup. - AGENTS.md and docs/ARCHITECTURE.md document module boundaries and step-by-step checklists.
- Please read our Code of Conduct, and report security vulnerabilities privately via SECURITY.md.
Built by lemuayala
Star on GitHub · Open the Playground · Install MCP Server · Report an Issue
MIT License
@lemuayala/ui-forge-mcpnpm install @lemuayala/ui-forge-mcp