@archetypeai/ds-cli 0.9.0 → 0.10.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 (32) hide show
  1. package/README.md +3 -3
  2. package/commands/create.js +2 -2
  3. package/commands/init.js +2 -2
  4. package/files/AGENTS.md +128 -70
  5. package/files/CLAUDE.md +128 -70
  6. package/files/ds-manifest.json +998 -1023
  7. package/lib/add-ds-config-codeagent.js +3 -57
  8. package/package.json +2 -2
  9. package/files/LICENSE +0 -21
  10. package/files/rules/accessibility.md +0 -268
  11. package/files/rules/charts.md +0 -256
  12. package/files/rules/components.md +0 -251
  13. package/files/rules/design-principles.md +0 -71
  14. package/files/rules/frontend-architecture.md +0 -86
  15. package/files/rules/linting.md +0 -31
  16. package/files/rules/state.md +0 -373
  17. package/files/rules/styling.md +0 -142
  18. package/files/skills/apply-ds/SKILL.md +0 -121
  19. package/files/skills/apply-ds/scripts/audit.sh +0 -169
  20. package/files/skills/apply-ds/scripts/setup.sh +0 -153
  21. package/files/skills/build-component/SKILL.md +0 -153
  22. package/files/skills/create-dashboard/SKILL.md +0 -220
  23. package/files/skills/deploy-worker/SKILL.md +0 -231
  24. package/files/skills/deploy-worker/references/wrangler-commands.md +0 -327
  25. package/files/skills/fix-accessibility/SKILL.md +0 -232
  26. package/files/skills/fix-metadata/SKILL.md +0 -118
  27. package/files/skills/fix-metadata/assets/favicon.ico +0 -0
  28. package/files/skills/setup-chart/SKILL.md +0 -223
  29. package/files/skills/setup-chart/data/embedding.csv +0 -42
  30. package/files/skills/setup-chart/data/timeseries.csv +0 -173
  31. package/files/skills/setup-chart/references/scatter-chart.md +0 -229
  32. package/files/skills/setup-chart/references/sensor-chart.md +0 -156
package/README.md CHANGED
@@ -127,12 +127,12 @@ npx @archetypeai/ds-cli add ds-config-codeagent --claude
127
127
 
128
128
  | Flag | Effect |
129
129
  |------|--------|
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/` |
130
+ | `--cursor` | Copies `AGENTS.md` + `ds-manifest.json` to the project root |
131
+ | `--claude` | Copies `CLAUDE.md` + `ds-manifest.json` to the project root |
132
132
 
133
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.
134
134
 
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.
135
+ The configuration is two files: the instruction file (`CLAUDE.md`/`AGENTS.md` stack, CSS wiring, tokens, typography, patterns, hard rules) and `ds-manifest.json` — a machine-readable catalog of every component (import subpath, registry source URL, description, `usage` recipes grounded in real product usage, and variant axes with defaults). The manifest is generated from the component source and each primitive's colocated `usage.json`.
136
136
 
137
137
  ---
138
138
 
@@ -271,8 +271,8 @@ export async function create(args) {
271
271
  message: 'Install AI agent configuration?',
272
272
  options: [
273
273
  { value: 'none', label: 'None' },
274
- { value: 'cursor', label: 'Cursor', hint: 'AGENTS.md + skills + rules' },
275
- { value: 'claude', label: 'Claude Code', hint: 'CLAUDE.md + skills + rules, default' }
274
+ { value: 'cursor', label: 'Cursor', hint: 'AGENTS.md + ds-manifest.json' },
275
+ { value: 'claude', label: 'Claude Code', hint: 'CLAUDE.md + ds-manifest.json, default' }
276
276
  ]
277
277
  });
278
278
  if (p.isCancel(agent)) {
package/commands/init.js CHANGED
@@ -231,8 +231,8 @@ export async function init(args) {
231
231
  message: 'Install AI agent configuration?',
232
232
  options: [
233
233
  { value: 'none', label: 'None' },
234
- { value: 'cursor', label: 'Cursor', hint: 'AGENTS.md + skills + rules' },
235
- { value: 'claude', label: 'Claude Code', hint: 'CLAUDE.md + skills + rules, default' }
234
+ { value: 'cursor', label: 'Cursor', hint: 'AGENTS.md + ds-manifest.json' },
235
+ { value: 'claude', label: 'Claude Code', hint: 'CLAUDE.md + ds-manifest.json, default' }
236
236
  ]
237
237
  });
238
238
  if (p.isCancel(agent)) {
package/files/AGENTS.md CHANGED
@@ -1,68 +1,46 @@
1
1
  # Archetype AI Design System
2
2
 
3
+ Compose UIs from the design system's npm packages — never hand-roll components,
4
+ tokens, fonts, or brand styling the system already provides.
5
+
3
6
  ## Stack
4
7
 
5
8
  - Svelte 5 with runes (`$props`, `$state`, `$derived`, `$bindable`)
6
- - Tailwind v4 with semantic tokens (`@archetypeai/ds-lib-tokens`)
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)
9
+ - Tailwind v4 with design tokens from `@archetypeai/ds-lib-tokens` (source of truth)
10
+ - `@archetypeai/ds-ui-svelte-console` production-ready primitives, stable API
11
+ - `@archetypeai/ds-ui-svelte-labs` — experimental primitives built on console; may change between 0.x versions
12
+ - bits-ui underneath for headless behavior; icons from `@lucide/svelte`
11
13
 
12
- ## Component model: compose from the packages
14
+ ## The manifest is the catalog
13
15
 
14
- Import components from the npm packages by default. Never copy package source by
15
- hand and never edit files inside `node_modules`.
16
+ **`ds-manifest.json` (project root) lists every component**: import path, what
17
+ it's for, variant axes with defaults, and `usage` idiomatic prop combinations
18
+ observed in the real product. Read a component's entry before using it instead
19
+ of guessing names or props.
16
20
 
17
21
  ```svelte
18
22
  <script lang="ts">
19
23
  import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
20
24
  import * as Card from '@archetypeai/ds-ui-svelte-console/primitives/card';
21
- import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
22
25
  import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
23
26
  </script>
24
27
  ```
25
28
 
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.
35
-
36
29
  ## Modifying a component
37
30
 
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):
31
+ Import from the packages by default. Only when a component must diverge, pull
32
+ its editable source from the registry (the component's `source` URL in the
33
+ manifest):
40
34
 
41
35
  ```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
36
+ npx shadcn-svelte@latest add <component source URL>
44
37
  ```
45
38
 
46
- The source lands under `$lib/components/ui/` — import the modified copy from
47
- there and keep importing everything else from the packages.
48
-
49
- ## Tokens
50
-
51
- Prefer semantic tokens for themed colors:
52
-
53
- - `bg-background`, `text-foreground`, `border-border`
54
- - `bg-primary`, `text-primary-foreground`
55
- - `bg-muted`, `text-muted-foreground`
56
- - `bg-card`, `bg-popover`, `bg-accent`, `bg-destructive`
57
- - `bg-atai-neutral`, `text-atai-good`, `text-atai-warning`, `text-atai-critical`
58
- - etc.
59
-
60
- Standard Tailwind is fine for:
39
+ The source lands under `$lib/components/ui/<name>/` — import the modified copy
40
+ from there and keep everything else on package imports. Never edit files in
41
+ `node_modules`.
61
42
 
62
- - Spacing/sizing: `p-4`, `w-full`, `gap-2`, `h-screen`
63
- - Layout: `flex`, `grid`, `absolute`, `relative`
64
-
65
- ## CSS Import Order (order-critical)
43
+ ## CSS wiring (order-critical)
66
44
 
67
45
  ```css
68
46
  @import 'tailwindcss';
@@ -73,42 +51,122 @@ Standard Tailwind is fine for:
73
51
  @source '../../node_modules/@archetypeai/ds-ui-svelte-labs/dist';
74
52
  ```
75
53
 
76
- The `@source` directives make Tailwind emit the classes used inside the package
54
+ The `@source` directives make Tailwind emit classes used inside the package
77
55
  dists — removing them silently unstyles the components.
78
56
 
79
- ## Component Patterns
57
+ ## Tokens
58
+
59
+ Use semantic tokens for anything themed; standard Tailwind for layout.
60
+
61
+ - Surfaces/text: `bg-background`, `text-foreground`, `bg-card`, `bg-muted`,
62
+ `text-muted-foreground`, `border-border`, `bg-accent`, `bg-primary`,
63
+ `text-primary-foreground`, `bg-destructive`
64
+ - Status: `text-atai-good`, `text-atai-warning`, `text-atai-critical`,
65
+ `text-atai-neutral` (pair with matching `border-*` on status badges)
66
+ - Brand: `bg-atai-brand-babyblue`, `bg-atai-brand-yellow`,
67
+ `text-atai-always-black`, `text-atai-always-white`
68
+ - Icon strokes on lucide icons: `stroke-icon-default`,
69
+ `stroke-icon-interactive`, `stroke-icon-status`, `stroke-icon-emphasis`
70
+ - Spacing scale: `xs sm md lg xl` work as `p-lg`, `gap-md`, `space-y-xl`, `mb-sm`
71
+ - Chart series colors: `var(--chart-1)` … `var(--chart-5)`
72
+ - Radius on interactive elements: `rounded-interactive`
73
+
74
+ Standard Tailwind is fine for spacing/sizing (`p-4`, `w-full`, `gap-2`) and
75
+ layout (`flex`, `grid`, `absolute`). Status colors communicate state — never
76
+ use them decoratively.
77
+
78
+ ## Typography
79
+
80
+ Default to sans for all text. `font-mono` is reserved for exactly two cases:
81
+
82
+ - Primitives that already use it in the design system source of truth (their
83
+ built-in styles or `typography="mono"` variants) — don't add mono to others
84
+ - Values that would cause layout shift as they update, and ids — numbers,
85
+ timestamps, session/job ids
86
+
87
+ Everything else — body copy, descriptions, headings, buttons without a mono
88
+ variant — stays sans. Never apply mono decoratively.
89
+
90
+ ## API keys and endpoints
91
+
92
+ When a demo needs an API key, never read it from `.env` — add an `Input` to
93
+ the `Menubar` (children slot) so the user pastes the key at runtime; hold it
94
+ in `$state` and pass it to API calls. Endpoints/base URLs do come from `.env`.
80
95
 
81
- - **Props**: `let { class: className, ref = $bindable(null), children, ...restProps } = $props();`
82
- - **Classes**: `cn()` from `$lib/utils.js` (re-export of console's helper) - never raw concatenation
83
- - **Variants**: `tailwind-variants` (tv) for component variants
84
- - **Slots**: `{@render children?.()}`
96
+ ## Dark mode
85
97
 
86
- ## Pinned dependency
98
+ `.dark` class on `<html>` switches every token. Use the controller from the
99
+ console package — don't write your own:
87
100
 
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.
101
+ ```svelte
102
+ import { darkMode } from '@archetypeai/ds-ui-svelte-console/primitives/theme';
103
+
104
+ darkMode.set(window.matchMedia('(prefers-color-scheme: dark)').matches); // init
105
+ darkMode.toggle(); // switch
106
+ darkMode.current; // reactive read
107
+ ```
108
+
109
+ Gotcha: `CodeBlock` highlights once on mount — wrap it in
110
+ `{#key darkMode.current}` so it re-highlights on theme flips.
111
+
112
+ ## Page shell
113
+
114
+ Dashboards are full-viewport: branded `Menubar` (labs) on top with action
115
+ buttons as children, content in a padded `main`:
116
+
117
+ ```svelte
118
+ <div class="bg-background flex h-screen flex-col">
119
+ <Menubar>
120
+ <Button variant="link" class="text-muted-foreground no-underline hover:underline">Action</Button>
121
+ </Menubar>
122
+ <main class="min-h-0 flex-1 p-lg">…panels…</main>
123
+ </div>
124
+ ```
125
+
126
+ Mount `<Toaster />` (sonner) once at the root; fire `toast.success(...)` /
127
+ `toast.error(...)` anywhere.
90
128
 
91
- ## Skills
129
+ ## Charts
130
+
131
+ - Time series → `SensorChart`; embeddings/clusters → `ScatterChart` (see their
132
+ `usage` in the manifest, incl. streaming via `maxPoints`)
133
+ - Custom charts: wrap layerchart in `Chart.Container` with a
134
+ `config` mapping data keys to `{ label, color: 'var(--chart-N)' }`
135
+ - `layerchart` is pinned to an exact prerelease — never loosen or bump it
136
+
137
+ ## Custom components
138
+
139
+ Compose project-specific components from package primitives in
140
+ `$lib/components/ui/custom/`. Follow the package conventions:
141
+
142
+ ```svelte
143
+ <script lang="ts">
144
+ import { cn } from '$lib/utils.js';
145
+ let { class: className, ref = $bindable(null), children, ...restProps } = $props();
146
+ </script>
147
+
148
+ <div bind:this={ref} class={cn('bg-card p-lg', className)} {...restProps}>
149
+ {@render children?.()}
150
+ </div>
151
+ ```
92
152
 
93
- Read these when relevant to your task:
153
+ - `cn()` comes from `$lib/utils.js` (re-export of the console helper) — never
154
+ create a local clsx/tailwind-merge copy, never concatenate class strings
155
+ - Keep API/streaming logic (fetch, SSE, polling) in `src/lib/api/*`, not in
156
+ components
94
157
 
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
98
- - `@skills/create-dashboard` - scaffold a full-viewport dashboard with menubar and panels
99
- - `@skills/fix-accessibility` - audit and fix a11y issues
100
- - `@skills/fix-metadata` - update page titles, favicons, and OG tags
101
- - `@skills/deploy-worker` - deploy SvelteKit projects to Cloudflare Workers
158
+ ## Accessibility
102
159
 
103
- ## Rules
160
+ - `aria-label` on every icon-only control (buttons, switches, sliders, toggles)
161
+ - `aria-hidden="true"` on decorative icons; `sr-only` for visually hidden text
162
+ - Don't remove focus rings; components ship correct focus states
104
163
 
105
- See `@rules/` for comprehensive guidance on design principles, components, styling, charts, and linting.
164
+ ## Hard rules
106
165
 
107
- - `@rules/accessibility` a11y guidelines and ARIA patterns
108
- - `@rules/charts` — chart setup, layerchart conventions, data visualization
109
- - `@rules/components` component API patterns, props, variants, slots
110
- - `@rules/design-principles` visual design language, spacing, typography
111
- - `@rules/frontend-architecture` component decomposition, page composition, API logic extraction
112
- - `@rules/linting` linting and formatting rules
113
- - `@rules/state` state management with Svelte 5 runes
114
- - `@rules/styling` — Tailwind v4, semantic tokens, theming
166
+ - Never edit `node_modules`; never copy package source by hand — eject via the
167
+ registry instead
168
+ - Variant values named after console-product screens (`runSession`, `topNav*`,
169
+ `sideBarSelection`, `lensTray*`, `backToDashboard`) exist in the package
170
+ types but are internal to the Archetype AI console product — never use them
171
+ - Keep the `@source` directives and the CSS import order exactly as above
172
+ - `layerchart` stays pinned exactly
package/files/CLAUDE.md CHANGED
@@ -1,68 +1,46 @@
1
1
  # Archetype AI Design System
2
2
 
3
+ Compose UIs from the design system's npm packages — never hand-roll components,
4
+ tokens, fonts, or brand styling the system already provides.
5
+
3
6
  ## Stack
4
7
 
5
8
  - Svelte 5 with runes (`$props`, `$state`, `$derived`, `$bindable`)
6
- - Tailwind v4 with semantic tokens (`@archetypeai/ds-lib-tokens`)
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)
9
+ - Tailwind v4 with design tokens from `@archetypeai/ds-lib-tokens` (source of truth)
10
+ - `@archetypeai/ds-ui-svelte-console` production-ready primitives, stable API
11
+ - `@archetypeai/ds-ui-svelte-labs` — experimental primitives built on console; may change between 0.x versions
12
+ - bits-ui underneath for headless behavior; icons from `@lucide/svelte`
11
13
 
12
- ## Component model: compose from the packages
14
+ ## The manifest is the catalog
13
15
 
14
- Import components from the npm packages by default. Never copy package source by
15
- hand and never edit files inside `node_modules`.
16
+ **`ds-manifest.json` (project root) lists every component**: import path, what
17
+ it's for, variant axes with defaults, and `usage` idiomatic prop combinations
18
+ observed in the real product. Read a component's entry before using it instead
19
+ of guessing names or props.
16
20
 
17
21
  ```svelte
18
22
  <script lang="ts">
19
23
  import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
20
24
  import * as Card from '@archetypeai/ds-ui-svelte-console/primitives/card';
21
- import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
22
25
  import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
23
26
  </script>
24
27
  ```
25
28
 
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.
35
-
36
29
  ## Modifying a component
37
30
 
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):
31
+ Import from the packages by default. Only when a component must diverge, pull
32
+ its editable source from the registry (the component's `source` URL in the
33
+ manifest):
40
34
 
41
35
  ```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
36
+ npx shadcn-svelte@latest add <component source URL>
44
37
  ```
45
38
 
46
- The source lands under `$lib/components/ui/` — import the modified copy from
47
- there and keep importing everything else from the packages.
48
-
49
- ## Tokens
50
-
51
- Prefer semantic tokens for themed colors:
52
-
53
- - `bg-background`, `text-foreground`, `border-border`
54
- - `bg-primary`, `text-primary-foreground`
55
- - `bg-muted`, `text-muted-foreground`
56
- - `bg-card`, `bg-popover`, `bg-accent`, `bg-destructive`
57
- - `bg-atai-neutral`, `text-atai-good`, `text-atai-warning`, `text-atai-critical`
58
- - etc.
59
-
60
- Standard Tailwind is fine for:
39
+ The source lands under `$lib/components/ui/<name>/` — import the modified copy
40
+ from there and keep everything else on package imports. Never edit files in
41
+ `node_modules`.
61
42
 
62
- - Spacing/sizing: `p-4`, `w-full`, `gap-2`, `h-screen`
63
- - Layout: `flex`, `grid`, `absolute`, `relative`
64
-
65
- ## CSS Import Order (order-critical)
43
+ ## CSS wiring (order-critical)
66
44
 
67
45
  ```css
68
46
  @import 'tailwindcss';
@@ -73,42 +51,122 @@ Standard Tailwind is fine for:
73
51
  @source '../../node_modules/@archetypeai/ds-ui-svelte-labs/dist';
74
52
  ```
75
53
 
76
- The `@source` directives make Tailwind emit the classes used inside the package
54
+ The `@source` directives make Tailwind emit classes used inside the package
77
55
  dists — removing them silently unstyles the components.
78
56
 
79
- ## Component Patterns
57
+ ## Tokens
58
+
59
+ Use semantic tokens for anything themed; standard Tailwind for layout.
60
+
61
+ - Surfaces/text: `bg-background`, `text-foreground`, `bg-card`, `bg-muted`,
62
+ `text-muted-foreground`, `border-border`, `bg-accent`, `bg-primary`,
63
+ `text-primary-foreground`, `bg-destructive`
64
+ - Status: `text-atai-good`, `text-atai-warning`, `text-atai-critical`,
65
+ `text-atai-neutral` (pair with matching `border-*` on status badges)
66
+ - Brand: `bg-atai-brand-babyblue`, `bg-atai-brand-yellow`,
67
+ `text-atai-always-black`, `text-atai-always-white`
68
+ - Icon strokes on lucide icons: `stroke-icon-default`,
69
+ `stroke-icon-interactive`, `stroke-icon-status`, `stroke-icon-emphasis`
70
+ - Spacing scale: `xs sm md lg xl` work as `p-lg`, `gap-md`, `space-y-xl`, `mb-sm`
71
+ - Chart series colors: `var(--chart-1)` … `var(--chart-5)`
72
+ - Radius on interactive elements: `rounded-interactive`
73
+
74
+ Standard Tailwind is fine for spacing/sizing (`p-4`, `w-full`, `gap-2`) and
75
+ layout (`flex`, `grid`, `absolute`). Status colors communicate state — never
76
+ use them decoratively.
77
+
78
+ ## Typography
79
+
80
+ Default to sans for all text. `font-mono` is reserved for exactly two cases:
81
+
82
+ - Primitives that already use it in the design system source of truth (their
83
+ built-in styles or `typography="mono"` variants) — don't add mono to others
84
+ - Values that would cause layout shift as they update, and ids — numbers,
85
+ timestamps, session/job ids
86
+
87
+ Everything else — body copy, descriptions, headings, buttons without a mono
88
+ variant — stays sans. Never apply mono decoratively.
89
+
90
+ ## API keys and endpoints
91
+
92
+ When a demo needs an API key, never read it from `.env` — add an `Input` to
93
+ the `Menubar` (children slot) so the user pastes the key at runtime; hold it
94
+ in `$state` and pass it to API calls. Endpoints/base URLs do come from `.env`.
80
95
 
81
- - **Props**: `let { class: className, ref = $bindable(null), children, ...restProps } = $props();`
82
- - **Classes**: `cn()` from `$lib/utils.js` (re-export of console's helper) - never raw concatenation
83
- - **Variants**: `tailwind-variants` (tv) for component variants
84
- - **Slots**: `{@render children?.()}`
96
+ ## Dark mode
85
97
 
86
- ## Pinned dependency
98
+ `.dark` class on `<html>` switches every token. Use the controller from the
99
+ console package — don't write your own:
87
100
 
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.
101
+ ```svelte
102
+ import { darkMode } from '@archetypeai/ds-ui-svelte-console/primitives/theme';
103
+
104
+ darkMode.set(window.matchMedia('(prefers-color-scheme: dark)').matches); // init
105
+ darkMode.toggle(); // switch
106
+ darkMode.current; // reactive read
107
+ ```
108
+
109
+ Gotcha: `CodeBlock` highlights once on mount — wrap it in
110
+ `{#key darkMode.current}` so it re-highlights on theme flips.
111
+
112
+ ## Page shell
113
+
114
+ Dashboards are full-viewport: branded `Menubar` (labs) on top with action
115
+ buttons as children, content in a padded `main`:
116
+
117
+ ```svelte
118
+ <div class="bg-background flex h-screen flex-col">
119
+ <Menubar>
120
+ <Button variant="link" class="text-muted-foreground no-underline hover:underline">Action</Button>
121
+ </Menubar>
122
+ <main class="min-h-0 flex-1 p-lg">…panels…</main>
123
+ </div>
124
+ ```
125
+
126
+ Mount `<Toaster />` (sonner) once at the root; fire `toast.success(...)` /
127
+ `toast.error(...)` anywhere.
90
128
 
91
- ## Skills
129
+ ## Charts
130
+
131
+ - Time series → `SensorChart`; embeddings/clusters → `ScatterChart` (see their
132
+ `usage` in the manifest, incl. streaming via `maxPoints`)
133
+ - Custom charts: wrap layerchart in `Chart.Container` with a
134
+ `config` mapping data keys to `{ label, color: 'var(--chart-N)' }`
135
+ - `layerchart` is pinned to an exact prerelease — never loosen or bump it
136
+
137
+ ## Custom components
138
+
139
+ Compose project-specific components from package primitives in
140
+ `$lib/components/ui/custom/`. Follow the package conventions:
141
+
142
+ ```svelte
143
+ <script lang="ts">
144
+ import { cn } from '$lib/utils.js';
145
+ let { class: className, ref = $bindable(null), children, ...restProps } = $props();
146
+ </script>
147
+
148
+ <div bind:this={ref} class={cn('bg-card p-lg', className)} {...restProps}>
149
+ {@render children?.()}
150
+ </div>
151
+ ```
92
152
 
93
- Read these when relevant to your task:
153
+ - `cn()` comes from `$lib/utils.js` (re-export of the console helper) — never
154
+ create a local clsx/tailwind-merge copy, never concatenate class strings
155
+ - Keep API/streaming logic (fetch, SSE, polling) in `src/lib/api/*`, not in
156
+ components
94
157
 
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
98
- - `@skills/create-dashboard` - scaffold a full-viewport dashboard with menubar and panels
99
- - `@skills/fix-accessibility` - audit and fix a11y issues
100
- - `@skills/fix-metadata` - update page titles, favicons, and OG tags
101
- - `@skills/deploy-worker` - deploy SvelteKit projects to Cloudflare Workers
158
+ ## Accessibility
102
159
 
103
- ## Rules
160
+ - `aria-label` on every icon-only control (buttons, switches, sliders, toggles)
161
+ - `aria-hidden="true"` on decorative icons; `sr-only` for visually hidden text
162
+ - Don't remove focus rings; components ship correct focus states
104
163
 
105
- See `@rules/` for comprehensive guidance on design principles, components, styling, charts, and linting.
164
+ ## Hard rules
106
165
 
107
- - `@rules/accessibility` a11y guidelines and ARIA patterns
108
- - `@rules/charts` — chart setup, layerchart conventions, data visualization
109
- - `@rules/components` component API patterns, props, variants, slots
110
- - `@rules/design-principles` visual design language, spacing, typography
111
- - `@rules/frontend-architecture` component decomposition, page composition, API logic extraction
112
- - `@rules/linting` linting and formatting rules
113
- - `@rules/state` state management with Svelte 5 runes
114
- - `@rules/styling` — Tailwind v4, semantic tokens, theming
166
+ - Never edit `node_modules`; never copy package source by hand — eject via the
167
+ registry instead
168
+ - Variant values named after console-product screens (`runSession`, `topNav*`,
169
+ `sideBarSelection`, `lensTray*`, `backToDashboard`) exist in the package
170
+ types but are internal to the Archetype AI console product — never use them
171
+ - Keep the `@source` directives and the CSS import order exactly as above
172
+ - `layerchart` stays pinned exactly