designmd-live
v0.1.3
Published
Live editor for DESIGN.md, wired on your real codebase
Downloads
472
Maintainers
Readme
designmd-live
Live editor for DESIGN.md — mounts as a Shadow DOM overlay on top of your real dev app.
Tweak the tokens of your DESIGN.md in a sidebar that lives inside your dev page, watch your actual app re-render. No iframe, no proxy, no design system rebuild, no reload.
Install
pnpm add -D designmd-liveQuick start
# 1. From your project root
npx designmd-live init # creates DESIGN.md, wires the agent script tag
# 2. Start the overlay server (any spare terminal)
npx designmd-live dev # http://localhost:3030
# 3. Run your normal dev server, e.g.
pnpm dev # http://localhost:3000Open your normal dev URL (e.g. http://localhost:3000). A 420px sidebar appears on the left with your token tree, edits live-update the page, save persists DESIGN.md on disk.
init auto-detects Next.js App Router projects (src/app/layout.tsx) and inserts the dev-only script tag for you. It's idempotent: rerunning is a no-op if the tag is already present.
Manual wiring
If your project layout isn't auto-detected, add the snippet inside <body> in dev only:
{process.env.NODE_ENV === 'development' && (
<script src="http://localhost:3030/client.js" async data-designmd-live />
)}That's the only project-side change. Everything else stays untouched.
How tokens map to CSS
Tokens in your DESIGN.md are converted to CSS custom properties on :root, with the path joined by -:
| DESIGN.md | CSS variable |
|---|---|
| color.background | --color-background |
| color.brand.500 | --color-brand-500 |
| spacing.4 | --spacing-4 |
| radius.lg | --radius-lg |
This matches Tailwind v4's @theme {} convention out of the box. If your project uses Tailwind v4, your tokens will already be exposed under matching variable names — the agent simply overrides them in a higher-specificity <style> block.
Flags
| Flag | Default | Notes |
|---|---|---|
| --port | 3030 | Port for the overlay server |
| --cwd | process.cwd() | Where to read/write DESIGN.md |
Endpoints
GET /— plain text instructions for wiring the agentGET /api/health—{ ok: true }GET /api/design-md— read & parse the current DESIGN.mdPOST /api/design-md— write a new DESIGN.md (validated)GET /client.js— the browser agent IIFE bundle (panel + inspector)WS /ws— broker (panel ↔ target page)
Requirements
- Node.js 24+
- A project that uses CSS custom properties for design tokens. Tailwind v4 with
@themeis the most direct fit; any framework that consumes:root { --foo: ... }will work.
License
MIT
