@archetypeai/ds-cli 0.3.15 → 0.3.16
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/files/rules/charts.md +3 -3
- package/files/rules/frontend-architecture.md +5 -5
- package/files/skills/apply-ds/SKILL.md +11 -11
- package/files/skills/build-pattern/SKILL.md +5 -5
- package/files/skills/create-dashboard/SKILL.md +9 -9
- package/files/skills/setup-chart/SKILL.md +1 -1
- package/files/skills/setup-chart/references/scatter-chart.md +3 -3
- package/files/skills/setup-chart/references/sensor-chart.md +3 -3
- package/lib/scaffold-ds-svelte-project.js +1 -1
- package/package.json +1 -1
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 '$lib/components/ui/chart/index.js';
|
|
24
|
+
import * as Chart from '$lib/components/ui/primitives/chart/index.js';
|
|
25
25
|
|
|
26
26
|
const chartConfig = {
|
|
27
27
|
temperature: { label: 'Temperature', color: 'var(--chart-1)' },
|
|
@@ -258,8 +258,8 @@ Manual legend below chart:
|
|
|
258
258
|
```svelte
|
|
259
259
|
<script>
|
|
260
260
|
import { cn } from '$lib/utils.js';
|
|
261
|
-
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/card/index.js';
|
|
262
|
-
import * as Chart from '$lib/components/ui/chart/index.js';
|
|
261
|
+
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/primitives/card/index.js';
|
|
262
|
+
import * as Chart from '$lib/components/ui/primitives/chart/index.js';
|
|
263
263
|
import { LineChart } from 'layerchart';
|
|
264
264
|
import { curveNatural } from 'd3-shape';
|
|
265
265
|
import { scaleUtc, scaleLinear } from 'd3-scale';
|
|
@@ -23,11 +23,11 @@ Common extraction candidates: media inputs, status displays, result/summary view
|
|
|
23
23
|
|
|
24
24
|
The project includes pattern components that demonstrate these conventions. Study them before building new ones:
|
|
25
25
|
|
|
26
|
-
- `$lib/components/ui/
|
|
27
|
-
- `$lib/components/ui/
|
|
28
|
-
- `$lib/components/ui/
|
|
29
|
-
- `$lib/components/ui/
|
|
30
|
-
- `$lib/components/ui/
|
|
26
|
+
- `$lib/components/ui/patterns/video-player/video-player.svelte` — media playback with controls, composes Card + AspectRatio + Button + Slider
|
|
27
|
+
- `$lib/components/ui/patterns/expandable-log/expandable-log.svelte` — streaming log display, composes Collapsible + Item + Badge
|
|
28
|
+
- `$lib/components/ui/patterns/status-badge/status-badge.svelte` — health indicator with derived state, composes Badge + Avatar
|
|
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
|
|
31
31
|
|
|
32
32
|
Check if an existing pattern fits before building a new one. Use `@skills/build-pattern` to create new patterns that follow these same conventions.
|
|
33
33
|
|
|
@@ -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>` | `$lib/components/ui/button` |
|
|
72
|
-
| `<input>` | `<Input>` | `$lib/components/ui/input` |
|
|
73
|
-
| `<textarea>` | `<Textarea>` | `$lib/components/ui/textarea` |
|
|
74
|
-
| `<select>` | `<Select.Root>` + `<Select.Trigger>` + `<Select.Content>` + `<Select.Item>` | `$lib/components/ui/select` |
|
|
75
|
-
| `<table>` | `<Table.Root>` + `<Table.Header>` + `<Table.Row>` + `<Table.Head>` + `<Table.Body>` + `<Table.Cell>` | `$lib/components/ui/table` |
|
|
76
|
-
| `<dialog>` | `<Dialog.Root>` + `<Dialog.Content>` + `<Dialog.Header>` + `<Dialog.Title>` | `$lib/components/ui/dialog` |
|
|
77
|
-
| `<hr>` | `<Separator>` | `$lib/components/ui/separator` |
|
|
78
|
-
| `<label>` | `<Label>` | `$lib/components/ui/label` |
|
|
79
|
-
| `<a>` (styled as button) | `<Button variant="link">` or `<Button>` with `href` | `$lib/components/ui/button` |
|
|
71
|
+
| `<button>` | `<Button>` | `$lib/components/ui/primitives/button` |
|
|
72
|
+
| `<input>` | `<Input>` | `$lib/components/ui/primitives/input` |
|
|
73
|
+
| `<textarea>` | `<Textarea>` | `$lib/components/ui/primitives/textarea` |
|
|
74
|
+
| `<select>` | `<Select.Root>` + `<Select.Trigger>` + `<Select.Content>` + `<Select.Item>` | `$lib/components/ui/primitives/select` |
|
|
75
|
+
| `<table>` | `<Table.Root>` + `<Table.Header>` + `<Table.Row>` + `<Table.Head>` + `<Table.Body>` + `<Table.Cell>` | `$lib/components/ui/primitives/table` |
|
|
76
|
+
| `<dialog>` | `<Dialog.Root>` + `<Dialog.Content>` + `<Dialog.Header>` + `<Dialog.Title>` | `$lib/components/ui/primitives/dialog` |
|
|
77
|
+
| `<hr>` | `<Separator>` | `$lib/components/ui/primitives/separator` |
|
|
78
|
+
| `<label>` | `<Label>` | `$lib/components/ui/primitives/label` |
|
|
79
|
+
| `<a>` (styled as button) | `<Button variant="link">` or `<Button>` with `href` | `$lib/components/ui/primitives/button` |
|
|
80
80
|
|
|
81
81
|
For each replacement:
|
|
82
82
|
|
|
@@ -96,7 +96,7 @@ Identify structural opportunities to use DS composition patterns:
|
|
|
96
96
|
- **Scroll Area** — replace overflow containers with `<ScrollArea>`
|
|
97
97
|
- **Tooltips** — replace `title` attributes with `<Tooltip.Root>` / `<Tooltip.Trigger>` / `<Tooltip.Content>`
|
|
98
98
|
|
|
99
|
-
Import patterns from `$lib/components/ui/` as needed.
|
|
99
|
+
Import primitives from `$lib/components/ui/primitives/` and patterns from `$lib/components/ui/patterns/` as needed.
|
|
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
|
-
- [ ] All component imports resolve to `$lib/components/ui/`
|
|
117
|
+
- [ ] All component imports resolve to `$lib/components/ui/primitives/` or `$lib/components/ui/patterns/`
|
|
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`
|
|
@@ -25,8 +25,8 @@ Patterns are composite components assembled from design system primitives.
|
|
|
25
25
|
```svelte
|
|
26
26
|
<script>
|
|
27
27
|
import { cn } from '$lib/utils.js';
|
|
28
|
-
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/card/index.js';
|
|
29
|
-
import { Button } from '$lib/components/ui/button/index.js';
|
|
28
|
+
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/primitives/card/index.js';
|
|
29
|
+
import { Button } from '$lib/components/ui/primitives/button/index.js';
|
|
30
30
|
|
|
31
31
|
let { title, class: className, children, ...restProps } = $props();
|
|
32
32
|
</script>
|
|
@@ -86,7 +86,7 @@ Use `{@render}` for slot content:
|
|
|
86
86
|
|
|
87
87
|
## Available Primitives
|
|
88
88
|
|
|
89
|
-
Import from `$lib/components/ui
|
|
89
|
+
Import primitives from `$lib/components/ui/primitives/` and patterns from `$lib/components/ui/patterns/`. Before building, list these directories to discover all installed components.
|
|
90
90
|
|
|
91
91
|
### Layout & Structure
|
|
92
92
|
|
|
@@ -169,8 +169,8 @@ Import from `$lib/components/ui/`. Before building, list `$lib/components/ui/` t
|
|
|
169
169
|
```svelte
|
|
170
170
|
<script>
|
|
171
171
|
import { cn } from '$lib/utils.js';
|
|
172
|
-
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/card/index.js';
|
|
173
|
-
import * as Chart from '$lib/components/ui/chart/index.js';
|
|
172
|
+
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/primitives/card/index.js';
|
|
173
|
+
import * as Chart from '$lib/components/ui/primitives/chart/index.js';
|
|
174
174
|
|
|
175
175
|
let { title = 'SENSOR', icon: Icon, data = [], class: className, ...restProps } = $props();
|
|
176
176
|
</script>
|
|
@@ -13,7 +13,7 @@ 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. List `$lib/components/ui/` to discover available primitives (
|
|
16
|
+
1. List `$lib/components/ui/primitives/` and `$lib/components/ui/patterns/` to discover available primitives and patterns (each in a kebab-case subdirectory with `index.js`)
|
|
17
17
|
2. Only use components that actually exist in the project
|
|
18
18
|
3. If a required component is missing, ask the user to install it (via `npx shadcn-svelte@latest add`) or build it (via `@skills/build-pattern`)
|
|
19
19
|
4. **Never inline raw markup as a substitute for a missing component**
|
|
@@ -44,8 +44,8 @@ Use the `Menubar` pattern. It renders a branded `<header>` with the Archetype AI
|
|
|
44
44
|
|
|
45
45
|
```svelte
|
|
46
46
|
<script>
|
|
47
|
-
import Menubar from '$lib/components/ui/
|
|
48
|
-
import { Button } from '$lib/components/ui/button/index.js';
|
|
47
|
+
import Menubar from '$lib/components/ui/patterns/menubar/index.js';
|
|
48
|
+
import { Button } from '$lib/components/ui/primitives/button/index.js';
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<Menubar>
|
|
@@ -61,7 +61,7 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
|
|
|
61
61
|
{#snippet partnerLogo()}
|
|
62
62
|
<img src="/partner-logo.svg" alt="Partner" class="h-6" />
|
|
63
63
|
{/snippet}
|
|
64
|
-
<!-- additive example — append to existing children, don't replace them
|
|
64
|
+
<!-- additive example — append to existing children, don't replace them -->
|
|
65
65
|
<Button variant="link" class="text-muted-foreground">Send Report</Button>
|
|
66
66
|
</Menubar>
|
|
67
67
|
```
|
|
@@ -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 '$lib/components/ui/
|
|
81
|
-
import { Button } from '$lib/components/ui/button/index.js';
|
|
80
|
+
import Menubar from '$lib/components/ui/patterns/menubar/index.js';
|
|
81
|
+
import { Button } from '$lib/components/ui/primitives/button/index.js';
|
|
82
82
|
</script>
|
|
83
83
|
|
|
84
84
|
<div class="bg-background grid h-screen w-screen grid-rows-[auto_1fr] overflow-hidden">
|
|
@@ -150,9 +150,9 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
|
|
|
150
150
|
```svelte
|
|
151
151
|
<!-- src/routes/+page.svelte -->
|
|
152
152
|
<script>
|
|
153
|
-
import Menubar from '$lib/components/ui/
|
|
154
|
-
import { Button } from '$lib/components/ui/button/index.js';
|
|
155
|
-
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/card/index.js';
|
|
153
|
+
import Menubar from '$lib/components/ui/patterns/menubar/index.js';
|
|
154
|
+
import { Button } from '$lib/components/ui/primitives/button/index.js';
|
|
155
|
+
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/primitives/card/index.js';
|
|
156
156
|
</script>
|
|
157
157
|
|
|
158
158
|
<div
|
|
@@ -11,7 +11,7 @@ Build charts using layerchart wrapped in the Chart.Container primitive.
|
|
|
11
11
|
|
|
12
12
|
Before building, check which components are installed in the project already:
|
|
13
13
|
|
|
14
|
-
1. List `$lib/components/ui/` to discover available primitives and patterns
|
|
14
|
+
1. List `$lib/components/ui/primitives/` and `$lib/components/ui/patterns/` to discover available primitives and patterns
|
|
15
15
|
2. Only use components that actually exist in the project
|
|
16
16
|
3. Charts require at minimum: `chart`. For card-wrapped charts: `card`, `chart`
|
|
17
17
|
|
|
@@ -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 '$lib/components/ui/
|
|
78
|
+
import ScatterChart from '$lib/components/ui/patterns/scatter-chart/index.js';
|
|
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 '$lib/components/ui/
|
|
138
|
+
import ScatterChart from '$lib/components/ui/patterns/scatter-chart/index.js';
|
|
139
139
|
import ScatterChartIcon from '@lucide/svelte/icons/scatter-chart';
|
|
140
140
|
|
|
141
141
|
let streamData = $state([]);
|
|
@@ -185,7 +185,7 @@ If the `scatter-chart` pattern is not installed, use `card` + `chart` primitives
|
|
|
185
185
|
|
|
186
186
|
```svelte
|
|
187
187
|
<script>
|
|
188
|
-
import * as Chart from '$lib/components/ui/chart/index.js';
|
|
188
|
+
import * as Chart from '$lib/components/ui/primitives/chart/index.js';
|
|
189
189
|
import { ScatterChart } from 'layerchart';
|
|
190
190
|
import { scaleLinear } from 'd3-scale';
|
|
191
191
|
|
|
@@ -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 '$lib/components/ui/
|
|
41
|
+
import SensorChart from '$lib/components/ui/patterns/sensor-chart/index.js';
|
|
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 '$lib/components/ui/
|
|
89
|
+
import SensorChart from '$lib/components/ui/patterns/sensor-chart/index.js';
|
|
90
90
|
import ThermometerIcon from '@lucide/svelte/icons/thermometer';
|
|
91
91
|
|
|
92
92
|
let streamingData = $state([]);
|
|
@@ -126,7 +126,7 @@ If the `sensor-chart` pattern is not installed, build the equivalent using `card
|
|
|
126
126
|
|
|
127
127
|
```svelte
|
|
128
128
|
<script>
|
|
129
|
-
import * as Chart from '$lib/components/ui/chart/index.js';
|
|
129
|
+
import * as Chart from '$lib/components/ui/primitives/chart/index.js';
|
|
130
130
|
import { LineChart } from 'layerchart';
|
|
131
131
|
import { scaleUtc, scaleLinear } from 'd3-scale';
|
|
132
132
|
import { curveNatural } from 'd3-shape';
|
|
@@ -260,7 +260,7 @@ export async function installComponents(pm, projectPath, componentUrls) {
|
|
|
260
260
|
export function createDemoPage(projectPath) {
|
|
261
261
|
const pagePath = join(projectPath, 'src/routes/+page.svelte');
|
|
262
262
|
const demoContent = `<script>
|
|
263
|
-
\timport Button from "$lib/components/ui/button/button.svelte";
|
|
263
|
+
\timport Button from "$lib/components/ui/primitives/button/button.svelte";
|
|
264
264
|
</script>
|
|
265
265
|
|
|
266
266
|
<div class="flex flex-col items-center justify-center min-h-screen space-y-xl">
|