-
Notifications
You must be signed in to change notification settings - Fork 0
scenarios
Pick the scenario that matches your repo and follow it top to bottom. Each one links to a deeper guide when you want the details.
You have an app repo and you want a governed design system in it, not a wiki page nobody reads.
- Install Node 18+ and run from the app root:
npx @logicplanes/specui@latest init \
--name "Acme Console" \
--preset web-app \
--agents-md \
--agent-tools cursor \
--ci github- Confirm everything is healthy:
npx specui doctor
npx specui validate .specui- Register your first real component before writing any UI code:
npx specui add component primary-button --variants default,destructive --states default,hover,disabled- Optionally pull a shadcn reference implementation:
npx specui get button- Gate merges so the contract stays honest: CI/CD.
Docs: Quick start · Registries · Agents & MCP
You want a standalone repo that other apps load or link.
mkdir acme-ds && cd acme-ds
npx @logicplanes/specui@latest new . --preset design-system-library --git
npx specui validate .
npx specui push --remote origin # after adding remoteConsumers install it like this:
cd ../my-app
npx specui load git+https://github.com/your-org/acme-ds.git --as acme
npx specui validate .specui --strictWhile you're actively developing the design system, symlink instead of copying:
npx specui link ../acme-ds --as acme
# edit ../acme-ds, then in app:
npx specui update --name acmeDocs: Distribution · Interop
One .specui/ per app package, or one shared design-system package — both work. Pick based on how many brands you actually have.
Option 1 — a design-system package that apps load:
- Flat DS in
packages/design-system/(specui new) - Each app:
specui load file:../../packages/design-system --as ds
Option 2 — a .specui/ per app:
- Run
specui initin each app that needs its own brand
Option 3 — symlink during development:
-
specui linkfrom app to local DS folder
In CI, run validate in each package that owns a .specui/. See CI/CD.
The goal here is that agents read the spec before writing UI, not after you catch the drift in review.
-
initwith--agents-mdand tool files:
npx specui init --agents-md --agent-tools cursor,claude,copilot --starter-kit-
Make sure agents read, in order:
AGENTS.md→.specui/AGENTS-GUIDE.md→AGENT-DESIGN-RULES.md→ the relevantcomponents/folders. -
Add project rules:
npx specui rules add no-raw-hex --from no-raw-hex
npx specui skills add sync-design-to-code --from sync-design-to-code- Optionally wire up MCP:
npx specui mcp config
npx specui mcp install-hook cursorDocs: Agents & MCP · Validation
Keep shadcn components in the repo and a full spec alongside them.
npx specui init --preset web-app
npx specui get --list
npx specui get button card dialog
npx specui validate .specui && npx specui syncSpecUI stores vendor files under components/<name>/vendor/. Your tokens and rules still live in TOKENS.yaml and DOS-DONTs.md — agents don't get to bypass them just "because shadcn did it."
Docs: Registries
Feed existing pipelines from .specui/ instead of maintaining two sources of truth.
npx specui export --format tailwind --theme light --to ./tailwind.specui.js --from .specui
npx specui export --format css --theme light --to ./src/styles/specui-tokens.css
npx specui export --format dtcg --theme light --to ./tokens.dtcg.json
npx specui export --format designmd --to ./DESIGN.mdRe-run export after every contract change. Never edit the exports directly — they are generated output, not the source of truth.
Docs: Interop
You have loose design docs and want them under SpecUI's governance.
specui init --preset blank- Manually move principles and tokens into the numbered files and
TOKENS.yaml -
specui add componentfor each component you already ship -
specui importif you have a tarball from another SpecUI project:
npx specui import ./backup-specui.tgz --force- Run
validate --strictuntil it's clean
Use specui diff to compare old and new token sets along the way.
New CLI, existing .specui/.
npm install -D @logicplanes/specui@latest
npx specui doctor
npx specui validate .specui --strictRe-running specui init without --force only refreshes the AGENTS.md block; use --force only if you actually intend to overwrite the contract — it's destructive.
Watch the changelog for breaking schema notes.
Contributors should see the design rules in the repo, not in a private doc.
- Commit
.specui/,AGENTS.md, and the optional.github/workflows/specui.ymlfrominit --ci github - In your README, link to the docs and note that CI runs
specui validate --strict - See Contributing for this open-source CLI repo, as opposed to your own app's contributor guide
| I need to… | Command / page |
|---|---|
| Scaffold app |
specui init · init reference
|
| Publish DS |
specui new · Distribution
|
| Add UI piece |
specui add · CLI
|
| Pull shadcn |
specui get · Registries
|
| Fail CI on drift |
validate --strict · CI/CD
|
| Wire Cursor | Agents & MCP |
| Fix errors | Troubleshooting |
Getting started
How-to guides
- Scenarios
- Tokens And Components
- Agents And Mcp
- Agent Prompts
- Ci Cd
- Distribution
- Registries
- Interop
- Designmd
- Validation
- Troubleshooting
Reference
Community