@create-ui/cli 0.5.8 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/{chunk-RMTTHCB3.js → chunk-2ELKDGGM.js} +3 -3
  2. package/dist/{chunk-RMTTHCB3.js.map → chunk-2ELKDGGM.js.map} +1 -1
  3. package/dist/chunk-643QI2I2.js +102 -0
  4. package/dist/chunk-643QI2I2.js.map +1 -0
  5. package/dist/{chunk-NQFMXHMH.js → chunk-KQTXDVKV.js} +3 -3
  6. package/dist/chunk-KQTXDVKV.js.map +1 -0
  7. package/dist/index.d.ts +360 -360
  8. package/dist/index.js +26 -26
  9. package/dist/index.js.map +1 -1
  10. package/dist/mcp/index.js +1 -1
  11. package/dist/registry/index.d.ts +2 -2
  12. package/dist/registry/index.js +1 -1
  13. package/dist/schema/index.d.ts +715 -715
  14. package/dist/skills/createui/SKILL.md +199 -177
  15. package/dist/skills/createui/agents/openai.yml +1 -1
  16. package/dist/skills/createui/cli.md +42 -42
  17. package/dist/skills/createui/customization.md +20 -15
  18. package/dist/skills/createui/evals/evals.json +68 -5
  19. package/dist/skills/createui/mcp.md +14 -5
  20. package/dist/skills/createui/reference/accordion.md +127 -0
  21. package/dist/skills/createui/reference/app-store-badge.md +88 -0
  22. package/dist/skills/createui/reference/aspect-ratio.md +52 -0
  23. package/dist/skills/createui/reference/avatar.md +230 -0
  24. package/dist/skills/createui/reference/badge.md +110 -0
  25. package/dist/skills/createui/reference/breadcrumb.md +153 -0
  26. package/dist/skills/createui/reference/button-group.md +116 -0
  27. package/dist/skills/createui/reference/button.md +104 -0
  28. package/dist/skills/createui/reference/checkbox-group.md +118 -0
  29. package/dist/skills/createui/reference/checkbox.md +79 -0
  30. package/dist/skills/createui/reference/chip.md +115 -0
  31. package/dist/skills/createui/reference/close-button.md +83 -0
  32. package/dist/skills/createui/reference/country-flag.md +109 -0
  33. package/dist/skills/createui/reference/credit-card-input.md +76 -0
  34. package/dist/skills/createui/reference/date-input.md +71 -0
  35. package/dist/skills/createui/reference/dropdown-menu.md +164 -0
  36. package/dist/skills/createui/reference/field.md +186 -0
  37. package/dist/skills/createui/reference/info-tooltip.md +110 -0
  38. package/dist/skills/createui/reference/inline-alert.md +146 -0
  39. package/dist/skills/createui/reference/input-group.md +171 -0
  40. package/dist/skills/createui/reference/input-otp.md +130 -0
  41. package/dist/skills/createui/reference/input-stepper.md +120 -0
  42. package/dist/skills/createui/reference/input.md +118 -0
  43. package/dist/skills/createui/reference/label.md +121 -0
  44. package/dist/skills/createui/reference/pagination.md +157 -0
  45. package/dist/skills/createui/reference/phone-input.md +77 -0
  46. package/dist/skills/createui/reference/progress.md +158 -0
  47. package/dist/skills/createui/reference/radio-group.md +133 -0
  48. package/dist/skills/createui/reference/radio.md +79 -0
  49. package/dist/skills/createui/reference/scroll-area.md +212 -0
  50. package/dist/skills/createui/reference/segmented-control.md +146 -0
  51. package/dist/skills/createui/reference/select.md +204 -0
  52. package/dist/skills/createui/reference/separator.md +99 -0
  53. package/dist/skills/createui/reference/social-login-button.md +130 -0
  54. package/dist/skills/createui/reference/spinner.md +68 -0
  55. package/dist/skills/createui/reference/status-badge.md +89 -0
  56. package/dist/skills/createui/reference/switch-group.md +122 -0
  57. package/dist/skills/createui/reference/switch.md +75 -0
  58. package/dist/skills/createui/reference/tab-menu.md +165 -0
  59. package/dist/skills/createui/reference/text-link.md +84 -0
  60. package/dist/skills/createui/reference/textarea.md +50 -0
  61. package/dist/skills/createui/reference/toast.md +162 -0
  62. package/dist/skills/createui/reference/tooltip.md +63 -0
  63. package/dist/skills/createui/rules/composition.md +41 -25
  64. package/dist/skills/createui/rules/design.md +266 -0
  65. package/dist/skills/createui/rules/forms.md +44 -15
  66. package/dist/skills/createui/rules/icons.md +64 -18
  67. package/dist/skills/createui/rules/styling.md +53 -14
  68. package/dist/utils/index.js +1 -1
  69. package/package.json +1 -1
  70. package/dist/chunk-M5DYT2NE.js +0 -64
  71. package/dist/chunk-M5DYT2NE.js.map +0 -1
  72. package/dist/chunk-NQFMXHMH.js.map +0 -1
@@ -2,9 +2,9 @@
2
2
 
3
3
  Configuration is read from `components.json`.
4
4
 
5
- The CLI is published as **`@create-ui/cli`** and exposes the **`createui`** bin. Run it with `npx @create-ui/cli <command>` or install it globally with `pnpm add -g @create-ui/cli` and then run `createui <command>`.
5
+ The CLI is published as **`@create-ui/cli`** and exposes the **`createui`** bin. Run it with `npx @create-ui/cli <command>` - or install it globally with `pnpm add -g @create-ui/cli` and then run `createui <command>`.
6
6
 
7
- > **IMPORTANT:** Only use the flags documented below. Do not invent or guess flags if a flag isn't listed here, it doesn't exist.
7
+ > **IMPORTANT:** Only use the flags documented below. Do not invent or guess flags - if a flag isn't listed here, it doesn't exist.
8
8
 
9
9
  ## Contents
10
10
 
@@ -12,7 +12,7 @@ The CLI is published as **`@create-ui/cli`** and exposes the **`createui`** bin.
12
12
  - Templates: next, vite, start, next-monorepo
13
13
  - Registry & namespaces: the built-in `@createui` (the only registry)
14
14
 
15
- (The CLI also has `build` / `registry:build` commands for registry authors publishing their own items not needed for using Create UI in an app.)
15
+ (The CLI also has `build` / `registry:build` commands for registry authors publishing their own items - not needed for using Create UI in an app.)
16
16
 
17
17
  ---
18
18
 
@@ -20,7 +20,7 @@ The CLI is published as **`@create-ui/cli`** and exposes the **`createui`** bin.
20
20
 
21
21
  Program name `createui`. Description: "add items from registries to your project". Print the version with `-v, --version`.
22
22
 
23
- ### `init` Initialize your project and install dependencies
23
+ ### `init` - Initialize your project and install dependencies
24
24
 
25
25
  ```bash
26
26
  npx @create-ui/cli init [components...] [options]
@@ -30,50 +30,50 @@ Initializes Create UI in an existing project: writes `components.json`, installs
30
30
 
31
31
  | Flag | Short | Description | Default |
32
32
  | ------------------------ | ----- | --------------------------------------------------------------- | ------- |
33
- | `--template <template>` | `-t` | Template: `next`, `start`, `vite`, `next-monorepo` | |
34
- | `--theme <theme>` | | Primary color theme: `indigo`, `blue`, `lime`, `green`, `red`, `orange`, `yellow`, `cyan` | |
35
- | `--neutral <neutral>` | | Neutral color theme: `gray`, `slate`, `zinc`, `base`, `stone` | |
36
- | `--font-variant <v>` | | Font variant: `v1` | |
37
- | `--base-color <color>` | `-b` | DEPRECATED use `--theme` instead | |
33
+ | `--template <template>` | `-t` | Template: `next`, `start`, `vite`, `next-monorepo` | - |
34
+ | `--theme <theme>` | | Primary color theme: `indigo`, `blue`, `lime`, `green`, `red`, `orange`, `yellow`, `cyan` | - |
35
+ | `--neutral <neutral>` | | Neutral color theme: `gray`, `slate`, `zinc`, `base`, `stone` | - |
36
+ | `--font-variant <v>` | | Font variant: `v1` | - |
37
+ | `--base-color <color>` | `-b` | DEPRECATED - use `--theme` instead | - |
38
38
  | `--yes` | `-y` | Skip confirmation prompt | `true` |
39
39
  | `--defaults` | `-d` | Use default configuration | `false` |
40
40
  | `--force` | `-f` | Force overwrite of existing config | `false` |
41
41
  | `--cwd <cwd>` | `-c` | Working directory | current |
42
42
  | `--silent` | `-s` | Mute output | `false` |
43
- | `--src-dir` | | Use the `src` directory | |
44
- | `--no-src-dir` | | Do not use the `src` directory | |
43
+ | `--src-dir` | | Use the `src` directory | - |
44
+ | `--no-src-dir` | | Do not use the `src` directory | - |
45
45
  | `--css-variables` | | Use CSS variables for theming | `true` |
46
- | `--no-css-variables` | | Do not use CSS variables for theming | |
47
- | `--no-base-style` | | Do not install the base Create UI style | |
46
+ | `--no-css-variables` | | Do not use CSS variables for theming | - |
47
+ | `--no-base-style` | | Do not install the base Create UI style | - |
48
48
 
49
49
  Pick a theme with `--theme` and `--neutral`; these are swappable token sets layered on the one Create UI system (there is no style/base split to choose).
50
50
 
51
- ### `create` Create a new project with Create UI
51
+ ### `create` - Create a new project with Create UI
52
52
 
53
53
  ```bash
54
54
  npx @create-ui/cli create [name] [options]
55
55
  ```
56
56
 
57
- Scaffolds a brand-new project. Anything not passed as a flag is prompted interactively: project name, template, then the theme choices (primary / neutral / font). `--preset` skips the theme prompts bare `--preset` shows an interactive preset list, or pass a preset name/URL directly.
57
+ Scaffolds a brand-new project. Anything not passed as a flag is prompted interactively: project name, template, then the theme choices (primary / neutral / font). `--preset` skips the theme prompts - bare `--preset` shows an interactive preset list, or pass a preset name/URL directly.
58
58
 
59
59
  | Flag | Short | Description | Default |
60
60
  | ----------------------- | ----- | --------------------------------------------- | ------- |
61
- | `--template <template>` | `-t` | Template: `next`, `start`, `vite` | |
62
- | `--preset [name]` | `-p` | Use a preset configuration (interactive list if no name) | |
61
+ | `--template <template>` | `-t` | Template: `next`, `start`, `vite` | - |
62
+ | `--preset [name]` | `-p` | Use a preset configuration (interactive list if no name) | - |
63
63
  | `--cwd <cwd>` | `-c` | Working directory | current |
64
- | `--src-dir` | | Use the `src` directory | |
65
- | `--no-src-dir` | | Do not use the `src` directory | |
64
+ | `--src-dir` | | Use the `src` directory | - |
65
+ | `--no-src-dir` | | Do not use the `src` directory | - |
66
66
  | `--yes` | `-y` | Skip confirmation prompt | `true` |
67
67
 
68
68
  `create` scaffolds a **project**; it is not an alias for `init`. To set up Create UI inside an existing project, use `init`.
69
69
 
70
- ### `add` Add a component to your project
70
+ ### `add` - Add a component to your project
71
71
 
72
72
  ```bash
73
73
  npx @create-ui/cli add [components...] [options]
74
74
  ```
75
75
 
76
- Accepts bare names (`button`), full URLs, and local paths. There is no namespaced item form `add @createui/button` does not resolve; always use the bare name.
76
+ Accepts bare names (`button`), full URLs, and local paths. There is no namespaced item form - `add @createui/button` does not resolve; always use the bare name.
77
77
 
78
78
  | Flag | Short | Description | Default |
79
79
  | --------------------- | ----- | -------------------------------------- | ------- |
@@ -81,12 +81,12 @@ Accepts bare names (`button`), full URLs, and local paths. There is no namespace
81
81
  | `--overwrite` | `-o` | Overwrite existing files | `false` |
82
82
  | `--cwd <cwd>` | `-c` | Working directory | current |
83
83
  | `--all` | `-a` | Add all available components | `false` |
84
- | `--path <path>` | `-p` | The path to add the component to | |
84
+ | `--path <path>` | `-p` | The path to add the component to | - |
85
85
  | `--silent` | `-s` | Mute output | `false` |
86
- | `--src-dir` | | Use the `src` directory | |
87
- | `--no-src-dir` | | Do not use the `src` directory | |
86
+ | `--src-dir` | | Use the `src` directory | - |
87
+ | `--no-src-dir` | | Do not use the `src` directory | - |
88
88
  | `--css-variables` | | Use CSS variables for theming | `true` |
89
- | `--no-css-variables` | | Do not use CSS variables for theming | |
89
+ | `--no-css-variables` | | Do not use CSS variables for theming | - |
90
90
 
91
91
  ```bash
92
92
  # Add by name.
@@ -98,7 +98,7 @@ npx @create-ui/cli add https://createui.co/r/button.json
98
98
 
99
99
  To check whether installed components are out of date, use the `diff` command (below).
100
100
 
101
- ### `diff` Check for updates against the registry
101
+ ### `diff` - Check for updates against the registry
102
102
 
103
103
  ```bash
104
104
  npx @create-ui/cli diff [component] [options]
@@ -111,19 +111,19 @@ With no argument, lists the components that have updates available. With a compo
111
111
  | `--yes` | `-y` | Skip confirmation prompt | `false` |
112
112
  | `--cwd <cwd>` | `-c` | Working directory | current |
113
113
 
114
- ### `view` View items from the registry
114
+ ### `view` - View items from the registry
115
115
 
116
116
  ```bash
117
117
  npx @create-ui/cli view <items...> [options]
118
118
  ```
119
119
 
120
- Prints item metadata plus file contents (as JSON). Items are bare names or URLs, e.g. `button`.
120
+ Prints item metadata plus file contents (as JSON). Items are bare names or URLs, e.g. `button`. Examples are registry items too - `view badge-demo` prints a component's canonical usage; check it (or the skill's `reference/<name>.md`) before the first use of a component.
121
121
 
122
122
  | Flag | Short | Description | Default |
123
123
  | ------------- | ----- | ----------------- | ------- |
124
124
  | `--cwd <cwd>` | `-c` | Working directory | current |
125
125
 
126
- ### `search` (alias: `list`) Search items from registries
126
+ ### `search` (alias: `list`) - Search items from registries
127
127
 
128
128
  ```bash
129
129
  npx @create-ui/cli search <registries...> [options]
@@ -134,7 +134,7 @@ Searches one or more registries. Registry names must start with `@` (e.g. `@crea
134
134
 
135
135
  | Flag | Short | Description | Default |
136
136
  | ------------------- | ----- | ---------------------- | ------- |
137
- | `--query <query>` | `-q` | Search query | |
137
+ | `--query <query>` | `-q` | Search query | - |
138
138
  | `--limit <number>` | `-l` | Max items per registry | `100` |
139
139
  | `--offset <number>` | `-o` | Items to skip | `0` |
140
140
  | `--cwd <cwd>` | `-c` | Working directory | current |
@@ -147,7 +147,7 @@ npx @create-ui/cli search @createui
147
147
  npx @create-ui/cli search @createui -q select
148
148
  ```
149
149
 
150
- ### `migrate` Run a migration
150
+ ### `migrate` - Run a migration
151
151
 
152
152
  ```bash
153
153
  npx @create-ui/cli migrate [migration] [options]
@@ -155,16 +155,16 @@ npx @create-ui/cli migrate [migration] [options]
155
155
 
156
156
  Available migrations:
157
157
 
158
- - `icons` migrate a project from a legacy icon library (lucide / radix) to Create UI's `@create-ui/assets/icons` (Remix `Ri*`).
159
- - `radix` migrate to `radix-ui`, consolidating `@radix-ui/react-*` imports into the unified `radix-ui` package.
158
+ - `icons` - migrate a project from a legacy icon library (lucide / radix) to Create UI's `@create-ui/assets/icons` (Remix `Ri*`).
159
+ - `radix` - migrate to `radix-ui`, consolidating `@radix-ui/react-*` imports into the unified `radix-ui` package.
160
160
 
161
161
  | Flag | Short | Description | Default |
162
162
  | ------------- | ----- | ------------------------ | ------- |
163
- | `--list` | `-l` | List available migrations | |
164
- | `--yes` | `-y` | Skip confirmation prompt | |
163
+ | `--list` | `-l` | List available migrations | - |
164
+ | `--yes` | `-y` | Skip confirmation prompt | - |
165
165
  | `--cwd <cwd>` | `-c` | Working directory | current |
166
166
 
167
- ### `info` Get information about your project
167
+ ### `info` - Get information about your project
168
168
 
169
169
  ```bash
170
170
  npx @create-ui/cli info [options]
@@ -176,7 +176,7 @@ Prints project information plus the contents of `components.json`. Run this firs
176
176
  | ------------- | ----- | ----------------- | ------- |
177
177
  | `--cwd <cwd>` | `-c` | Working directory | current |
178
178
 
179
- ### `mcp` MCP server and configuration commands
179
+ ### `mcp` - MCP server and configuration commands
180
180
 
181
181
  ```bash
182
182
  # Start the stdio MCP server.
@@ -191,11 +191,11 @@ Running `createui mcp` starts the stdio MCP server. The `mcp init` subcommand wr
191
191
  | Subcommand / Flag | Description | Default |
192
192
  | ----------------------- | ----------------------------------------------------------------- | ------- |
193
193
  | `mcp` `--cwd <cwd>` | Working directory | current |
194
- | `mcp init --client <c>` | Client to configure: `claude`, `cursor`, `vscode`, `codex`, `opencode` | |
194
+ | `mcp init --client <c>` | Client to configure: `claude`, `cursor`, `vscode`, `codex`, `opencode` | - |
195
195
 
196
196
  See [mcp.md](./mcp.md) for the MCP server details, the available tools, and per-client config paths.
197
197
 
198
- ### `skill` Install the Create UI agent skill
198
+ ### `skill` - Install the Create UI agent skill
199
199
 
200
200
  ```bash
201
201
  npx @create-ui/cli skill
@@ -208,7 +208,7 @@ Installs this skill into the agent's skills directory (personal home directory b
208
208
  | ------------------- | ----- | -------------------------------------------------------------------- | -------- |
209
209
  | `--client <client>` | | Agent to install for: `claude`, `gemini`, `codex`, `agents` | `claude` |
210
210
  | `--project` | | Install into the project instead of the home directory | `false` |
211
- | `--path <path>` | `-p` | Install into an explicit skills directory (for other agents) | |
211
+ | `--path <path>` | `-p` | Install into an explicit skills directory (for other agents) | - |
212
212
  | `--cwd <cwd>` | `-c` | Working directory | current |
213
213
  | `--force` | `-f` | Overwrite an existing skill installation | `false` |
214
214
  | `--yes` | `-y` | Skip the overwrite confirmation prompt | `false` |
@@ -230,12 +230,12 @@ The `init` `--template` option accepts:
230
230
 
231
231
  ## Registry & namespaces
232
232
 
233
- **`@createui` is the only registry.** It is built in nothing to configure and resolves item names to:
233
+ **`@createui` is the only registry.** It is built in - nothing to configure - and resolves item names to:
234
234
 
235
235
  ```
236
236
  https://createui.co/r/{name}.json
237
237
  ```
238
238
 
239
- So `add button` fetches `https://createui.co/r/button.json`. Items are always referenced by **bare name**; the `@createui` name itself is only used as the registry argument to `search` / `list`. Never prefix item names with it `view @createui/button` resolves to the literal path `…/r/@createui/button.json` and 404s.
239
+ So `add button` fetches `https://createui.co/r/button.json`. Items are always referenced by **bare name**; the `@createui` name itself is only used as the registry argument to `search` / `list`. Never prefix item names with it - `view @createui/button` resolves to the literal path `…/r/@createui/button.json` and 404s.
240
240
 
241
241
  Never configure additional registries, add a `registries` field to `components.json`, or point the CLI at another registry host.
@@ -20,7 +20,7 @@ Create UI is **one styling system with many themes**. Components reference seman
20
20
 
21
21
  1. CSS variables are defined in `:root` (light) and overridden under `.dark` (dark mode), as **HEX** values.
22
22
  2. Tailwind v4 auto-generates utilities from those `--color-*` / `--spacing-*` / `--radius-*` variables (`bg-weakest`, `text-body`, `gap-component-sm`, …).
23
- 3. Components consume those utilities change a variable, or swap the active theme, and every component that references it updates.
23
+ 3. Components consume those utilities - change a variable, or swap the active theme, and every component that references it updates.
24
24
 
25
25
  There is no OKLCH, no `--primary`/`--muted` convention, and no parallel style/base stack. One system, layered themes.
26
26
 
@@ -36,7 +36,7 @@ Create UI uses **semantic** token names. Backgrounds, borders, and text share a
36
36
  | --- | --- |
37
37
  | `bg-weakest` … `bg-strongest` | Neutral surface scale (`weakest`, `weak`, `light`, `medium`, `heavy`, `strong`, `strongest`) |
38
38
  | `bg-static` | Page/card surface that swaps with theme (white in light, black in dark) |
39
- | `bg-static-white` / `bg-static-black` | Surfaces that never swap |
39
+ | `bg-static-white` / `bg-static-black` | Theme-relative anchors that SWAP: `static-white` = white (light) / black (dark), `static-black` the inverse. For a surface that never swaps, use raw `bg-white` / `bg-black`. |
40
40
  | `border-weakest` … `border-strongest` | Border scale (use `border-light` / `border-medium` for inputs and dividers) |
41
41
 
42
42
  ### Text
@@ -47,7 +47,7 @@ Create UI uses **semantic** token names. Backgrounds, borders, and text share a
47
47
  | `text-placeholder` | Hints, secondary, muted text |
48
48
  | `text-disabled` | Disabled text |
49
49
  | `text-strongest` | High-contrast headings |
50
- | `text-static` / `text-static-white` | Text that never swaps with theme |
50
+ | `text-static` / `text-static-white` | Theme-relative text anchors that SWAP (white in light, black in dark). For always-white text on a colored surface use raw `text-white`; for light text in a `dark` island use `text-strongest` / `text-body`. |
51
51
 
52
52
  ### Primary scale
53
53
 
@@ -55,7 +55,7 @@ Create UI uses **semantic** token names. Backgrounds, borders, and text share a
55
55
 
56
56
  ### Status families
57
57
 
58
- Each of `error`, `success`, `warning`, `info`, and `away` has a `-base` plus a `-weakest` … `-strongest` scale, e.g. `bg-error-base`, `text-error-base`, `outline-error-strongest`, `bg-success-base`, `bg-info-base`, `bg-away-base` (`away` backs the `variant="away"` of `Toast` / `InlineAlert` / `StatusBadge`). **Prefer the semantic status tokens** in your own code. The shipped Button implements its danger/success variants with the raw `red-*` / `green-*` scales (e.g. `bg-red-600`, `bg-red-alpha-16`) that is the implementation detail, not a pattern you need to copy.
58
+ Each of `error`, `success`, `warning`, `info`, and `away` has a `-base` plus a `-weakest` … `-strongest` scale, e.g. `bg-error-base`, `text-error-base`, `outline-error-strongest`, `bg-success-base`, `bg-info-base`, `bg-away-base` (`away` backs the `variant="away"` of `Toast` / `InlineAlert` / `StatusBadge`). **Prefer the semantic status tokens** in your own code. The shipped Button implements its danger/success variants with the raw `red-*` / `green-*` scales (e.g. `bg-red-600`, `bg-red-alpha-16`) - that is the implementation detail, not a pattern you need to copy.
59
59
 
60
60
  ### Shadows
61
61
 
@@ -107,6 +107,7 @@ Tailwind v4 also auto-generates spacing and typography utilities from `--spacing
107
107
  | Family | Utilities |
108
108
  | --- | --- |
109
109
  | component | `gap-component-none`, `gap-component-xs`, `gap-component-sm`, `p-component-md`, `gap-component-lg`, `p-component-xl`, `px-component-none` |
110
+ | section | `gap-section-xs` … `gap-section-xl`, `p-section-*` (between clusters inside one section) |
110
111
  | layout | `gap-layout-xs`, `p-layout-sm`, `gap-layout-md`, `p-layout-lg`, `p-layout-xl` |
111
112
 
112
113
  **Figma-token rule:** use a semantic spacing class **only when Figma references a semantic token** (e.g. `var(--component/sm,8px)` → `gap-component-sm`). When Figma shows a static value (`space-space-4`), use the standard Tailwind class (`gap-4`). Prefer `px-component-none` over `px-0` when it is an intentional "no padding" override of a token.
@@ -115,13 +116,13 @@ Tailwind v4 also auto-generates spacing and typography utilities from `--spacing
115
116
 
116
117
  `text-display-{lg,xl}`, `text-heading-h1` … `text-heading-h6`, `text-body-{xs,sm,md,lg,xl}`, `text-paragraph-{xs…xl}`, `text-ui-{xs,sm,md,lg,xl}`, `text-ui-overline-*`, `text-ui-caption-*`, `text-numeric-{xs…xl}`.
117
118
 
118
- Spacing and typography tokens **auto-scale across breakpoints** never add `md:` / `xl:` prefixes to `gap-component-sm`, `text-heading-h2`, and the like.
119
+ Spacing and typography tokens **auto-scale across breakpoints** - never add `md:` / `xl:` prefixes to `gap-component-sm`, `text-heading-h2`, and the like.
119
120
 
120
121
  ---
121
122
 
122
123
  ## Theming
123
124
 
124
- One system, many themes. A theme is a swappable **token set** (a `registry:theme` item carrying a `primary` 50…950 palette), layered on the single foundation it is not a style/base split and not a preset color.
125
+ One system, many themes. A theme is a swappable **token set** (a `registry:theme` item carrying a `primary` 50…950 palette), layered on the single foundation - it is not a style/base split and not a preset color.
125
126
 
126
127
  - **Primary themes (8):** `indigo` (default), `blue`, `lime`, `green`, `red`, `orange`, `yellow`, `cyan`
127
128
  - **Neutral themes (5):** `gray` (default), `slate`, `zinc`, `base`, `stone`
@@ -133,7 +134,9 @@ Pick a theme at init, interactively or via flags:
133
134
  npx @create-ui/cli init --theme blue --neutral slate --font-variant v1
134
135
  ```
135
136
 
136
- `init` applies the choice by adding the matching registry items (`theme-<primary>`, `neutral-<neutral>`, `font-variant-<v>`). There is **no `apply` command** and **no preset codes** to change theme later, re-run `init` with new flags or edit the token variables in your global CSS.
137
+ `init` applies the choice by adding the matching registry items (`theme-<primary>`, `neutral-<neutral>`, `font-variant-<v>`). There is **no `apply` command** and **no preset codes** - to change theme later, re-run `init` with new flags (or, for an advanced hand-tweak, edit the token variables in your global CSS).
138
+
139
+ > **Behavioral rule for agents:** the theme is ALREADY chosen by the time you build UI. Do **not** treat the brand color as an open design question: never ask the user "what theme/color", never offer a color palette, never invent a color (the 8 names above are the whole set - there is no `violet`/`purple`/etc.), and never rewrite the `--color-primary-*` token values to "apply" a look. Just use `bg-primary-base` / `text-primary-base` / `border-primary-*` and the chosen theme renders automatically. Only touch the theme when the user **explicitly** asks to change the whole project's theme - and then prefer re-running `init --theme <name>` over hand-editing hex.
137
140
 
138
141
  ---
139
142
 
@@ -149,13 +152,15 @@ import { ThemeProvider } from "next-themes"
149
152
  </ThemeProvider>
150
153
  ```
151
154
 
152
- Because every color is a token that already has a `.dark` override, **never write manual `dark:` color overrides** on components let the tokens do the work.
155
+ Because every color is a token that already has a `.dark` override, **never write manual `dark:` color overrides** on components - let the tokens do the work.
156
+
157
+ > **`static` is theme-relative, not absolute.** `static` / `static-white` / `static-black` (and their `-alpha` variants) FLIP under `.dark` - e.g. `text-static-white` is white in light but **black in dark**; `static-black` is the inverse. They are surface anchors, not "always white/black." For a color that is fixed across themes (white text on a primary/colored surface, a brand mark) use the raw `white` / `black` palette. For light text inside an always-`dark` island, use `text-strongest` / `text-body` / `text-placeholder` (which resolve light under `.dark`), never `text-static` / `text-static-white`.
153
158
 
154
159
  ---
155
160
 
156
161
  ## Adding a Custom Color / Changing Radius
157
162
 
158
- Edit the project's global CSS file the `tailwind.css` path reported by `createui info` (typically `app/globals.css`). **Never create a new CSS file** for this.
163
+ Edit the project's global CSS file - the `tailwind.css` path reported by `createui info` (typically `app/globals.css`). **Never create a new CSS file** for this.
159
164
 
160
165
  Define the HEX scale under `:root` (and `.dark`), then expose it to Tailwind in the same file:
161
166
 
@@ -179,7 +184,7 @@ Tailwind v4 auto-generates the utilities (`bg-brand-500`, `text-brand-900`, …)
179
184
  <div className="bg-brand-50 text-brand-900">Brand surface</div>
180
185
  ```
181
186
 
182
- To restyle existing components, override the semantic tokens themselves (e.g. redefine the `primary` scale or a status family) rather than adding new ones. (There is no token build step to run editing the CSS is the whole change.)
187
+ To restyle existing components, override the semantic tokens themselves (e.g. redefine the `primary` scale or a status family) rather than adding new ones. (There is no token build step to run - editing the CSS is the whole change.)
183
188
 
184
189
  ---
185
190
 
@@ -217,8 +222,8 @@ import { Button } from "@/components/ui/button"
217
222
  If you need a new look, add it to the component's `cva` config in the source, using real Create UI tokens:
218
223
 
219
224
  ```tsx
220
- // components/ui/button.tsx add to the buttonVariants config
221
- warning: "bg-warning-base text-static-white hover:bg-warning-strong",
225
+ // components/ui/button.tsx - add to the buttonVariants config
226
+ warning: "bg-warning-base text-white hover:bg-warning-strong",
222
227
  ```
223
228
 
224
229
  ### 4. Wrapper components
@@ -227,7 +232,7 @@ Compose Create UI primitives into higher-level components. Verify each primitive
227
232
 
228
233
  ```tsx
229
234
  import { RiLogoutBoxLine, RiSettingsLine, RiUserLine } from "@create-ui/assets/icons"
230
- import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
235
+ import { Avatar, AvatarImage, AvatarText } from "@/components/ui/avatar"
231
236
  import { Button } from "@/components/ui/button"
232
237
  import {
233
238
  DropdownMenu,
@@ -251,7 +256,7 @@ export function UserMenu({ name, avatarSrc, onSignOut, children }) {
251
256
  >
252
257
  <Avatar>
253
258
  <AvatarImage src={avatarSrc} alt={name} />
254
- <AvatarFallback>{name.slice(0, 2)}</AvatarFallback>
259
+ <AvatarText>{name.slice(0, 2)}</AvatarText>
255
260
  </Avatar>
256
261
  </Button>
257
262
  </DropdownMenuTrigger>
@@ -298,4 +303,4 @@ When you re-add a component, pass `--overwrite` to replace local files:
298
303
  npx @create-ui/cli add button --overwrite
299
304
  ```
300
305
 
301
- See [Updating Components in SKILL.md](./SKILL.md#updating-components) for the full workflow.
306
+ See the update workflow under [CLI quick reference in SKILL.md](./SKILL.md#cli-quick-reference) (prefer `diff`, and `add --overwrite` only with explicit approval).
@@ -11,21 +11,21 @@
11
11
  "Uses Switch for independent on/off notification toggles (not looping Button with manual active state)",
12
12
  "Uses data-invalid on Field and aria-invalid on the input control for validation states",
13
13
  "Uses gap-* (e.g. gap-4, gap-6) instead of space-y-* or space-x-* for spacing",
14
- "Uses Create UI semantic tokens (e.g. bg-static, text-body, text-placeholder, text-error-base) never foreign tokens like bg-background/text-muted-foreground or raw colors like bg-red-500",
14
+ "Uses Create UI semantic tokens (e.g. bg-static, text-body, text-placeholder, text-error-base) - never foreign tokens like bg-background/text-muted-foreground or raw colors like bg-red-500",
15
15
  "No manual dark: color overrides (tokens swap via the .dark class)"
16
16
  ]
17
17
  },
18
18
  {
19
19
  "id": 2,
20
20
  "prompt": "Create an account menu component for the app header. The trigger is the user's avatar; the menu shows Profile, Billing, and Settings items with appropriate icons, then a separated Sign out item. Below the menu component, also add a Save changes button that shows a pending state while saving. Using Create UI.",
21
- "expected_output": "A React component with DropdownMenu (trigger via asChild wrapping a Button + Avatar with AvatarFallback), DropdownMenuGroup/DropdownMenuSeparator structure, icons from @create-ui/assets/icons without sizing classes, and a Button using the loading prop.",
21
+ "expected_output": "A React component with DropdownMenu (trigger via asChild wrapping a Button + Avatar with AvatarText initials), DropdownMenuGroup/DropdownMenuSeparator structure, icons from @create-ui/assets/icons without sizing classes, and a Button using the loading prop.",
22
22
  "files": [],
23
23
  "expectations": [
24
24
  "Uses DropdownMenu with DropdownMenuTrigger asChild (Radix Slot) instead of hand-rolling a menu or using a popover (no popover component exists in Create UI)",
25
- "Avatar component includes AvatarFallback",
25
+ "Avatar uses AvatarText for the initials fallback (AvatarFallback does not exist in Create UI)",
26
26
  "Menu items are wrapped in DropdownMenuGroup, with DropdownMenuSeparator before Sign out",
27
27
  "Icons are imported from @create-ui/assets/icons (Remix Ri*), never from lucide-react or another icon package",
28
- "No sizing classes on icons inside components (no size-4, w-4, h-4, etc.) the component sizes icons via CVA",
28
+ "No sizing classes on icons inside components (no size-4, w-4, h-4, etc.) - the component sizes icons via CVA",
29
29
  "Uses the Button loading prop for the pending Save state instead of manually composing a Spinner",
30
30
  "Button icons (if any) are passed via the leadingIcon/trailingIcon props (never a data-icon attribute, which does not exist in Create UI)"
31
31
  ]
@@ -36,13 +36,76 @@
36
36
  "expected_output": "A React component with stat tiles built from semantic-token markup (bg-static/border-light surfaces, text-placeholder label, text-strongest number), a Badge for the percentage change, a Spinner for the loading state, and gap-* spacing.",
37
37
  "files": [],
38
38
  "expectations": [
39
- "Builds the stat tiles from semantic-token markup (e.g. bg-static or bg-weakest surface, border-light, text-placeholder for the label, text-strongest for the number) there is no Card component in Create UI",
39
+ "Builds the stat tiles from semantic-token markup (e.g. bg-static or bg-weakest surface, border-light, text-placeholder for the label, text-strongest for the number) - there is no Card component in Create UI",
40
40
  "Uses the Spinner component for the loading state instead of a skeleton placeholder (no skeleton component exists in Create UI) or custom animate-pulse/animate-spin divs",
41
41
  "Uses a Badge (e.g. variant=\"success\" / \"danger\") for the percentage change instead of custom styled spans",
42
42
  "Uses Create UI semantic tokens (e.g. text-body, text-strongest, text-success-base) instead of foreign tokens or raw colors like bg-green-500",
43
43
  "Uses gap-* instead of space-y-* or space-x-* for spacing",
44
44
  "Uses size-* when width and height are equal instead of separate w-* h-*"
45
45
  ]
46
+ },
47
+ {
48
+ "id": 4,
49
+ "prompt": "Create a hero section for a product landing page: an eyebrow badge that says 'Now shipping - v1 components' with a sparkle icon, a large heading, a short description, and two CTA buttons (primary with a trailing arrow icon, secondary ghost). Using Create UI.",
50
+ "expected_output": "A hero section where the Badge gets its icon via the leadingIcon prop, buttons get icons via leadingIcon/trailingIcon, headings/body use semantic text tokens, and the badge does not stretch.",
51
+ "files": [],
52
+ "expectations": [
53
+ "Badge icon is passed via the leadingIcon prop (never as an icon child next to the text, e.g. <Badge><RiSparkling2Line />text</Badge> is wrong)",
54
+ "Button icons are passed via leadingIcon/trailingIcon props, never as children",
55
+ "Icons are imported from @create-ui/assets/icons (Remix Ri*), never lucide-react",
56
+ "No sizing classes on icons inside Badge or Button",
57
+ "Text uses semantic tokens (text-strongest for the heading, text-body/text-placeholder for the description), never raw palette colors",
58
+ "There is no variant=\"outline\"/\"secondary\"/\"destructive\" anywhere - outline looks come from appearance=\"outline\""
59
+ ]
60
+ },
61
+ {
62
+ "id": 5,
63
+ "prompt": "Create a settings page section with three tabs: Profile, Billing, and Notifications. Each tab shows its own panel of content. Using Create UI.",
64
+ "expected_output": "TabMenu + TabMenuItem for the tab bar with value/onValueChange state, and the panels rendered by the page itself keyed on the active value.",
65
+ "files": [],
66
+ "expectations": [
67
+ "Uses the TabMenu + TabMenuItem components for the tab bar - never a hand-rolled row of styled buttons or an invented Tabs/TabsList/TabsTrigger/TabsContent set",
68
+ "Panels are rendered by the consumer keyed on the active value (e.g. {tab === \"billing\" && <BillingPanel />}) - TabMenu has no content-panel component",
69
+ "Tab icons (if any) are passed via the leadingIcon prop on TabMenuItem",
70
+ "Selection is driven by value/onValueChange (or defaultValue), not by manual className toggling"
71
+ ]
72
+ },
73
+ {
74
+ "id": 6,
75
+ "prompt": "Add a monthly/yearly billing toggle to a pricing section. The active option's background should slide smoothly between the options. Show a '-20%' badge next to the yearly label. Using Create UI.",
76
+ "expected_output": "A SegmentedControl with appearance=\"grouped\" driven by value/onValueChange, plus a Badge for the discount.",
77
+ "files": [],
78
+ "expectations": [
79
+ "Uses SegmentedControl + SegmentedControlItem with value/onValueChange (or defaultValue) - never a row of Buttons with manual active state",
80
+ "Uses appearance=\"grouped\" for the classic padded pricing-toggle container (the active pill slides in both appearances)",
81
+ "The discount indicator is a Badge, not a custom styled span",
82
+ "An initial value is set (value or defaultValue) so one option is active on mount"
83
+ ]
84
+ },
85
+ {
86
+ "id": 7,
87
+ "prompt": "Create a notification preferences panel that feels premium for a marketing showcase: rows for Email, SMS, and Push notifications, each with a label, a description, and a toggle. Make the toggles feel rich, not bare. Using Create UI.",
88
+ "expected_output": "Field/SwitchGroup rows with Switch components that exercise the richer API (thumbIcon, ioTrigger, thumbType, or a deliberate variant), not bare <Switch /> defaults.",
89
+ "files": [],
90
+ "expectations": [
91
+ "Uses Switch (or SwitchGroup labelled rows - there is no SwitchGroupItem) - never a hand-rolled toggle",
92
+ "At least one richer Switch option is exercised: thumbIcon, ioTrigger, thumbType=\"long\", or a non-default variant - bare <Switch /> everywhere fails the 'premium' ask",
93
+ "Rows are laid out with Field orientation=\"horizontal\" + FieldLabel/FieldDescription (or SwitchGroup), not raw flex divs with hand-styled labels",
94
+ "Switch state is controlled via checked/onCheckedChange or defaultChecked"
95
+ ]
96
+ },
97
+ {
98
+ "id": 8,
99
+ "prompt": "Create a marketing site footer: brand column with a short description, three link columns (Product, Resources, Company), a newsletter signup, and a bottom bar with the copyright. Using Create UI.",
100
+ "expected_output": "A footer on neutral semantic surfaces (bg-static/bg-weak, border-light dividers) with TextLink columns, a Field + Input + Button newsletter form, and no raw palette colors.",
101
+ "files": [],
102
+ "expectations": [
103
+ "Footer surfaces use neutral semantic tokens (bg-static or bg-weak, border-light dividers) - never saturated raw palette colors (bg-blue-500, text-indigo-400) or hex values",
104
+ "Link columns use TextLink (or styled anchors with semantic text tokens like text-body/text-strongest), never primary-colored link soup",
105
+ "Newsletter form is FieldGroup/Field + Input + Button, not raw inputs",
106
+ "Spacing uses flex/grid + gap-*, never space-y-*",
107
+ "Column titles use text-strongest with body links in text-body/text-placeholder"
108
+ ]
46
109
  }
47
110
  ]
48
111
  }
@@ -5,6 +5,7 @@ The Create UI MCP server lets AI assistants browse, search, and install componen
5
5
  ## Contents
6
6
 
7
7
  - [Setup](#setup)
8
+ - [Recommended workflow for writing UI](#recommended-workflow-for-writing-ui)
8
9
  - [Available Tools](#available-tools)
9
10
  - [Usage Examples](#usage-examples)
10
11
 
@@ -45,9 +46,17 @@ The generated config always runs `npx @create-ui/cli mcp` (the package is `@crea
45
46
  }
46
47
  ```
47
48
 
49
+ ## Recommended workflow for writing UI
50
+
51
+ 1. `search_items_in_registries` / `list_items_in_registries` to find components.
52
+ 2. `view_items_in_registries` for an item's source and metadata.
53
+ 3. **`get_item_examples_from_registries` BEFORE writing usage code for a component you haven't used yet** - query `"<name>-demo"` (canonical usage), `"<name>-example"` (full gallery), or facet names like `"switch-thumb-icon"`, `"segmented-control-appearance"`, `"badge-with-icon"`. Create UI APIs differ from shadcn; the examples show the correct usage (icon props, composition, variants). The skill's `reference/<name>.md` files carry the same facts offline.
54
+ 4. `get_add_command_for_items` and run it - never import a component that hasn't been added.
55
+ 5. `get_audit_checklist` after generating code and fix anything it flags.
56
+
48
57
  ## Available Tools
49
58
 
50
- The MCP server exposes seven tools. **`@createui` is the only registry** it is built in and needs no configuration, and there are no other registries to add. Wherever a tool takes a `registries` array, pass `["@createui"]`.
59
+ The MCP server exposes seven tools. **`@createui` is the only registry** - it is built in and needs no configuration, and there are no other registries to add. Wherever a tool takes a `registries` array, pass `["@createui"]`.
51
60
 
52
61
  ### get_project_registries
53
62
 
@@ -60,7 +69,7 @@ Returns the registries configured in the current project's `components.json`.
60
69
  Lists all items available in the specified registries.
61
70
 
62
71
  **Inputs:**
63
- - `registries` (string[]) registry namespaces to query
72
+ - `registries` (string[]) - registry namespaces to query
64
73
  - `limit` (number, optional)
65
74
  - `offset` (number, optional)
66
75
 
@@ -76,14 +85,14 @@ Searches for items across registries by query string.
76
85
 
77
86
  ### view_items_in_registries
78
87
 
79
- Returns detailed information about specific items.
88
+ Returns detailed information about specific items, including file contents. Component source alone does not show canonical usage - pair it with `get_item_examples_from_registries`.
80
89
 
81
90
  **Inputs:**
82
- - `items` (string[]) bare item names, e.g. `button` (the MCP server also accepts a `@createui/` prefix and strips it)
91
+ - `items` (string[]) - bare item names, e.g. `button` (the MCP server also accepts a `@createui/` prefix and strips it)
83
92
 
84
93
  ### get_item_examples_from_registries
85
94
 
86
- Finds example and demo code for items.
95
+ Finds example and demo code for items with full source. Call it before the first use of any component. Useful query patterns: `{item}-demo`, `{item}-example`, and facet names like `switch-io-trigger` or `badge-with-icon`.
87
96
 
88
97
  **Inputs:**
89
98
  - `registries` (string[])