Openui Scaffold
Scaffold a new OpenUI project or add OpenUI to an existing project
Trigger the OpenUI scaffolding workflow. Follow the decision tree from SKILL.md exactly.
Step 1 — Detect project state:
- Check if a package.json exists in the current directory
- If yes, detect the framework by checking for next.config., vite.config., or neither
- If no package.json exists, check if this is a non-JS project (look for requirements.txt, go.mod, Cargo.toml)
Step 2 — Follow the scaffold decision tree:
No existing project detected:
- Run
npx @openuidev/cli@latest create --name ${PROJECT_NAME}(ask the user for a project name) - Wait for scaffold to complete
- Inform the user to run
/openui:integratenext
Existing Next.js project:
- Install dependencies:
npm install @openuidev/react-ui @openuidev/react-headless @openuidev/react-lang lucide-react zod - Add CSS imports to the root layout file (app/layout.tsx or similar):
import "@openuidev/react-ui/components.css"; import "@openuidev/react-ui/styles/index.css"; - Create a component library file using
templates/library.ts.template— or ask the user if they want to use the built-inopenuiLibraryfrom@openuidev/react-ui - Recommend running
/openui:integratenext
Existing Vite + React project:
- Same dependencies as Next.js
- Add CSS imports to the main entry file (main.tsx or App.tsx)
- Create a component library file using
templates/library.ts.template - Note: A proxy to the backend will need to be configured in vite.config.ts during integration
- Recommend running
/openui:integratenext
Non-JS backend (Python / Go / Rust):
- Create a React frontend (ask: Next.js or Vite?) and install OpenUI deps there
- Create a component library in the frontend using
templates/library.ts.template - Run
npx @openuidev/cli generate ./src/lib/library.ts --out system-prompt.txtto pre-generate the system prompt - Copy system-prompt.txt to the backend service directory
- Note: The backend handler will be created during
/openui:integrate - Recommend running
/openui:integratenext
After scaffolding, always run /openui to verify the project state.