@archetypeai/ds-cli 0.7.8 → 0.8.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.
- package/README.md +16 -18
- package/bin.js +4 -3
- package/commands/create.js +8 -30
- package/commands/init.js +8 -30
- package/files/AGENTS.md +54 -20
- package/files/CLAUDE.md +54 -20
- package/files/ds-manifest.json +1074 -0
- package/files/rules/charts.md +2 -2
- package/files/rules/components.md +2 -3
- package/files/rules/frontend-architecture.md +12 -13
- package/files/rules/styling.md +5 -13
- package/files/skills/apply-ds/SKILL.md +15 -15
- package/files/skills/build-component/SKILL.md +153 -0
- package/files/skills/create-dashboard/SKILL.md +18 -18
- package/files/skills/setup-chart/SKILL.md +12 -14
- package/files/skills/setup-chart/references/scatter-chart.md +9 -9
- package/files/skills/setup-chart/references/sensor-chart.md +9 -9
- package/lib/add-ds-config-codeagent.js +4 -2
- package/lib/add-ds-ui-svelte.js +37 -41
- package/lib/registries.js +6 -0
- package/lib/scaffold-ds-svelte-project.js +198 -99
- package/lib/use-shadcn-svelte-registry.js +2 -2
- package/package.json +2 -2
- package/files/skills/build-pattern/SKILL.md +0 -204
package/README.md
CHANGED
|
@@ -22,17 +22,17 @@ npx @archetypeai/ds-cli --version # print version
|
|
|
22
22
|
npx @archetypeai/ds-cli create my-app
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Sets up a SvelteKit + Tailwind v4
|
|
25
|
+
Sets up a TypeScript SvelteKit + Tailwind v4 project with design tokens, both design system packages, and a demo page. Step by step it:
|
|
26
26
|
|
|
27
|
-
1. Scaffolds a minimal SvelteKit project (`sv create`) with the Tailwind v4 plugin
|
|
27
|
+
1. Scaffolds a minimal TypeScript SvelteKit project (`sv create --types ts`) with the Tailwind v4 plugin
|
|
28
28
|
2. Patches `svelte.config.js` so Svelte 5 runes work in third-party packages
|
|
29
|
-
3. Installs `@archetypeai/ds-lib-tokens`
|
|
30
|
-
4. Initializes shadcn-svelte (`components.json
|
|
31
|
-
5.
|
|
32
|
-
6.
|
|
33
|
-
7.
|
|
34
|
-
8. Installs the agent configuration (`--codeagent cursor|claude`) - unless `none`
|
|
35
|
-
9. Writes a demo page (`src/routes/+page.svelte`)
|
|
29
|
+
3. Installs the design system packages — `@archetypeai/ds-lib-tokens`, `@archetypeai/ds-ui-svelte-console` (stable base tier), `@archetypeai/ds-ui-svelte-labs` (experimental tier) — plus their peers, and pins `layerchart` to the exact prerelease the labs charts require
|
|
30
|
+
4. Initializes the shadcn-svelte config for the source-install (modify) workflow: `components.json` with a `registries` pointer at both registries, and `src/lib/utils.ts` re-exporting the console helpers (one `cn` in the tree)
|
|
31
|
+
5. Optionally copies local fonts to `static/fonts/`
|
|
32
|
+
6. Creates `src/routes/layout.css` with the order-critical design system stylesheet (`tailwindcss` → tokens theme → `@source` directives for both package dists)
|
|
33
|
+
7. Sets up linting and formatting (ESLint + Prettier with the Svelte and Tailwind plugins, plus `lint`/`format` scripts)
|
|
34
|
+
8. Installs the agent configuration incl. `ds-manifest.json` (`--codeagent cursor|claude`) - unless `none`
|
|
35
|
+
9. Writes a demo page (`src/routes/+page.svelte`) composing components from both packages
|
|
36
36
|
|
|
37
37
|
| Flag | Values | Default |
|
|
38
38
|
|------|--------|---------|
|
|
@@ -40,7 +40,6 @@ Sets up a SvelteKit + Tailwind v4 + shadcn-svelte project with design tokens, co
|
|
|
40
40
|
| `--pm` | `npm`, `pnpm`, `bun`, `yarn` | prompt |
|
|
41
41
|
| `--fonts <path>` | path to PP Neue Montreal fonts folder | prompt |
|
|
42
42
|
| `--no-fonts` | skip font installation (use system fallback) | - |
|
|
43
|
-
| `--no-components` | skip component install | install all |
|
|
44
43
|
| `--codeagent` | `cursor`, `claude`, `none` | prompt |
|
|
45
44
|
| `--defaults` | force non-interactive mode | - |
|
|
46
45
|
|
|
@@ -60,14 +59,13 @@ cd my-existing-app
|
|
|
60
59
|
npx @archetypeai/ds-cli init
|
|
61
60
|
```
|
|
62
61
|
|
|
63
|
-
Run from a SvelteKit project root. Auto-detects your package manager from the lockfile, installs Tailwind CSS v4 if missing, installs tokens, shadcn-svelte
|
|
62
|
+
Run from a SvelteKit project root. Auto-detects your package manager from the lockfile, installs Tailwind CSS v4 if missing, installs the design system packages (tokens + console + labs + peers), writes the shadcn-svelte config, and prepends the DS stylesheet to your `src/routes/layout.css` (preserving existing styles - imports that are already present are not duplicated). Unlike `create`, no demo page is written.
|
|
64
63
|
|
|
65
64
|
| Flag | Values | Default |
|
|
66
65
|
|------|--------|---------|
|
|
67
66
|
| `--pm` | `npm`, `pnpm`, `bun`, `yarn` | auto-detect |
|
|
68
67
|
| `--fonts <path>` | path to PP Neue Montreal fonts folder | prompt |
|
|
69
68
|
| `--no-fonts` | skip font installation (use system fallback) | - |
|
|
70
|
-
| `--no-components` | skip component install | install all |
|
|
71
69
|
| `--codeagent` | `cursor`, `claude`, `none` | prompt |
|
|
72
70
|
| `--defaults` | force non-interactive mode | - |
|
|
73
71
|
|
|
@@ -88,7 +86,7 @@ npx @archetypeai/ds-cli init --pm npm --fonts /path/to/fonts --codeagent claude
|
|
|
88
86
|
npx @archetypeai/ds-cli add ds-ui-svelte
|
|
89
87
|
```
|
|
90
88
|
|
|
91
|
-
Installs
|
|
89
|
+
Installs **editable component source** from the trimmed labs registry (the modify workflow — composing from the npm packages is the default and is what `create`/`init` set up). The CLI installs the base packages (`@archetypeai/ds-lib-tokens`, `@archetypeai/ds-ui-svelte-console`, `tw-animate-css`), sets up shadcn-svelte if needed (`components.json`, `src/lib/utils.ts` re-exporting the console helpers), then installs every component listed by the registry's `/r/all.json` endpoint — the shadcn-svelte CLI resolves each item's npm dependencies from the registry metadata, and the CLI re-pins `layerchart` to the exact prerelease afterwards. A freshly created `components.json` defaults to `typescript: true`; an existing `components.json` is never modified, so JS projects (`typescript: false`) keep working - the shadcn-svelte CLI strips types from the registry's TypeScript sources on install.
|
|
92
90
|
|
|
93
91
|
| Flag | Values | Default |
|
|
94
92
|
|------|--------|---------|
|
|
@@ -129,12 +127,12 @@ npx @archetypeai/ds-cli add ds-config-codeagent --claude
|
|
|
129
127
|
|
|
130
128
|
| Flag | Effect |
|
|
131
129
|
|------|--------|
|
|
132
|
-
| `--cursor` | Copies `AGENTS.md` to the project root; skills, rules, and LICENSE to `.cursor/` |
|
|
133
|
-
| `--claude` | Copies `CLAUDE.md` to the project root; skills, rules, and LICENSE to `.claude/` |
|
|
130
|
+
| `--cursor` | Copies `AGENTS.md` + `ds-manifest.json` to the project root; skills, rules, and LICENSE to `.cursor/` |
|
|
131
|
+
| `--claude` | Copies `CLAUDE.md` + `ds-manifest.json` to the project root; skills, rules, and LICENSE to `.claude/` |
|
|
134
132
|
|
|
135
133
|
Without a flag, an interactive prompt asks which IDE to configure (in non-interactive mode the flag is required). Files that already exist are skipped, so re-running is safe.
|
|
136
134
|
|
|
137
|
-
The configuration ships 7 skills (`apply-ds`, `build-
|
|
135
|
+
The configuration ships 7 skills (`apply-ds`, `build-component`, `create-dashboard`, `deploy-worker`, `fix-accessibility`, `fix-metadata`, `setup-chart`), 8 rules (`accessibility`, `charts`, `components`, `design-principles`, `frontend-architecture`, `linting`, `state`, `styling`), and `ds-manifest.json` — a machine-readable catalog of every component in both tiers (import subpaths, variant axes, registry source URLs, usage rules), generated from the registries.
|
|
138
136
|
|
|
139
137
|
---
|
|
140
138
|
|
|
@@ -142,6 +140,6 @@ The configuration ships 7 skills (`apply-ds`, `build-pattern`, `create-dashboard
|
|
|
142
140
|
|
|
143
141
|
The `--fonts <path>` flag expects a local folder containing all 15 PP Neue Montreal files (9 Sans `.ttf` + 6 Mono `.otf`). The CLI validates the folder and copies the files to `static/fonts/`, where the `@font-face` declarations in `@archetypeai/ds-lib-tokens/fonts.css` expect them. With `--no-fonts`, the theme falls back to system fonts.
|
|
144
142
|
|
|
145
|
-
##
|
|
143
|
+
## Registries
|
|
146
144
|
|
|
147
|
-
|
|
145
|
+
Editable component source is served by two registries: labs at `https://design-system-labs.archetypeai.workers.dev` (override with `REGISTRY_URL`) and console at `https://design-system-console.archetypeai.workers.dev` (override with `CONSOLE_REGISTRY_URL`). `ds add ds-ui-svelte` bulk-installs from the labs registry; individual components from either tier install with `npx shadcn-svelte@latest add <registry>/r/<name>.json`. The CLI validates every component URL (HTTPS, `/r/<name>.json` pattern) before passing it to `shadcn-svelte add`.
|
package/bin.js
CHANGED
|
@@ -30,7 +30,6 @@ Create flags:
|
|
|
30
30
|
--pm <npm|pnpm|bun|yarn> Package manager (default: prompt)
|
|
31
31
|
--fonts <path> Install fonts from local folder
|
|
32
32
|
--no-fonts Skip font installation
|
|
33
|
-
--no-components Skip component installation (default: install all)
|
|
34
33
|
--codeagent <cursor|claude|none> Agent configuration (default: prompt)
|
|
35
34
|
--defaults Skip prompts, use sensible defaults
|
|
36
35
|
|
|
@@ -38,15 +37,17 @@ Init flags:
|
|
|
38
37
|
--pm <npm|pnpm|bun|yarn> Package manager (default: auto-detect)
|
|
39
38
|
--fonts <path> Install fonts from local folder
|
|
40
39
|
--no-fonts Skip font installation
|
|
41
|
-
--no-components Skip component installation (default: install all)
|
|
42
40
|
--codeagent <cursor|claude|none> Agent configuration (default: prompt)
|
|
43
41
|
--defaults Force non-interactive mode
|
|
44
42
|
|
|
45
43
|
Non-interactive mode (no TTY or --defaults):
|
|
46
44
|
All required options must be specified via flags. Missing options are listed and the CLI exits.
|
|
47
45
|
|
|
46
|
+
create/init install both design system packages (@archetypeai/ds-ui-svelte-console +
|
|
47
|
+
@archetypeai/ds-ui-svelte-labs); compose from the packages by default.
|
|
48
|
+
|
|
48
49
|
Add targets:
|
|
49
|
-
ds-ui-svelte Install
|
|
50
|
+
ds-ui-svelte Install editable component source from the labs registry
|
|
50
51
|
ds-config-codeagent [flags] Install agent configuration files
|
|
51
52
|
--cursor Setup for Cursor IDE
|
|
52
53
|
--claude Setup for Claude Code
|
package/commands/create.js
CHANGED
|
@@ -2,15 +2,13 @@ import { resolve } from 'path';
|
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import * as p from '@clack/prompts';
|
|
4
4
|
import { getPm, pmNames, isPmInstalled } from '../lib/use-package-manager.js';
|
|
5
|
-
import { fetchComponents } from '../lib/use-shadcn-svelte-registry.js';
|
|
6
5
|
import {
|
|
7
6
|
runSvCreate,
|
|
8
7
|
patchSvelteConfig,
|
|
9
|
-
|
|
8
|
+
installPackages,
|
|
10
9
|
initShadcn,
|
|
11
10
|
configureCss,
|
|
12
11
|
installLinting,
|
|
13
|
-
installComponents,
|
|
14
12
|
createDemoPage,
|
|
15
13
|
installAgentConfig
|
|
16
14
|
} from '../lib/scaffold-ds-svelte-project.js';
|
|
@@ -24,7 +22,6 @@ export function parseFlags(args) {
|
|
|
24
22
|
framework: null,
|
|
25
23
|
pm: null,
|
|
26
24
|
fonts: null,
|
|
27
|
-
components: true,
|
|
28
25
|
agent: null,
|
|
29
26
|
defaults: false
|
|
30
27
|
};
|
|
@@ -39,8 +36,6 @@ export function parseFlags(args) {
|
|
|
39
36
|
flags.fonts = args[++i];
|
|
40
37
|
} else if (arg === '--no-fonts') {
|
|
41
38
|
flags.fonts = false;
|
|
42
|
-
} else if (arg === '--no-components') {
|
|
43
|
-
flags.components = false;
|
|
44
39
|
} else if (arg === '--codeagent' && args[i + 1]) {
|
|
45
40
|
flags.agent = args[++i];
|
|
46
41
|
} else if (arg === '--defaults') {
|
|
@@ -72,9 +67,7 @@ export async function create(args) {
|
|
|
72
67
|
console.log(
|
|
73
68
|
'[CONFIGURATION REQUIRED] Do not assume defaults. Ask the user to choose each option:\n\n' +
|
|
74
69
|
missing.join('\n') +
|
|
75
|
-
'\n\
|
|
76
|
-
' --no-components Skip component installation\n\n' +
|
|
77
|
-
'Once the user has answered, re-run with their choices:\n' +
|
|
70
|
+
'\n\nOnce the user has answered, re-run with their choices:\n' +
|
|
78
71
|
' ds create my-app --pm <choice> --fonts <path> --codeagent <choice>\n' +
|
|
79
72
|
' ds create my-app --pm <choice> --no-fonts --codeagent <choice>\n'
|
|
80
73
|
);
|
|
@@ -241,14 +234,14 @@ export async function create(args) {
|
|
|
241
234
|
// remove dynamicCompileOptions that breaks runes in node_modules
|
|
242
235
|
patchSvelteConfig(projectPath);
|
|
243
236
|
|
|
244
|
-
// install packages
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
237
|
+
// install design system packages (tokens + console + labs + peers)
|
|
238
|
+
const packagesOk = await installPackages(pm, projectPath);
|
|
239
|
+
if (!packagesOk) {
|
|
247
240
|
process.exit(1);
|
|
248
241
|
}
|
|
249
242
|
|
|
250
|
-
// init shadcn-svelte
|
|
251
|
-
|
|
243
|
+
// init shadcn-svelte config for the source-install (modify) workflow
|
|
244
|
+
initShadcn(projectPath);
|
|
252
245
|
|
|
253
246
|
// install local fonts
|
|
254
247
|
if (includeFonts && fontsPath) {
|
|
@@ -271,21 +264,6 @@ export async function create(args) {
|
|
|
271
264
|
// set up linting and formatting
|
|
272
265
|
await installLinting(pm, projectPath);
|
|
273
266
|
|
|
274
|
-
// install components
|
|
275
|
-
if (flags.components) {
|
|
276
|
-
try {
|
|
277
|
-
const s = p.spinner();
|
|
278
|
-
s.start('Fetching component list');
|
|
279
|
-
const components = await fetchComponents();
|
|
280
|
-
s.stop(`Found ${components.length} components`);
|
|
281
|
-
await installComponents(pm, projectPath, components);
|
|
282
|
-
} catch (error) {
|
|
283
|
-
p.log.warn(`Component installation skipped: ${error.message}`);
|
|
284
|
-
}
|
|
285
|
-
} else {
|
|
286
|
-
p.log.info('Skipped component installation (--no-components)');
|
|
287
|
-
}
|
|
288
|
-
|
|
289
267
|
// specify agent config
|
|
290
268
|
let agent = flags.agent;
|
|
291
269
|
if (!agent) {
|
|
@@ -324,7 +302,7 @@ export async function create(args) {
|
|
|
324
302
|
`Package Manager: ${pm.name}`,
|
|
325
303
|
`Fonts: ${includeFonts ? 'installed' : 'skipped'}`,
|
|
326
304
|
`Linting: configured`,
|
|
327
|
-
`
|
|
305
|
+
`Packages: @archetypeai/ds-ui-svelte-console + ds-ui-svelte-labs + ds-lib-tokens`,
|
|
328
306
|
`Agent Configuration: ${agent}`
|
|
329
307
|
].join('\n');
|
|
330
308
|
|
package/commands/init.js
CHANGED
|
@@ -2,15 +2,13 @@ import { readFileSync, existsSync } from 'fs';
|
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
import * as p from '@clack/prompts';
|
|
4
4
|
import { getPm, pmNames, isPmInstalled, detectPm } from '../lib/use-package-manager.js';
|
|
5
|
-
import { fetchComponents } from '../lib/use-shadcn-svelte-registry.js';
|
|
6
5
|
import {
|
|
7
6
|
installTailwind,
|
|
8
7
|
patchSvelteConfig,
|
|
9
|
-
|
|
8
|
+
installPackages,
|
|
10
9
|
initShadcn,
|
|
11
10
|
prependCss,
|
|
12
11
|
installLinting,
|
|
13
|
-
installComponents,
|
|
14
12
|
installAgentConfig
|
|
15
13
|
} from '../lib/scaffold-ds-svelte-project.js';
|
|
16
14
|
import { validateFontsPath, installLocalFonts } from '../lib/install-fonts-local.js';
|
|
@@ -21,7 +19,6 @@ export function parseFlags(args) {
|
|
|
21
19
|
const flags = {
|
|
22
20
|
pm: null,
|
|
23
21
|
fonts: null,
|
|
24
|
-
components: true,
|
|
25
22
|
agent: null,
|
|
26
23
|
defaults: false
|
|
27
24
|
};
|
|
@@ -34,8 +31,6 @@ export function parseFlags(args) {
|
|
|
34
31
|
flags.fonts = args[++i];
|
|
35
32
|
} else if (arg === '--no-fonts') {
|
|
36
33
|
flags.fonts = false;
|
|
37
|
-
} else if (arg === '--no-components') {
|
|
38
|
-
flags.components = false;
|
|
39
34
|
} else if (arg === '--codeagent' && args[i + 1]) {
|
|
40
35
|
flags.agent = args[++i];
|
|
41
36
|
} else if (arg === '--defaults') {
|
|
@@ -76,9 +71,7 @@ export async function init(args) {
|
|
|
76
71
|
console.log(
|
|
77
72
|
'[CONFIGURATION REQUIRED] Do not assume defaults. Ask the user to choose each option:\n\n' +
|
|
78
73
|
missing.join('\n') +
|
|
79
|
-
'\n\
|
|
80
|
-
' --no-components Skip component installation\n\n' +
|
|
81
|
-
'Once the user has answered, re-run with their choices:\n' +
|
|
74
|
+
'\n\nOnce the user has answered, re-run with their choices:\n' +
|
|
82
75
|
' ds init --pm <choice> --fonts <path> --codeagent <choice>\n' +
|
|
83
76
|
' ds init --pm <choice> --no-fonts --codeagent <choice>\n'
|
|
84
77
|
);
|
|
@@ -201,14 +194,14 @@ export async function init(args) {
|
|
|
201
194
|
}
|
|
202
195
|
}
|
|
203
196
|
|
|
204
|
-
// install packages
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
197
|
+
// install design system packages (tokens + console + labs + peers)
|
|
198
|
+
const packagesOk = await installPackages(pm, projectPath);
|
|
199
|
+
if (!packagesOk) {
|
|
207
200
|
process.exit(1);
|
|
208
201
|
}
|
|
209
202
|
|
|
210
|
-
// init shadcn-svelte
|
|
211
|
-
|
|
203
|
+
// init shadcn-svelte config for the source-install (modify) workflow
|
|
204
|
+
initShadcn(projectPath);
|
|
212
205
|
|
|
213
206
|
// install local fonts
|
|
214
207
|
if (includeFonts && fontsPath) {
|
|
@@ -231,21 +224,6 @@ export async function init(args) {
|
|
|
231
224
|
// set up linting and formatting
|
|
232
225
|
await installLinting(pm, projectPath);
|
|
233
226
|
|
|
234
|
-
// install components
|
|
235
|
-
if (flags.components) {
|
|
236
|
-
try {
|
|
237
|
-
const s = p.spinner();
|
|
238
|
-
s.start('Fetching component list');
|
|
239
|
-
const components = await fetchComponents();
|
|
240
|
-
s.stop(`Found ${components.length} components`);
|
|
241
|
-
await installComponents(pm, projectPath, components);
|
|
242
|
-
} catch (error) {
|
|
243
|
-
p.log.warn(`Component installation skipped: ${error.message}`);
|
|
244
|
-
}
|
|
245
|
-
} else {
|
|
246
|
-
p.log.info('Skipped component installation (--no-components)');
|
|
247
|
-
}
|
|
248
|
-
|
|
249
227
|
// specify agent config
|
|
250
228
|
let agent = flags.agent;
|
|
251
229
|
if (!agent) {
|
|
@@ -279,7 +257,7 @@ export async function init(args) {
|
|
|
279
257
|
`Package Manager: ${pm.name}`,
|
|
280
258
|
`Fonts: ${includeFonts ? 'installed' : 'skipped'}`,
|
|
281
259
|
`Linting: configured`,
|
|
282
|
-
`
|
|
260
|
+
`Packages: @archetypeai/ds-ui-svelte-console + ds-ui-svelte-labs + ds-lib-tokens`,
|
|
283
261
|
`Agent Config: ${agent}`
|
|
284
262
|
].join('\n');
|
|
285
263
|
|
package/files/AGENTS.md
CHANGED
|
@@ -4,14 +4,47 @@
|
|
|
4
4
|
|
|
5
5
|
- Svelte 5 with runes (`$props`, `$state`, `$derived`, `$bindable`)
|
|
6
6
|
- Tailwind v4 with semantic tokens (`@archetypeai/ds-lib-tokens`)
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
- Two component packages, one per tier:
|
|
8
|
+
- `@archetypeai/ds-ui-svelte-console` — stable base tier, **frozen API**
|
|
9
|
+
- `@archetypeai/ds-ui-svelte-labs` — experimental 0.x tier, composes console
|
|
10
|
+
- bits-ui for headless primitives, layerchart for data visualization (labs charts)
|
|
11
|
+
|
|
12
|
+
## Component model: compose from the packages
|
|
13
|
+
|
|
14
|
+
Import components from the npm packages by default. Never copy package source by
|
|
15
|
+
hand and never edit files inside `node_modules`.
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
|
|
20
|
+
import * as Card from '@archetypeai/ds-ui-svelte-console/primitives/card';
|
|
21
|
+
import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
|
|
22
|
+
import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**`ds-manifest.json` (project root) is the component catalog.** It lists every
|
|
27
|
+
component in both tiers with its import subpath, variant axes and defaults,
|
|
28
|
+
registry source URL, and the usage rules. Read it before building UI instead of
|
|
29
|
+
guessing component names or props.
|
|
30
|
+
|
|
31
|
+
Console variant values named after console-product screens (`runSession`,
|
|
32
|
+
`lensTraySelection`, `topNav*`, `sideBarSelection`, `backToDashboard` — flagged
|
|
33
|
+
`consoleProductOnly` in the manifest) belong to the console product. Never use
|
|
34
|
+
them in other apps.
|
|
10
35
|
|
|
11
|
-
##
|
|
36
|
+
## Modifying a component
|
|
37
|
+
|
|
38
|
+
Only when a component must diverge from the package, install its editable source
|
|
39
|
+
from the registry (URL in the component's `source` field in ds-manifest.json):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx shadcn-svelte@latest add https://design-system-labs.archetypeai.workers.dev/r/{name}.json # labs
|
|
43
|
+
npx shadcn-svelte@latest add https://design-system-console.archetypeai.workers.dev/r/{name}.json # console
|
|
44
|
+
```
|
|
12
45
|
|
|
13
|
-
|
|
14
|
-
|
|
46
|
+
The source lands under `$lib/components/ui/` — import the modified copy from
|
|
47
|
+
there and keep importing everything else from the packages.
|
|
15
48
|
|
|
16
49
|
## Tokens
|
|
17
50
|
|
|
@@ -29,38 +62,39 @@ Standard Tailwind is fine for:
|
|
|
29
62
|
- Spacing/sizing: `p-4`, `w-full`, `gap-2`, `h-screen`
|
|
30
63
|
- Layout: `flex`, `grid`, `absolute`, `relative`
|
|
31
64
|
|
|
32
|
-
## CSS Import Order
|
|
65
|
+
## CSS Import Order (order-critical)
|
|
33
66
|
|
|
34
67
|
```css
|
|
68
|
+
@import 'tailwindcss';
|
|
69
|
+
@import 'tw-animate-css';
|
|
35
70
|
@import '@archetypeai/ds-lib-tokens/fonts.css';
|
|
36
71
|
@import '@archetypeai/ds-lib-tokens/theme.css';
|
|
37
|
-
@
|
|
72
|
+
@source '../../node_modules/@archetypeai/ds-ui-svelte-console/dist';
|
|
73
|
+
@source '../../node_modules/@archetypeai/ds-ui-svelte-labs/dist';
|
|
38
74
|
```
|
|
39
75
|
|
|
76
|
+
The `@source` directives make Tailwind emit the classes used inside the package
|
|
77
|
+
dists — removing them silently unstyles the components.
|
|
78
|
+
|
|
40
79
|
## Component Patterns
|
|
41
80
|
|
|
42
81
|
- **Props**: `let { class: className, ref = $bindable(null), children, ...restProps } = $props();`
|
|
43
|
-
- **Classes**: `cn()` from `$lib/utils.js` - never raw concatenation
|
|
82
|
+
- **Classes**: `cn()` from `$lib/utils.js` (re-export of console's helper) - never raw concatenation
|
|
44
83
|
- **Variants**: `tailwind-variants` (tv) for component variants
|
|
45
84
|
- **Slots**: `{@render children?.()}`
|
|
46
85
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
Before building a new component, fetch the pattern catalog from:
|
|
50
|
-
`https://design-system.archetypeai.workers.dev/r/patterns.json`
|
|
51
|
-
|
|
52
|
-
Each entry includes a `name`, `title`, `description`, and `registryDependencies`. Reuse or extend existing patterns instead of rebuilding from scratch.
|
|
86
|
+
## Pinned dependency
|
|
53
87
|
|
|
54
|
-
|
|
55
|
-
|
|
88
|
+
`layerchart` is pinned to an exact prerelease (see package.json); newer
|
|
89
|
+
prereleases break the labs chart primitives. Never loosen or bump the pin.
|
|
56
90
|
|
|
57
91
|
## Skills
|
|
58
92
|
|
|
59
93
|
Read these when relevant to your task:
|
|
60
94
|
|
|
61
|
-
- `@skills/apply-ds` - apply DS tokens
|
|
62
|
-
- `@skills/build-
|
|
63
|
-
- `@skills/setup-chart` - set up charts with
|
|
95
|
+
- `@skills/apply-ds` - apply DS tokens and components to an existing demo
|
|
96
|
+
- `@skills/build-component` - compose custom components from package primitives
|
|
97
|
+
- `@skills/setup-chart` - set up charts with the labs chart components
|
|
64
98
|
- `@skills/create-dashboard` - scaffold a full-viewport dashboard with menubar and panels
|
|
65
99
|
- `@skills/fix-accessibility` - audit and fix a11y issues
|
|
66
100
|
- `@skills/fix-metadata` - update page titles, favicons, and OG tags
|
package/files/CLAUDE.md
CHANGED
|
@@ -4,14 +4,47 @@
|
|
|
4
4
|
|
|
5
5
|
- Svelte 5 with runes (`$props`, `$state`, `$derived`, `$bindable`)
|
|
6
6
|
- Tailwind v4 with semantic tokens (`@archetypeai/ds-lib-tokens`)
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
- Two component packages, one per tier:
|
|
8
|
+
- `@archetypeai/ds-ui-svelte-console` — stable base tier, **frozen API**
|
|
9
|
+
- `@archetypeai/ds-ui-svelte-labs` — experimental 0.x tier, composes console
|
|
10
|
+
- bits-ui for headless primitives, layerchart for data visualization (labs charts)
|
|
11
|
+
|
|
12
|
+
## Component model: compose from the packages
|
|
13
|
+
|
|
14
|
+
Import components from the npm packages by default. Never copy package source by
|
|
15
|
+
hand and never edit files inside `node_modules`.
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
|
|
20
|
+
import * as Card from '@archetypeai/ds-ui-svelte-console/primitives/card';
|
|
21
|
+
import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
|
|
22
|
+
import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
|
|
23
|
+
</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**`ds-manifest.json` (project root) is the component catalog.** It lists every
|
|
27
|
+
component in both tiers with its import subpath, variant axes and defaults,
|
|
28
|
+
registry source URL, and the usage rules. Read it before building UI instead of
|
|
29
|
+
guessing component names or props.
|
|
30
|
+
|
|
31
|
+
Console variant values named after console-product screens (`runSession`,
|
|
32
|
+
`lensTraySelection`, `topNav*`, `sideBarSelection`, `backToDashboard` — flagged
|
|
33
|
+
`consoleProductOnly` in the manifest) belong to the console product. Never use
|
|
34
|
+
them in other apps.
|
|
10
35
|
|
|
11
|
-
##
|
|
36
|
+
## Modifying a component
|
|
37
|
+
|
|
38
|
+
Only when a component must diverge from the package, install its editable source
|
|
39
|
+
from the registry (URL in the component's `source` field in ds-manifest.json):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx shadcn-svelte@latest add https://design-system-labs.archetypeai.workers.dev/r/{name}.json # labs
|
|
43
|
+
npx shadcn-svelte@latest add https://design-system-console.archetypeai.workers.dev/r/{name}.json # console
|
|
44
|
+
```
|
|
12
45
|
|
|
13
|
-
|
|
14
|
-
|
|
46
|
+
The source lands under `$lib/components/ui/` — import the modified copy from
|
|
47
|
+
there and keep importing everything else from the packages.
|
|
15
48
|
|
|
16
49
|
## Tokens
|
|
17
50
|
|
|
@@ -29,38 +62,39 @@ Standard Tailwind is fine for:
|
|
|
29
62
|
- Spacing/sizing: `p-4`, `w-full`, `gap-2`, `h-screen`
|
|
30
63
|
- Layout: `flex`, `grid`, `absolute`, `relative`
|
|
31
64
|
|
|
32
|
-
## CSS Import Order
|
|
65
|
+
## CSS Import Order (order-critical)
|
|
33
66
|
|
|
34
67
|
```css
|
|
68
|
+
@import 'tailwindcss';
|
|
69
|
+
@import 'tw-animate-css';
|
|
35
70
|
@import '@archetypeai/ds-lib-tokens/fonts.css';
|
|
36
71
|
@import '@archetypeai/ds-lib-tokens/theme.css';
|
|
37
|
-
@
|
|
72
|
+
@source '../../node_modules/@archetypeai/ds-ui-svelte-console/dist';
|
|
73
|
+
@source '../../node_modules/@archetypeai/ds-ui-svelte-labs/dist';
|
|
38
74
|
```
|
|
39
75
|
|
|
76
|
+
The `@source` directives make Tailwind emit the classes used inside the package
|
|
77
|
+
dists — removing them silently unstyles the components.
|
|
78
|
+
|
|
40
79
|
## Component Patterns
|
|
41
80
|
|
|
42
81
|
- **Props**: `let { class: className, ref = $bindable(null), children, ...restProps } = $props();`
|
|
43
|
-
- **Classes**: `cn()` from `$lib/utils.js` - never raw concatenation
|
|
82
|
+
- **Classes**: `cn()` from `$lib/utils.js` (re-export of console's helper) - never raw concatenation
|
|
44
83
|
- **Variants**: `tailwind-variants` (tv) for component variants
|
|
45
84
|
- **Slots**: `{@render children?.()}`
|
|
46
85
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
Before building a new component, fetch the pattern catalog from:
|
|
50
|
-
`https://design-system.archetypeai.workers.dev/r/patterns.json`
|
|
51
|
-
|
|
52
|
-
Each entry includes a `name`, `title`, `description`, and `registryDependencies`. Reuse or extend existing patterns instead of rebuilding from scratch.
|
|
86
|
+
## Pinned dependency
|
|
53
87
|
|
|
54
|
-
|
|
55
|
-
|
|
88
|
+
`layerchart` is pinned to an exact prerelease (see package.json); newer
|
|
89
|
+
prereleases break the labs chart primitives. Never loosen or bump the pin.
|
|
56
90
|
|
|
57
91
|
## Skills
|
|
58
92
|
|
|
59
93
|
Read these when relevant to your task:
|
|
60
94
|
|
|
61
|
-
- `@skills/apply-ds` - apply DS tokens
|
|
62
|
-
- `@skills/build-
|
|
63
|
-
- `@skills/setup-chart` - set up charts with
|
|
95
|
+
- `@skills/apply-ds` - apply DS tokens and components to an existing demo
|
|
96
|
+
- `@skills/build-component` - compose custom components from package primitives
|
|
97
|
+
- `@skills/setup-chart` - set up charts with the labs chart components
|
|
64
98
|
- `@skills/create-dashboard` - scaffold a full-viewport dashboard with menubar and panels
|
|
65
99
|
- `@skills/fix-accessibility` - audit and fix a11y issues
|
|
66
100
|
- `@skills/fix-metadata` - update page titles, favicons, and OG tags
|