@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/files/rules/charts.md
CHANGED
|
@@ -21,7 +21,7 @@ Wrap all charts in Chart.Container with a config prop:
|
|
|
21
21
|
|
|
22
22
|
```svelte
|
|
23
23
|
<script>
|
|
24
|
-
import * as Chart from '
|
|
24
|
+
import * as Chart from '@archetypeai/ds-ui-svelte-labs/primitives/chart';
|
|
25
25
|
|
|
26
26
|
const chartConfig = {
|
|
27
27
|
temperature: { label: 'Temperature', color: 'var(--chart-1)' },
|
|
@@ -253,4 +253,4 @@ Manual legend below chart:
|
|
|
253
253
|
{/if}
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
For a complete chart
|
|
256
|
+
For a complete chart example, see the `sensor-chart` component (import from `@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart`; editable source at https://design-system-labs.archetypeai.workers.dev/r/sensor-chart.json).
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
paths:
|
|
3
3
|
- '**/components/**/*.svelte'
|
|
4
4
|
- '$lib/**/*.svelte'
|
|
5
|
-
- '**/
|
|
6
|
-
- '**/patterns/**/*.svelte'
|
|
5
|
+
- '**/custom/**/*.svelte'
|
|
7
6
|
---
|
|
8
7
|
|
|
9
8
|
# Component Authoring Rules
|
|
@@ -75,7 +74,7 @@ When wrapping bits-ui primitives, import the primitive and wrap it:
|
|
|
75
74
|
</SelectPrimitive.Trigger>
|
|
76
75
|
```
|
|
77
76
|
|
|
78
|
-
For the full
|
|
77
|
+
For the full component catalog with import paths, read `ds-manifest.json` at the project root (see `@skills/build-component`).
|
|
79
78
|
|
|
80
79
|
## tailwind-variants (tv)
|
|
81
80
|
|
|
@@ -21,26 +21,25 @@ Common extraction candidates: media inputs, status displays, result/summary view
|
|
|
21
21
|
|
|
22
22
|
## Gold-standard references
|
|
23
23
|
|
|
24
|
-
The
|
|
24
|
+
The labs package ships composite components that demonstrate these conventions. Study their source (registry URLs in `ds-manifest.json`) before building new ones:
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- `$lib/components/ui/patterns/healthscore-card/healthscore-card.svelte` — score card with derived state, composes Card sub-components
|
|
30
|
-
- `$lib/components/ui/patterns/menubar/menubar.svelte` — branded header with snippet slots
|
|
26
|
+
- `video-player` (labs) — media playback with controls, composes console Card + Button with labs AspectRatio + Slider
|
|
27
|
+
- `menubar` (labs) — branded header with snippet slots, composes console Button + the theme `darkMode` store
|
|
28
|
+
- `sensor-chart` / `scatter-chart` (labs) — chart cards with typed data/axis config
|
|
31
29
|
|
|
32
|
-
Check
|
|
30
|
+
Check `ds-manifest.json` for an existing component that fits before building a new one. Use `@skills/build-component` to create new components that follow these same conventions.
|
|
33
31
|
|
|
34
32
|
## Directory structure
|
|
35
33
|
|
|
34
|
+
Components come from the npm packages by default — most projects need no local copies at all.
|
|
35
|
+
|
|
36
36
|
```
|
|
37
37
|
$lib/components/ui/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
custom/ — Project-specific components not from the registry
|
|
38
|
+
custom/ — project-specific components composed from the packages
|
|
39
|
+
<name>/ — registry-installed editable source (only for deliberately modified components)
|
|
41
40
|
```
|
|
42
41
|
|
|
43
|
-
Place custom components (ones you create for this project
|
|
42
|
+
Place custom components (ones you create for this project) in `$lib/components/ui/custom/`. Never edit anything in `node_modules`, and never put custom components next to registry-installed source.
|
|
44
43
|
|
|
45
44
|
## Component conventions
|
|
46
45
|
|
|
@@ -50,7 +49,7 @@ Follow `@rules/components` for the full conventions. The essentials:
|
|
|
50
49
|
- `cn()` for all class merging — never raw string concatenation
|
|
51
50
|
- `$derived` for computed state
|
|
52
51
|
- Spread `...restProps` on the root element
|
|
53
|
-
- Compose from DS
|
|
52
|
+
- Compose from DS package components (Card, Badge, Button, etc.) — not raw HTML
|
|
54
53
|
|
|
55
54
|
## Page-level orchestration
|
|
56
55
|
|
|
@@ -80,7 +79,7 @@ For skills that stream results (SSE, polling), prefer:
|
|
|
80
79
|
|
|
81
80
|
- Progressive rendering — show results as they arrive, don't wait for completion
|
|
82
81
|
- Live counters or progress indicators
|
|
83
|
-
- Auto-scrolling log views
|
|
82
|
+
- Auto-scrolling log views
|
|
84
83
|
|
|
85
84
|
## Override clause
|
|
86
85
|
|
package/files/rules/styling.md
CHANGED
|
@@ -82,23 +82,15 @@ For class merging with `cn()`, see `@rules/components`.
|
|
|
82
82
|
In your global CSS file:
|
|
83
83
|
|
|
84
84
|
```css
|
|
85
|
+
@import 'tailwindcss';
|
|
86
|
+
@import 'tw-animate-css';
|
|
85
87
|
@import '@archetypeai/ds-lib-tokens/fonts.css';
|
|
86
88
|
@import '@archetypeai/ds-lib-tokens/theme.css';
|
|
87
|
-
@
|
|
88
|
-
@
|
|
89
|
+
@source '../../node_modules/@archetypeai/ds-ui-svelte-console/dist';
|
|
90
|
+
@source '../../node_modules/@archetypeai/ds-ui-svelte-labs/dist';
|
|
89
91
|
```
|
|
90
92
|
|
|
91
|
-
Order matters
|
|
92
|
-
|
|
93
|
-
### Hide Scrollbars
|
|
94
|
-
|
|
95
|
-
Always add this rule to the root layout CSS (`src/app.css` or `src/routes/layout.css`) to hide visible scrollbars in ScrollArea components:
|
|
96
|
-
|
|
97
|
-
```css
|
|
98
|
-
[data-slot='scroll-area-scrollbar'] {
|
|
99
|
-
display: none !important;
|
|
100
|
-
}
|
|
101
|
-
```
|
|
93
|
+
Order matters — `tailwindcss` first, then the tokens theme, then the package `@source` directives (they make Tailwind emit classes used inside the package dists).
|
|
102
94
|
|
|
103
95
|
## Tailwind v4 Specifics
|
|
104
96
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: apply-ds
|
|
3
|
-
description: Apply DS tokens
|
|
3
|
+
description: Apply DS tokens and components to an existing demo initialized with ds-cli init.
|
|
4
4
|
allowed-tools: Read, Edit, Grep, Bash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Applying the Design System to a Demo
|
|
8
8
|
|
|
9
|
-
This skill assumes `npx @archetypeai/ds-cli init` has already been run. The project has tokens, Tailwind v4,
|
|
9
|
+
This skill assumes `npx @archetypeai/ds-cli init` has already been run. The project has tokens, Tailwind v4, and both design system packages (`@archetypeai/ds-ui-svelte-console`, `@archetypeai/ds-ui-svelte-labs`) installed. The goal is to migrate the demo's existing UI to use DS components and semantic tokens. Read `ds-manifest.json` at the project root for the full component catalog.
|
|
10
10
|
|
|
11
11
|
## Steps
|
|
12
12
|
|
|
@@ -68,15 +68,15 @@ Swap native HTML elements for their DS component equivalents. Add imports as nee
|
|
|
68
68
|
|
|
69
69
|
| Native Element | DS Component | Import From |
|
|
70
70
|
| --- | --- | --- |
|
|
71
|
-
| `<button>` | `<Button>` |
|
|
72
|
-
| `<input>` | `<Input>` |
|
|
73
|
-
| `<textarea>` | `<Textarea>` |
|
|
74
|
-
| `<select>` | `<Select.Root>` + `<Select.Trigger>` + `<Select.Content>` + `<Select.Item>` |
|
|
75
|
-
| `<table>` | `<Table.Root>` + `<Table.Header>` + `<Table.Row>` + `<Table.Head>` + `<Table.Body>` + `<Table.Cell>` |
|
|
76
|
-
| `<dialog>` | `<Dialog.Root>` + `<Dialog.Content>` + `<Dialog.Header>` + `<Dialog.Title>` |
|
|
77
|
-
| `<hr>` | `<Separator>` |
|
|
78
|
-
| `<label>` | `<Label>` |
|
|
79
|
-
| `<a>` (styled as button) | `<Button variant="link">` or `<Button>` with `href` |
|
|
71
|
+
| `<button>` | `<Button>` | `@archetypeai/ds-ui-svelte-console/primitives/button` |
|
|
72
|
+
| `<input>` | `<Input>` | `@archetypeai/ds-ui-svelte-console/primitives/input` |
|
|
73
|
+
| `<textarea>` | `<Textarea>` | `@archetypeai/ds-ui-svelte-console/primitives/textarea` |
|
|
74
|
+
| `<select>` | `<Select.Root>` + `<Select.Trigger>` + `<Select.Content>` + `<Select.Item>` | `@archetypeai/ds-ui-svelte-console/primitives/select` |
|
|
75
|
+
| `<table>` | `<Table.Root>` + `<Table.Header>` + `<Table.Row>` + `<Table.Head>` + `<Table.Body>` + `<Table.Cell>` | `@archetypeai/ds-ui-svelte-console/primitives/table` |
|
|
76
|
+
| `<dialog>` | `<Dialog.Root>` + `<Dialog.Content>` + `<Dialog.Header>` + `<Dialog.Title>` | `@archetypeai/ds-ui-svelte-console/primitives/dialog` |
|
|
77
|
+
| `<hr>` | `<Separator>` | `@archetypeai/ds-ui-svelte-console/primitives/separator` |
|
|
78
|
+
| `<label>` | `<Label>` | `@archetypeai/ds-ui-svelte-console/primitives/label` |
|
|
79
|
+
| `<a>` (styled as button) | `<Button variant="link">` or `<Button>` with `href` | `@archetypeai/ds-ui-svelte-console/primitives/button` |
|
|
80
80
|
|
|
81
81
|
For each replacement:
|
|
82
82
|
|
|
@@ -92,11 +92,11 @@ Identify structural opportunities to use DS composition patterns:
|
|
|
92
92
|
- **Cards** — wrap content sections in `<Card.Root>` / `<Card.Header>` / `<Card.Content>` instead of raw `<div>` with border/shadow classes
|
|
93
93
|
- **Separators** — replace `<hr>` or border-bottom hacks with `<Separator>`
|
|
94
94
|
- **Badges** — replace styled `<span>` status indicators with `<Badge>`
|
|
95
|
-
- **
|
|
96
|
-
- **
|
|
95
|
+
- **Spinners** — replace loading placeholders with `<Spinner>`
|
|
96
|
+
- **Empty states** — replace ad-hoc "no data" markup with `<EmptyState>`
|
|
97
97
|
- **Tooltips** — replace `title` attributes with `<Tooltip.Root>` / `<Tooltip.Trigger>` / `<Tooltip.Content>`
|
|
98
98
|
|
|
99
|
-
Import
|
|
99
|
+
Import console components from `@archetypeai/ds-ui-svelte-console/primitives/<name>` and labs components (menubar, charts, slider, switch, ...) from `@archetypeai/ds-ui-svelte-labs/primitives/<name>` — see `ds-manifest.json` for the catalog.
|
|
100
100
|
|
|
101
101
|
## Step 5: Lint and Format
|
|
102
102
|
|
|
@@ -114,7 +114,7 @@ Confirm the design system is properly applied:
|
|
|
114
114
|
|
|
115
115
|
- [ ] No raw Tailwind color utilities in `.svelte` files (re-run the audit script)
|
|
116
116
|
- [ ] Native elements replaced with DS components where appropriate
|
|
117
|
-
- [ ]
|
|
117
|
+
- [ ] Component imports resolve to the design system packages (`@archetypeai/ds-ui-svelte-console`, `@archetypeai/ds-ui-svelte-labs`) — or `$lib/components/ui/` only for deliberately modified registry source
|
|
118
118
|
- [ ] `cn()` used for class merging — no string concatenation
|
|
119
119
|
- [ ] Linting passes: `npm run lint && npm run format:check`
|
|
120
120
|
- [ ] App builds without errors: `npm run build`
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-component
|
|
3
|
+
description: Creates composite UI components by assembling design system package primitives. Use when building reusable components that combine multiple primitives (Card, Button, Input, etc.), creating dashboard widgets, form groups, sensor cards, data displays, or any complex component from existing design system components. Also use when the user asks to create a "component", "widget", or "pattern" that should follow design system conventions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Building Components
|
|
7
|
+
|
|
8
|
+
Custom components are composed from the design system packages and live in
|
|
9
|
+
`$lib/components/ui/custom/` — never next to registry-installed source and never
|
|
10
|
+
inside `node_modules`.
|
|
11
|
+
|
|
12
|
+
## Decision: compose vs extend vs modify
|
|
13
|
+
|
|
14
|
+
**Before building, read `ds-manifest.json` at the project root.** It lists every
|
|
15
|
+
component in both tiers (console = stable base, labs = experimental) with import
|
|
16
|
+
subpaths, variant axes, and registry source URLs. If an existing component
|
|
17
|
+
covers the use case — even partially — use it rather than creating a new one.
|
|
18
|
+
|
|
19
|
+
**Compose a custom component when:**
|
|
20
|
+
|
|
21
|
+
- Combining 3+ package components into a reusable unit
|
|
22
|
+
- The combination will be used in multiple places
|
|
23
|
+
- The component has its own props/state logic
|
|
24
|
+
|
|
25
|
+
**Use variants instead when:**
|
|
26
|
+
|
|
27
|
+
- The design space is already covered by a component's variant axes (check the
|
|
28
|
+
manifest's `variants` entry before adding wrappers)
|
|
29
|
+
|
|
30
|
+
**Modify via the registry only when:**
|
|
31
|
+
|
|
32
|
+
- A component's internals must diverge from the package. Install its editable
|
|
33
|
+
source (`npx shadcn-svelte@latest add <source URL from ds-manifest.json>`) and
|
|
34
|
+
import the copy from `$lib/components/ui/`.
|
|
35
|
+
|
|
36
|
+
## Component Structure
|
|
37
|
+
|
|
38
|
+
```svelte
|
|
39
|
+
<script>
|
|
40
|
+
import { cn } from '$lib/utils.js';
|
|
41
|
+
import * as Card from '@archetypeai/ds-ui-svelte-console/primitives/card';
|
|
42
|
+
import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
|
|
43
|
+
|
|
44
|
+
let { title, class: className, children, ...restProps } = $props();
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<Card.Root class={cn('p-4', className)} {...restProps}>
|
|
48
|
+
<Card.Header>
|
|
49
|
+
<Card.Title>{title}</Card.Title>
|
|
50
|
+
</Card.Header>
|
|
51
|
+
<Card.Content>
|
|
52
|
+
{@render children?.()}
|
|
53
|
+
</Card.Content>
|
|
54
|
+
</Card.Root>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Key Conventions
|
|
58
|
+
|
|
59
|
+
### Props Pattern
|
|
60
|
+
|
|
61
|
+
Always use this structure:
|
|
62
|
+
|
|
63
|
+
```javascript
|
|
64
|
+
let {
|
|
65
|
+
ref = $bindable(null), // optional DOM reference
|
|
66
|
+
class: className, // rename to avoid reserved word
|
|
67
|
+
children, // snippet for slot content
|
|
68
|
+
...restProps // pass-through attributes
|
|
69
|
+
} = $props();
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Class Merging
|
|
73
|
+
|
|
74
|
+
Always use `cn()` for classes:
|
|
75
|
+
|
|
76
|
+
```svelte
|
|
77
|
+
<div class={cn('bg-card p-4', className)}>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Never concatenate strings directly.
|
|
81
|
+
|
|
82
|
+
### Spreading restProps
|
|
83
|
+
|
|
84
|
+
Always spread on the root element:
|
|
85
|
+
|
|
86
|
+
```svelte
|
|
87
|
+
<Card.Root class={cn('p-4', className)} {...restProps}>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
This ensures aria attributes, data attributes, and event handlers pass through.
|
|
91
|
+
|
|
92
|
+
### Rendering Children
|
|
93
|
+
|
|
94
|
+
Use `{@render}` for slot content:
|
|
95
|
+
|
|
96
|
+
```svelte
|
|
97
|
+
{@render children?.()}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Available Components
|
|
101
|
+
|
|
102
|
+
Do not rely on a memorized catalog — read `ds-manifest.json` for the current
|
|
103
|
+
component list. The shape per tier:
|
|
104
|
+
|
|
105
|
+
- **console** (`@archetypeai/ds-ui-svelte-console/primitives/<name>`): stable
|
|
106
|
+
base primitives — alert, badge, button, card, checkbox, codeblock,
|
|
107
|
+
collapsible, dialog, dropdown-menu, dropzone, empty-state, input, input-group,
|
|
108
|
+
item, label, progress, select, separator, sonner, spinner, table, tabs, theme,
|
|
109
|
+
textarea, tooltip
|
|
110
|
+
- **labs** (`@archetypeai/ds-ui-svelte-labs/primitives/<name>`): experimental
|
|
111
|
+
components — aspect-ratio, chart, kbd, logo, menubar, scatter-chart,
|
|
112
|
+
sensor-chart, slider, switch, toggle, video-player
|
|
113
|
+
|
|
114
|
+
The manifest is generated from the registries; trust it over this list if they
|
|
115
|
+
disagree. Variant values flagged `consoleProductOnly` (e.g. `runSession`,
|
|
116
|
+
`topNav*`) must not be used outside the console product.
|
|
117
|
+
|
|
118
|
+
## Example: Sensor Card Component
|
|
119
|
+
|
|
120
|
+
```svelte
|
|
121
|
+
<script>
|
|
122
|
+
import { cn } from '$lib/utils.js';
|
|
123
|
+
import * as Card from '@archetypeai/ds-ui-svelte-console/primitives/card';
|
|
124
|
+
import * as Chart from '@archetypeai/ds-ui-svelte-labs/primitives/chart';
|
|
125
|
+
|
|
126
|
+
let { title = 'Sensor', icon: Icon, data = [], class: className, ...restProps } = $props();
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<Card.Root class={cn('p-4', className)} {...restProps}>
|
|
130
|
+
<Card.Header class="flex flex-row items-center justify-between p-0">
|
|
131
|
+
<Card.Title class="text-foreground font-mono text-base uppercase">
|
|
132
|
+
{title}
|
|
133
|
+
</Card.Title>
|
|
134
|
+
{#if Icon}
|
|
135
|
+
<Icon class="text-muted-foreground size-6" aria-hidden="true" />
|
|
136
|
+
{/if}
|
|
137
|
+
</Card.Header>
|
|
138
|
+
<Card.Content class="p-0">
|
|
139
|
+
<Chart.Container config={{}} class="h-[220px] w-full">
|
|
140
|
+
<!-- chart content -->
|
|
141
|
+
</Chart.Container>
|
|
142
|
+
</Card.Content>
|
|
143
|
+
</Card.Root>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Detailed Conventions
|
|
147
|
+
|
|
148
|
+
See `@rules/components.md` for:
|
|
149
|
+
|
|
150
|
+
- bits-ui wrapper patterns
|
|
151
|
+
- tailwind-variants (tv) usage
|
|
152
|
+
- Conditional rendering patterns
|
|
153
|
+
- Icon handling
|
|
@@ -13,9 +13,9 @@ Scaffold a full-viewport dashboard with a branded menubar and panel-based conten
|
|
|
13
13
|
|
|
14
14
|
Before building, check which components are installed in the project:
|
|
15
15
|
|
|
16
|
-
1.
|
|
17
|
-
2.
|
|
18
|
-
3. If a required component
|
|
16
|
+
1. Read `ds-manifest.json` at the project root — it lists every component in both packages (console + labs) with import subpaths and variant axes
|
|
17
|
+
2. Components come from the npm packages (`@archetypeai/ds-ui-svelte-console`, `@archetypeai/ds-ui-svelte-labs`); also check `$lib/components/ui/` for registry-installed (modified) copies and prefer those when present
|
|
18
|
+
3. If a required component does not exist in either tier, build it via `@skills/build-component`
|
|
19
19
|
4. **Never inline raw markup as a substitute for a missing component**
|
|
20
20
|
|
|
21
21
|
The dashboard requires at minimum: `Menubar`, `Button`. For card-based layouts: `Card`.
|
|
@@ -38,14 +38,14 @@ Unless the user explicitly asks for a different layout:
|
|
|
38
38
|
|
|
39
39
|
## Menubar
|
|
40
40
|
|
|
41
|
-
Use the `Menubar`
|
|
41
|
+
Use the labs `Menubar` component. It renders a branded `<header>` with the Archetype AI Logo on the left. Pass action content as children. The Menubar includes a built-in dark mode toggle on the far right that toggles the host app's dark class (via the console `darkMode` store). To disable it, pass `darkToggle={false}`.
|
|
42
42
|
|
|
43
43
|
**Every dashboard Menubar must include a "Send Report" button.** Additional actions can be appended alongside it.
|
|
44
44
|
|
|
45
45
|
```svelte
|
|
46
46
|
<script>
|
|
47
|
-
import Menubar from '
|
|
48
|
-
import { Button } from '
|
|
47
|
+
import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
|
|
48
|
+
import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<Menubar>
|
|
@@ -54,7 +54,7 @@ Use the `Menubar` pattern. It renders a branded `<header>` with the Archetype AI
|
|
|
54
54
|
</Menubar>
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
For co-branding, pass a `partnerLogo` snippet to
|
|
57
|
+
For co-branding, pass a `partnerLogo` snippet to add a separator and partner logo beside the Archetype AI Logo:
|
|
58
58
|
|
|
59
59
|
```svelte
|
|
60
60
|
<Menubar>
|
|
@@ -68,8 +68,8 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
|
|
|
68
68
|
|
|
69
69
|
## Preservation Rules
|
|
70
70
|
|
|
71
|
-
- **Never
|
|
72
|
-
- **Never
|
|
71
|
+
- **Never edit design system files in `node_modules`** — compose and override via props/`class`
|
|
72
|
+
- **Never rewrite or replace** registry-installed component source in `$lib/components/ui/` unless the user asked you to modify that component
|
|
73
73
|
- When a Menubar already has children (buttons, actions), **append** new actions alongside existing ones — do not replace them
|
|
74
74
|
- When a page already has content, **integrate alongside** existing markup — do not overwrite the file
|
|
75
75
|
|
|
@@ -77,8 +77,8 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
|
|
|
77
77
|
|
|
78
78
|
```svelte
|
|
79
79
|
<script>
|
|
80
|
-
import Menubar from '
|
|
81
|
-
import { Button } from '
|
|
80
|
+
import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
|
|
81
|
+
import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
|
|
82
82
|
</script>
|
|
83
83
|
|
|
84
84
|
<div class="bg-background grid h-screen w-screen grid-rows-[auto_1fr] overflow-hidden">
|
|
@@ -169,9 +169,9 @@ The `flex-1` on the last left-column card makes it grow to fill remaining vertic
|
|
|
169
169
|
```svelte
|
|
170
170
|
<!-- src/routes/+page.svelte -->
|
|
171
171
|
<script>
|
|
172
|
-
import Menubar from '
|
|
173
|
-
import { Button } from '
|
|
174
|
-
import { Card, CardHeader, CardTitle, CardContent } from '
|
|
172
|
+
import Menubar from '@archetypeai/ds-ui-svelte-labs/primitives/menubar';
|
|
173
|
+
import { Button } from '@archetypeai/ds-ui-svelte-console/primitives/button';
|
|
174
|
+
import { Card, CardHeader, CardTitle, CardContent } from '@archetypeai/ds-ui-svelte-console/primitives/card';
|
|
175
175
|
</script>
|
|
176
176
|
|
|
177
177
|
<div
|
|
@@ -202,12 +202,12 @@ The `flex-1` on the last left-column card makes it grow to fill remaining vertic
|
|
|
202
202
|
</div>
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
## Populating Panels
|
|
205
|
+
## Populating Panels
|
|
206
206
|
|
|
207
|
-
Panels should contain
|
|
207
|
+
Panels should contain components, not raw markup. Before building new components:
|
|
208
208
|
|
|
209
|
-
1.
|
|
210
|
-
2. If no existing
|
|
209
|
+
1. Read `ds-manifest.json` to discover available components in both tiers. Each has a `description` summarizing its purpose. If one fits, use it.
|
|
210
|
+
2. If no existing component fits, create one via `@skills/build-component`
|
|
211
211
|
3. Each panel should contain one primary component with clear props for data flow
|
|
212
212
|
|
|
213
213
|
This keeps dashboards composable and consistent with the design system.
|
|
@@ -7,25 +7,23 @@ description: Sets up data visualizations using layerchart and the Chart primitiv
|
|
|
7
7
|
|
|
8
8
|
Build charts using layerchart wrapped in the Chart.Container primitive.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Where Charts Come From
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
The chart components live in the labs package — import them, do not create chart files by hand:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
```svelte
|
|
15
|
+
<script>
|
|
16
|
+
import * as Chart from '@archetypeai/ds-ui-svelte-labs/primitives/chart';
|
|
17
|
+
import ScatterChart from '@archetypeai/ds-ui-svelte-labs/primitives/scatter-chart';
|
|
18
|
+
import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
|
|
19
|
+
</script>
|
|
20
|
+
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
`ds-manifest.json` at the project root lists the full catalog (both tiers) with import subpaths. For card-wrapped charts compose with `@archetypeai/ds-ui-svelte-console/primitives/card`.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
npx shadcn-svelte@latest add --registry https://design-system.archetypeai.workers.dev/r chart
|
|
26
|
-
```
|
|
24
|
+
Only if a chart must diverge from the package, install its editable source via the registry (URL in the manifest), e.g. `npx shadcn-svelte@latest add https://design-system-labs.archetypeai.workers.dev/r/chart.json`. **NEVER manually create chart primitive files** — the multi-file chart source uses relative imports that break when files are hand-written.
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
`layerchart` is installed at an exact pinned prerelease; newer prereleases break the chart components. Never loosen the pin.
|
|
29
27
|
|
|
30
28
|
## Choosing a Chart Type
|
|
31
29
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Scatter plots for cluster visualizations, embedding data, and 2D point clouds.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
7
|
+
```svelte
|
|
8
|
+
import ScatterChart from '@archetypeai/ds-ui-svelte-labs/primitives/scatter-chart';
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
No install needed — the labs package ships it. Only to modify the component, pull its editable source instead: `npx shadcn-svelte@latest add https://design-system-labs.archetypeai.workers.dev/r/scatter-chart.json` (also installs its chart/utils source dependencies).
|
|
12
12
|
|
|
13
13
|
## Props
|
|
14
14
|
|
|
@@ -75,7 +75,7 @@ The `embedding.csv` contains dimensionality-reduced coordinates. To prepare it f
|
|
|
75
75
|
|
|
76
76
|
```svelte
|
|
77
77
|
<script>
|
|
78
|
-
import ScatterChart from '
|
|
78
|
+
import ScatterChart from '@archetypeai/ds-ui-svelte-labs/primitives/scatter-chart';
|
|
79
79
|
import ScatterChartIcon from '@lucide/svelte/icons/scatter-chart';
|
|
80
80
|
import embeddingCsv from '$lib/data/embedding.csv?raw';
|
|
81
81
|
|
|
@@ -135,7 +135,7 @@ The `embedding.csv` contains dimensionality-reduced coordinates. To prepare it f
|
|
|
135
135
|
```svelte
|
|
136
136
|
<script>
|
|
137
137
|
import { onMount, onDestroy } from 'svelte';
|
|
138
|
-
import ScatterChart from '
|
|
138
|
+
import ScatterChart from '@archetypeai/ds-ui-svelte-labs/primitives/scatter-chart';
|
|
139
139
|
import ScatterChartIcon from '@lucide/svelte/icons/scatter-chart';
|
|
140
140
|
|
|
141
141
|
let streamData = $state([]);
|
|
@@ -179,13 +179,13 @@ The `embedding.csv` contains dimensionality-reduced coordinates. To prepare it f
|
|
|
179
179
|
/>
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
## Building Inline (
|
|
182
|
+
## Building Inline (custom variant)
|
|
183
183
|
|
|
184
|
-
If
|
|
184
|
+
If `scatter-chart` doesn't fit and a custom chart is required, compose the console `card` and labs `chart` components with `ScatterChart` from layerchart:
|
|
185
185
|
|
|
186
186
|
```svelte
|
|
187
187
|
<script>
|
|
188
|
-
import * as Chart from '
|
|
188
|
+
import * as Chart from '@archetypeai/ds-ui-svelte-labs/primitives/chart';
|
|
189
189
|
import { ScatterChart } from 'layerchart';
|
|
190
190
|
import { scaleLinear } from 'd3-scale';
|
|
191
191
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Line charts for time series data, sensor readings, and streaming signals.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
7
|
+
```svelte
|
|
8
|
+
import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
No install needed — the labs package ships it. Only to modify the component, pull its editable source instead: `npx shadcn-svelte@latest add https://design-system-labs.archetypeai.workers.dev/r/sensor-chart.json` (also installs its chart/utils source dependencies).
|
|
12
12
|
|
|
13
13
|
## Props
|
|
14
14
|
|
|
@@ -38,7 +38,7 @@ This installs `SensorChart.svelte` and its dependencies (`card`, `chart`, `utils
|
|
|
38
38
|
|
|
39
39
|
```svelte
|
|
40
40
|
<script>
|
|
41
|
-
import SensorChart from '
|
|
41
|
+
import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
|
|
42
42
|
import AudioWaveformIcon from '@lucide/svelte/icons/audio-waveform';
|
|
43
43
|
import timeseriesCsv from '$lib/data/timeseries.csv?raw';
|
|
44
44
|
|
|
@@ -86,7 +86,7 @@ For real-time data with a sliding window, use the `maxPoints` prop and feed data
|
|
|
86
86
|
```svelte
|
|
87
87
|
<script>
|
|
88
88
|
import { onMount, onDestroy } from 'svelte';
|
|
89
|
-
import SensorChart from '
|
|
89
|
+
import SensorChart from '@archetypeai/ds-ui-svelte-labs/primitives/sensor-chart';
|
|
90
90
|
import ThermometerIcon from '@lucide/svelte/icons/thermometer';
|
|
91
91
|
|
|
92
92
|
let streamingData = $state([]);
|
|
@@ -120,13 +120,13 @@ For real-time data with a sliding window, use the `maxPoints` prop and feed data
|
|
|
120
120
|
/>
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
## Building Inline (
|
|
123
|
+
## Building Inline (custom variant)
|
|
124
124
|
|
|
125
|
-
If
|
|
125
|
+
If `sensor-chart` doesn't fit and a custom chart is required, compose the console `card` and labs `chart` components with `LineChart` from layerchart:
|
|
126
126
|
|
|
127
127
|
```svelte
|
|
128
128
|
<script>
|
|
129
|
-
import * as Chart from '
|
|
129
|
+
import * as Chart from '@archetypeai/ds-ui-svelte-labs/primitives/chart';
|
|
130
130
|
import { LineChart } from 'layerchart';
|
|
131
131
|
import { scaleUtc, scaleLinear } from 'd3-scale';
|
|
132
132
|
import { curveNatural } from 'd3-shape';
|
|
@@ -48,8 +48,9 @@ function copyFile(src, dest) {
|
|
|
48
48
|
export function setupCursor(projectDir) {
|
|
49
49
|
p.log.step('Setting up for Cursor IDE');
|
|
50
50
|
|
|
51
|
-
// copy AGENTS.md to root
|
|
51
|
+
// copy AGENTS.md + machine-readable component manifest to root
|
|
52
52
|
copyFile(join(FILES_DIR, 'AGENTS.md'), join(projectDir, 'AGENTS.md'));
|
|
53
|
+
copyFile(join(FILES_DIR, 'ds-manifest.json'), join(projectDir, 'ds-manifest.json'));
|
|
53
54
|
|
|
54
55
|
// copy skills to .cursor/skills/
|
|
55
56
|
const skillsSrc = join(FILES_DIR, 'skills');
|
|
@@ -73,8 +74,9 @@ export function setupCursor(projectDir) {
|
|
|
73
74
|
export function setupClaude(projectDir) {
|
|
74
75
|
p.log.step('Setting up for Claude Code');
|
|
75
76
|
|
|
76
|
-
// copy CLAUDE.md to root
|
|
77
|
+
// copy CLAUDE.md + machine-readable component manifest to root
|
|
77
78
|
copyFile(join(FILES_DIR, 'CLAUDE.md'), join(projectDir, 'CLAUDE.md'));
|
|
79
|
+
copyFile(join(FILES_DIR, 'ds-manifest.json'), join(projectDir, 'ds-manifest.json'));
|
|
78
80
|
|
|
79
81
|
// copy skills to .claude/skills/
|
|
80
82
|
const skillsSrc = join(FILES_DIR, 'skills');
|