@voltui/agent 0.6.0 → 0.6.1
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.
- package/installer.js +6 -0
- package/package.json +1 -1
- package/skills/volt-ui/SKILL.md +4 -2
- package/skills/volt-ui-adoption/SKILL.md +7 -1
- package/skills/volt-ui-component-selection/SKILL.md +8 -2
- package/skills/volt-ui-distribution/SKILL.md +70 -14
- package/skills/volt-ui-forms/SKILL.md +10 -0
- package/skills/volt-ui-styling/SKILL.md +12 -1
package/installer.js
CHANGED
|
@@ -617,6 +617,12 @@ async function run(argv, env = {}) {
|
|
|
617
617
|
out.log(' npx @voltui/cli init scaffold the ui/ folder');
|
|
618
618
|
out.log(' npx @voltui/cli add button add a component');
|
|
619
619
|
out.log(' npx @voltui/cli list list every component');
|
|
620
|
+
out.log(
|
|
621
|
+
' npx @voltui/cli diff button compare an edited copy with the CLI source (read-only)'
|
|
622
|
+
);
|
|
623
|
+
out.log(
|
|
624
|
+
' MCP find_compositions copy a block, layout or workflow from recipes.voltui.dev'
|
|
625
|
+
);
|
|
620
626
|
}
|
|
621
627
|
return 0;
|
|
622
628
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voltui/agent",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Set up Volt UI for AI coding agents: the MCP server, single-responsibility skills and rules for Claude Code, Codex, OpenCode, Cursor, Windsurf, Gemini CLI and GitHub Copilot",
|
|
5
5
|
"homepage": "https://voltui.dev/docs/ai-mcp",
|
|
6
6
|
"repository": {
|
package/skills/volt-ui/SKILL.md
CHANGED
|
@@ -19,8 +19,9 @@ app keeps its own layout, icons, state and domain components.
|
|
|
19
19
|
raw Tailwind, and do not import `ng-primitives` to get around Volt.
|
|
20
20
|
2. **The MCP server is the source of exact facts.** Selectors, inputs, outputs, variants, status and
|
|
21
21
|
examples change between releases. Ask the `volt-ui` MCP server (`list_components`,
|
|
22
|
-
`find_components`, `get_component`, `get_usage_example`) instead of recalling
|
|
23
|
-
|
|
22
|
+
`find_components`, `get_component`, `get_usage_example`, `find_compositions`) instead of recalling
|
|
23
|
+
them. Never invent an input. It describes the source: `get_project_info` says what npm serves. If
|
|
24
|
+
the server is not connected, read the component's source or run `npx @voltui/cli list`.
|
|
24
25
|
3. **Match the project's mode.** Package mode imports `Volt*` from `'@voltui/components'` and uses
|
|
25
26
|
`volt-*` selectors. Copy mode has `Ui*` classes and `ui-*` selectors under `./ui`. Check which
|
|
26
27
|
(`volt-ui-distribution`) before writing a single import.
|
|
@@ -35,6 +36,7 @@ app keeps its own layout, icons, state and domain components.
|
|
|
35
36
|
| open a dialog, drawer, popover, menu, tooltip or toast | `volt-ui-overlays` |
|
|
36
37
|
| change colours, size, spacing or theme; override a component | `volt-ui-styling` |
|
|
37
38
|
| install, update or copy components; unsure of the import or prefix | `volt-ui-distribution` |
|
|
39
|
+
| install a Recipes block, layout, pattern or application starter | `volt-ui-distribution` |
|
|
38
40
|
|
|
39
41
|
Accessibility is part of every skill, not a separate step: Volt components carry the roles, keyboard
|
|
40
42
|
and focus behaviour, so the way to keep it is to use them as documented.
|
|
@@ -22,7 +22,12 @@ behaviour, a theme that does not reach them. Reuse first.
|
|
|
22
22
|
`get_usage_example` returns working markup.
|
|
23
23
|
3. **Reuse the atom if one exists.** Keep what is specific to the app — layout, copy, domain logic,
|
|
24
24
|
data fetching — in the app, around the atom.
|
|
25
|
-
4. **
|
|
25
|
+
4. **For a whole section, shell or workflow, start from a composition.** `find_compositions`
|
|
26
|
+
("pricing section", "dashboard shell", "settings form", "paged table") returns Recipes blocks,
|
|
27
|
+
layouts, patterns and two application starters (admin, product website) built from these atoms,
|
|
28
|
+
with install commands and the state the app owns. Install one (`volt composition add`, see
|
|
29
|
+
`volt-ui-distribution`) and adapt it rather than composing the same thing from scratch.
|
|
30
|
+
5. **Use native HTML where it is genuinely the right element**, and say why (below).
|
|
26
31
|
|
|
27
32
|
## Responsibility → atom
|
|
28
33
|
|
|
@@ -65,6 +70,7 @@ could close it. Use the closest atom, note the limitation, and suggest an upstre
|
|
|
65
70
|
<!-- volt:digest:start -->
|
|
66
71
|
|
|
67
72
|
- Before writing UI, check whether Volt already owns the responsibility (MCP `find_components`); reuse the atom and keep layout, copy and domain logic in the app.
|
|
73
|
+
- For a page section, app shell, workflow or whole app, `find_compositions` first and install the Recipes composition or starter.
|
|
68
74
|
- Never rebuild Button, Card, Input, Badge, Alert, Tabs or an overlay with raw Tailwind, and never import `ng-primitives` in an app that consumes Volt.
|
|
69
75
|
- Native HTML is right only where Volt has no equivalent or the native element is the point (route-backed tab strips are real anchors). If Volt cannot do something, say so instead of working around it silently.
|
|
70
76
|
|
|
@@ -59,6 +59,12 @@ server (`find_components`, then `get_component`).
|
|
|
59
59
|
- **Table vs an application data table.** Volt's `Table` is styled markup. Sorting, filtering,
|
|
60
60
|
paging and selection logic belongs to the application (see the data-table recipe).
|
|
61
61
|
|
|
62
|
+
## Sections and workflows
|
|
63
|
+
|
|
64
|
+
A hero, pricing table, app shell or data table is a **composition** of these atoms, not one of them.
|
|
65
|
+
Ask `find_compositions` for a Recipes block, layout or pattern before assembling it; there is no
|
|
66
|
+
`VoltDataTable` or `VoltSettingsForm`, and you should not invent one.
|
|
67
|
+
|
|
62
68
|
## Do not use when
|
|
63
69
|
|
|
64
70
|
- **Combobox**: the app only needs a native fixed list (`NativeSelect`).
|
|
@@ -142,10 +148,10 @@ returns the same fields live.
|
|
|
142
148
|
- **Alert** (`alert`, stable) — A callout for information, success, warnings or errors that sits in the page flow.
|
|
143
149
|
- Not for: A transient "saved" confirmation: use Toast.
|
|
144
150
|
- See also: `toast`, `empty-state`, `dialog`
|
|
145
|
-
- **Spinner** (`spinner`,
|
|
151
|
+
- **Spinner** (`spinner`, stable) — An indeterminate loading indicator in three sizes.
|
|
146
152
|
- Not for: Content with a known layout: use Skeleton.
|
|
147
153
|
- See also: `skeleton`, `progress`
|
|
148
|
-
- **Empty State** (`empty-state`,
|
|
154
|
+
- **Empty State** (`empty-state`, stable) — A placeholder for an empty collection or a search with no results, with room for an action.
|
|
149
155
|
- Not for: An error or warning about the page: use Alert.
|
|
150
156
|
- See also: `alert`, `skeleton`
|
|
151
157
|
|
|
@@ -3,8 +3,9 @@ name: volt-ui-distribution
|
|
|
3
3
|
description: >
|
|
4
4
|
Install, use and update Volt UI correctly in either distribution mode: the @voltui/components
|
|
5
5
|
package (Volt* classes, volt-* selectors) or copy-and-own via @voltui/cli (Ui* classes, ui-*
|
|
6
|
-
selectors under ./ui). Use to detect the project's mode, add components
|
|
7
|
-
|
|
6
|
+
selectors under ./ui). Use to detect the project's mode, add components or Recipes compositions and
|
|
7
|
+
starters (volt composition / volt starter), compare a customised copy with a newer CLI (volt diff),
|
|
8
|
+
fix wrong imports or prefixes, or set up the agent.
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Package vs copy-and-own
|
|
@@ -28,9 +29,8 @@ copy-mode project must not import `@voltui/components`.
|
|
|
28
29
|
| package | `volt-*` / `[voltXxx]` | `VoltXxx` | `'@voltui/components'` |
|
|
29
30
|
| copy | `ui-*` / `[uiXxx]` (the CLI renames them) | `UiXxx` | `'./ui/<component>'` |
|
|
30
31
|
|
|
31
|
-
`'volt'` is only a
|
|
32
|
-
|
|
33
|
-
project's mode and you get matching selectors and imports.
|
|
32
|
+
`'volt'` is only a monorepo alias; it never exists in a consumer project. Pass the project's mode
|
|
33
|
+
(`"package" | "copy"`) to `get_component` / `get_usage_example` for matching selectors and imports.
|
|
34
34
|
|
|
35
35
|
## Package mode
|
|
36
36
|
|
|
@@ -42,20 +42,71 @@ Peer dependencies (`@angular/core`, `common`, `forms`, `router`, `cdk`) are decl
|
|
|
42
42
|
`provideVoltTheme` (see `volt-ui-styling`). Updating is a version bump; read the changelog's
|
|
43
43
|
migration notes for a major.
|
|
44
44
|
|
|
45
|
+
```css
|
|
46
|
+
@import 'tailwindcss'; /* the full import: it includes preflight */
|
|
47
|
+
@import '@voltui/components/themes.css';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Components are styled on Tailwind's preflight: `theme.css` + `utilities.css` alone leave native
|
|
51
|
+
controls unstyled.
|
|
52
|
+
|
|
45
53
|
## Copy mode
|
|
46
54
|
|
|
47
55
|
```bash
|
|
48
|
-
npx @voltui/cli init
|
|
49
|
-
npx @voltui/cli list
|
|
50
|
-
npx @voltui/cli add button card
|
|
51
|
-
npx @voltui/cli add dialog
|
|
56
|
+
npx @voltui/cli init # scaffold src/app/ui of the nearest package.json
|
|
57
|
+
npx @voltui/cli list # what exists, with status
|
|
58
|
+
npx @voltui/cli add button card # copies source; component dependencies come along
|
|
59
|
+
npx @voltui/cli add dialog --path=./src/app/shared/ui --dry-run
|
|
60
|
+
npx @voltui/cli add card --install # also installs what the copied files import
|
|
61
|
+
npx @voltui/cli add button --track # also records hashes in src/app/ui/.volt-ui.json
|
|
62
|
+
npx @voltui/cli@<version> diff button # read-only: local copy → that CLI's source
|
|
52
63
|
```
|
|
53
64
|
|
|
65
|
+
Name a destination with `--path=<dir>` (the positional `target-dir` still works but can be mistaken
|
|
66
|
+
for a component name; it is the only form a CLI older than 1.4.0 understands — see below). Without one, the CLI uses `src/app/ui` of the nearest
|
|
67
|
+
`package.json`, also from a subfolder; in a workspace root it asks which app (`--path`). Unknown
|
|
68
|
+
flags and extra arguments are errors — read the message, do not retry blindly.
|
|
69
|
+
|
|
54
70
|
The CLI copies source from the library, applies the `volt-` → `ui-` transform, and you own the
|
|
55
|
-
result: edit it freely
|
|
56
|
-
diff.
|
|
57
|
-
|
|
58
|
-
|
|
71
|
+
result: edit it freely. A later `add` reuses untouched files and refuses to overwrite edited ones
|
|
72
|
+
unless you pass `--force` — review `volt diff` first. Dependencies are per component: `volt add` prints
|
|
73
|
+
exactly which packages the copied files need (with ranges); `--install` installs those once in the
|
|
74
|
+
right package, keeps compatible versions and never upgrades Angular. Do not install a fixed list.
|
|
75
|
+
Component examples on voltui.dev and from `get_usage_example` come in both modes.
|
|
76
|
+
|
|
77
|
+
## Compositions and starters
|
|
78
|
+
|
|
79
|
+
Before hand-building a page section, app shell, workflow or a whole admin or marketing app, call
|
|
80
|
+
`find_compositions` (blocks, layouts, patterns, starters). They are source you own, not exports.
|
|
81
|
+
|
|
82
|
+
1. With the CLI version `install.cli.capability.since` names: `npx @voltui/cli composition add <id>
|
|
83
|
+
--mode=<package|copy> --dry-run` (or `starter add admin`), read the plan, run it without
|
|
84
|
+
`--dry-run`. `--path`/`--ui` pick other folders; `--track` enables `volt composition diff <id>`.
|
|
85
|
+
`generate_composition_command` builds the command for a given `cliVersion`.
|
|
86
|
+
2. Older CLI: `install.cli.fallback` — files into `src/app/<folder>/`, then `npx @voltui/cli add`.
|
|
87
|
+
3. Customised components are kept, never replaced. If the plan stops (removed export, incomplete
|
|
88
|
+
copy, the other engine's folder), fix that; do not `--force` (it only replaces composition files).
|
|
89
|
+
4. Read what was written, connect the `fake*` function or data source it names to your service, and
|
|
90
|
+
add routes and theme providers yourself: the CLI never edits `app.routes.ts`, `app.config.ts` or
|
|
91
|
+
styles. Build and test.
|
|
92
|
+
|
|
93
|
+
## Source vs published
|
|
94
|
+
|
|
95
|
+
voltui.dev and the MCP server describe the **source**; npm can be behind it. `get_project_info`
|
|
96
|
+
lists what npm serves (`versions.publishedOnNpm`) and every capability that is not published yet.
|
|
97
|
+
Pass the project's versions (`componentsVersion`, `cliVersion`) to it and to `get_component` /
|
|
98
|
+
`generate_cli_command` / `generate_composition_command` to learn what that project can use. With an older CLI, use the positional
|
|
99
|
+
destination instead of `--path`, and skip `--track` / `volt diff`. Never pin an unpublished version
|
|
100
|
+
(`npx @voltui/cli@<next>`) or tell a user to install one.
|
|
101
|
+
|
|
102
|
+
## Updating a customised copy
|
|
103
|
+
|
|
104
|
+
`volt diff <name> [--path=<dir>] [--json]` compares the copy (and its shared helpers) with the source
|
|
105
|
+
inside the CLI version that runs — not npm's latest — offline, and never changes a file. Exit 0 same,
|
|
106
|
+
1 different, 2 error. With a `--track` record it says per file whether the copy (`local-changed`),
|
|
107
|
+
the reference (`reference-changed`) or both changed; without one, `unknown-origin`. Move the hunks
|
|
108
|
+
you want by hand and run the tests; never `--force` over edits you want to keep, and never edit or
|
|
109
|
+
create `.volt-ui.json` by hand.
|
|
59
110
|
|
|
60
111
|
## Agent setup
|
|
61
112
|
|
|
@@ -73,11 +124,16 @@ only read a rules file it writes a short routing block.
|
|
|
73
124
|
- Write `volt-*` selectors in a copy-mode project or `ui-*` in package mode.
|
|
74
125
|
- Import from `'volt'` or from a path inside `node_modules/@voltui/components`.
|
|
75
126
|
- Add `ng-primitives` imports to application code.
|
|
127
|
+
- Replace `@import 'tailwindcss'` with only `theme.css` + `utilities.css`: that drops preflight.
|
|
76
128
|
|
|
77
129
|
<!-- volt:digest:start -->
|
|
78
130
|
|
|
79
131
|
- Detect the mode first: `@voltui/components` (package: `Volt*`, `volt-*`) or a copied `ui/` folder (copy: `Ui*`, `ui-*`). Never mix them; `'volt'` is not importable in a consumer.
|
|
80
|
-
-
|
|
132
|
+
- Docs and MCP describe the source; check `get_project_info` (`publishedOnNpm`, unreleased capabilities) and pass the installed versions. Never recommend an unpublished version.
|
|
133
|
+
- Page sections, app shells, workflows and whole apps: `find_compositions` first; install with `volt composition add <id> --dry-run` / `volt starter add <name>` when the CLI has it (else its manual fallback), keep customised components, then connect your data, routes and theme yourself.
|
|
134
|
+
- Copy mode: `npx @voltui/cli add <name> [--path=<dir>] [--install] [--track]` (installs only what the copy imports); package mode: `npm install @voltui/components`. Backend: ng-primitives by default; `--base=quartz` (experimental, `@voltui/components/quartz`) only where `find_compositions` `backends.supported` lists it; never mix engines.
|
|
135
|
+
- Before updating an edited copy: `npx @voltui/cli@<version> diff <name>` (read-only, local → that CLI's source); apply hunks by hand, never `--force` over edits.
|
|
136
|
+
- CSS: the full `@import 'tailwindcss'` (with preflight, which Volt is styled on), then `@import '@voltui/components/themes.css'`.
|
|
81
137
|
- Pass the project's mode (`package` | `copy`) to the MCP tools to get matching selectors and imports.
|
|
82
138
|
|
|
83
139
|
<!-- volt:digest:end -->
|
|
@@ -67,6 +67,14 @@ show failure in an `Alert`, success in a `Toast`. Do not unmount the form on fai
|
|
|
67
67
|
- Use `[value]` and a `[formControl]` on the same control.
|
|
68
68
|
- Disable the submit button forever on an invalid form with no message saying why.
|
|
69
69
|
|
|
70
|
+
## Start from the patterns
|
|
71
|
+
|
|
72
|
+
Two Recipes patterns are complete, tested forms workflows (`find_compositions`, kind `patterns`):
|
|
73
|
+
`settings-form` (validation, one in-flight save, recovery, unsaved-changes baseline) and
|
|
74
|
+
`async-search` (server search in a combobox, latest response wins, selection by id). Install one
|
|
75
|
+
(`volt composition add recipes/settings-form`) and replace its `fake*` function with your service; the form state, request policy and errors stay in
|
|
76
|
+
your component — Volt components hold none of it.
|
|
77
|
+
|
|
70
78
|
<!-- volt:digest:start -->
|
|
71
79
|
|
|
72
80
|
- Wrap controls in FormField (label, hint, error); show errors after `touched && invalid`, as visible text.
|
|
@@ -74,4 +82,6 @@ show failure in an `Alert`, success in a `Toast`. Do not unmount the form on fai
|
|
|
74
82
|
- `disabled` leaves the tab order; `aria-disabled` on a `voltButton` keeps focus but you must guard the handler.
|
|
75
83
|
- Server search: Combobox `filterMode="manual"`, `(queryChange)` is what was typed, debounce and let the latest response win, pass results as returned, set `[loading]`.
|
|
76
84
|
|
|
85
|
+
- Server search or a settings form: install the `async-search` / `settings-form` pattern (`find_compositions`, `volt composition add recipes/<name>`); request policy and form state stay in your component.
|
|
86
|
+
|
|
77
87
|
<!-- volt:digest:end -->
|
|
@@ -28,7 +28,16 @@ Only then consider copying the component (copy mode) and editing it.
|
|
|
28
28
|
`brutal`, `ghost`, `retro`. Dark mode is a class on `<html>`. `provideVoltTheme({ color, style,
|
|
29
29
|
dark })` sets them at bootstrap; `applyVoltTheme` changes them at runtime.
|
|
30
30
|
- Import the theme CSS once: `@import '@voltui/components/themes.css';` after Tailwind.
|
|
31
|
-
- A custom palette
|
|
31
|
+
- A custom palette sets the palette tokens (`--primary`, `--surface`, …) and a custom style the
|
|
32
|
+
`--volt-*` shape tokens, not the Tailwind utilities. Theme Studio (voltui.dev/create-theme) exports
|
|
33
|
+
one; import it **after** `themes.css`, then `const acme = voltCustomColor('acme')` and pass `acme`
|
|
34
|
+
wherever a colour goes (`provideVoltTheme`, `applyVoltTheme`, `[voltTheme]`, and `customColors` of
|
|
35
|
+
`voltThemeInitScript`). Copy mode: `uiCustomColor` from `./ui/theme`. Never cast a raw string to
|
|
36
|
+
the colour type. `get_theme_info` → `customThemes` has the steps and whether npm has it yet. An
|
|
37
|
+
application starter keeps its theme in `<starter>.theme.ts`: pass the custom name there.
|
|
38
|
+
- `[voltTheme]="{ color, style, dark, density }"` themes one container and the overlays declared in it;
|
|
39
|
+
`density` also goes on `provideVoltTheme`. Do not hand-write `--primary` on an element. It needs
|
|
40
|
+
`@voltui/components` 1.4.1 or later: check `get_project_info` before using it in a project on npm.
|
|
32
41
|
|
|
33
42
|
## The `class` contract
|
|
34
43
|
|
|
@@ -63,6 +72,8 @@ pairs. In a custom palette check the pairs you change.
|
|
|
63
72
|
- Prefer variants/sizes, then the theme, then `class` on the component (merged with tailwind-merge, so it replaces defaults), then a layout wrapper. Do not rewrite a component.
|
|
64
73
|
- Use semantic utilities (`bg-primary`, `text-foreground`, `border-border`), never hard-coded colours or `bg-[var(--x)]`.
|
|
65
74
|
- Presets: colour `volt|ember|sage|dusk|glacier`, style `sharp|soft|brutal|ghost|retro`; dark mode is a class on `<html>`.
|
|
75
|
+
- Theme one container with `[voltTheme]`; density is `compact|comfortable|spacious`, independent of the style.
|
|
76
|
+
- A custom palette (e.g. from Theme Studio) is CSS imported after `themes.css`, declared with `voltCustomColor('name')` and passed as `color`.
|
|
66
77
|
- Pressed/selected/checked states must be visibly distinct and contrast-checked; colour alone is not meaning.
|
|
67
78
|
|
|
68
79
|
<!-- volt:digest:end -->
|