-
Notifications
You must be signed in to change notification settings - Fork 0
quick start
This tutorial assumes a consumer app repo (a .specui/ folder inside your app). If you're building a publishable design-system repo, see Scenarios — flat repo instead.
-
Install — Node 18+,
npxor globalspecui - A git repo (recommended) at your app root
From your application root:
cd your-app-repo
npx @logicplanes/specui@latest init \
--name "Acme" \
--preset web-app \
--agents-md \
--agent-tools cursor \
--ci githubWhat this creates:
| Output | Purpose |
|---|---|
.specui/ |
Full contract (SPEC, tokens, numbered docs, manifests) |
AGENTS.md |
SpecUI block for coding agents |
.cursor/rules/specui.mdc |
Cursor rule (when --agent-tools cursor) |
.github/workflows/specui.yml |
CI validate job (when --ci github) |
Want to see what would happen without writing anything? Dry-run it:
npx specui init --dry-run --preset blank --target /tmp/previewnpx specui doctor
npx specui validate .specuidoctor prints layout, AGENTS.md status, counts, and runs validate. Fix any errors before continuing — they only get harder to untangle later.
This is the core habit: add a component before implementing it in React/Vue/etc., so the contract leads and the code follows.
npx specui add component primary-button \
--variants default,destructive \
--states default,hover,focus,disabledAdd a semantic token:
npx specui add token color.brand.primary "#f54e00" --theme light
npx specui add token color.brand.primary "#ff6b2c" --theme darkAdd a flow pattern (pick a name the preset doesn't already ship — specui list patterns shows what's there):
npx specui add pattern onboarding-checklistRebuild the registry index:
npx specui sync
npx specui list allnpx specui validate .specui --strictA fresh init will show state-row-empty warnings from the preset's placeholder STATES.md files — these are expected. Fix them as you fill in each component, or run without --strict until you do.
Use --strict in GitHub Actions so warnings (contrast, placeholders) fail the build. See CI/CD.
Pull shadcn reference files into the spec. Pick a component the web-app preset doesn't already ship (the preset includes button, card, dialog, etc., so get button would error with "Component already exists" — specui list components shows what's already there):
npx specui get --list
npx specui get carousel
npx specui validate .specui && npx specui syncDetails: Registries.
- Read
.specui/components/primary-button/andTOKENS.yaml - Map tokens to your stack (CSS vars, Tailwind theme, etc.) — or use
specui export - After code changes that touch design: run validate + sync again
- Commit
.specui/and code in the same commit
Agent protocol: Agents & MCP.
-
initscaffolds the contract and agent wiring -
addregisters design artifacts -
validate+synckeep the registry honest -
getoptionally vendors registry implementations
- Concepts — deeper mental model
- Scenarios — monorepo, flat DS, exports
- CLI reference — every command
- Troubleshooting — when validate fails
Getting started
How-to guides
- Scenarios
- Tokens And Components
- Agents And Mcp
- Agent Prompts
- Ci Cd
- Distribution
- Registries
- Interop
- Designmd
- Validation
- Troubleshooting
Reference
Community