@archetypeai/ds-cli 0.3.16 → 0.3.17
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/AGENTS.md +14 -0
- package/files/CLAUDE.md +13 -1
- package/files/rules/charts.md +1 -97
- package/files/rules/components.md +1 -16
- package/files/rules/design-principles.md +16 -1
- package/files/rules/state.md +2 -34
- package/files/rules/styling.md +14 -119
- package/files/skills/build-pattern/SKILL.md +2 -0
- package/files/skills/create-dashboard/SKILL.md +1 -1
- package/files/skills/embedding-from-file/SKILL.md +14 -1
- package/files/skills/embedding-from-sensor/SKILL.md +14 -1
- package/files/skills/embedding-upload/SKILL.md +14 -1
- package/files/skills/newton-activity-monitor-lens-on-video/SKILL.md +1 -1
- package/files/skills/newton-camera-frame-analysis/SKILL.md +14 -1
- package/files/skills/newton-direct-query/SKILL.md +9 -0
- package/files/skills/newton-machine-state-from-file/SKILL.md +15 -1
- package/files/skills/newton-machine-state-from-sensor/SKILL.md +15 -1
- package/lib/scaffold-ds-svelte-project.js +29 -9
- package/package.json +1 -1
package/files/AGENTS.md
CHANGED
|
@@ -44,8 +44,22 @@ Standard Tailwind is fine for:
|
|
|
44
44
|
- **Variants**: `tailwind-variants` (tv) for component variants
|
|
45
45
|
- **Slots**: `{@render children?.()}`
|
|
46
46
|
|
|
47
|
+
## Pattern Registry
|
|
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. To install a pattern:
|
|
53
|
+
`npx shadcn-svelte@latest add https://design-system.archetypeai.workers.dev/r/{name}.json`
|
|
54
|
+
|
|
47
55
|
## Skills
|
|
48
56
|
|
|
57
|
+
**Skill composition:** When building a demo that uses a Newton or Embedding API skill:
|
|
58
|
+
1. Use `@skills/create-dashboard` for the page layout (dashboard with Menubar)
|
|
59
|
+
2. Fetch `https://design-system.archetypeai.workers.dev/r/patterns.json` and reuse existing patterns before creating new components
|
|
60
|
+
3. Apply `@rules/design-principles` aesthetic conventions (BackgroundCard for single-purpose cards, mono font for headers/numbers)
|
|
61
|
+
4. Only include chart components if the user's request involves time-series or explicitly mentions charts
|
|
62
|
+
|
|
49
63
|
Read these when relevant to your task:
|
|
50
64
|
|
|
51
65
|
- `@skills/apply-ds` - apply DS tokens, components, and patterns to an existing demo
|
package/files/CLAUDE.md
CHANGED
|
@@ -44,9 +44,21 @@ Standard Tailwind is fine for:
|
|
|
44
44
|
- **Variants**: `tailwind-variants` (tv) for component variants
|
|
45
45
|
- **Slots**: `{@render children?.()}`
|
|
46
46
|
|
|
47
|
+
## Pattern Registry
|
|
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. To install a pattern:
|
|
53
|
+
`npx shadcn-svelte@latest add https://design-system.archetypeai.workers.dev/r/{name}.json`
|
|
54
|
+
|
|
47
55
|
## Skills
|
|
48
56
|
|
|
49
|
-
**Skill composition:** When building a demo that uses a Newton or Embedding API skill
|
|
57
|
+
**Skill composition:** When building a demo that uses a Newton or Embedding API skill:
|
|
58
|
+
1. Use `@skills/create-dashboard` for the page layout (dashboard with Menubar)
|
|
59
|
+
2. Fetch `https://design-system.archetypeai.workers.dev/r/patterns.json` and reuse existing patterns before creating new components
|
|
60
|
+
3. Apply `@rules/design-principles` aesthetic conventions (BackgroundCard for single-purpose cards, mono font for headers/numbers)
|
|
61
|
+
4. Only include chart components if the user's request involves time-series or explicitly mentions charts
|
|
50
62
|
|
|
51
63
|
Read these when relevant to your task:
|
|
52
64
|
|
package/files/rules/charts.md
CHANGED
|
@@ -253,100 +253,4 @@ Manual legend below chart:
|
|
|
253
253
|
{/if}
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
```svelte
|
|
259
|
-
<script>
|
|
260
|
-
import { cn } from '$lib/utils.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
|
-
import { LineChart } from 'layerchart';
|
|
264
|
-
import { curveNatural } from 'd3-shape';
|
|
265
|
-
import { scaleUtc, scaleLinear } from 'd3-scale';
|
|
266
|
-
|
|
267
|
-
let {
|
|
268
|
-
title = 'SENSOR',
|
|
269
|
-
icon: Icon = undefined,
|
|
270
|
-
data = [],
|
|
271
|
-
signals = {},
|
|
272
|
-
xKey = 'timestamp',
|
|
273
|
-
maxPoints = undefined,
|
|
274
|
-
yMin,
|
|
275
|
-
yMax,
|
|
276
|
-
yTicks,
|
|
277
|
-
class: className,
|
|
278
|
-
...restProps
|
|
279
|
-
} = $props();
|
|
280
|
-
|
|
281
|
-
const chartColors = [
|
|
282
|
-
'var(--chart-1)',
|
|
283
|
-
'var(--chart-2)',
|
|
284
|
-
'var(--chart-3)',
|
|
285
|
-
'var(--chart-4)',
|
|
286
|
-
'var(--chart-5)'
|
|
287
|
-
];
|
|
288
|
-
|
|
289
|
-
let displayData = $derived(maxPoints && data.length > maxPoints ? data.slice(-maxPoints) : data);
|
|
290
|
-
|
|
291
|
-
let indexedData = $derived(displayData.map((d, i) => ({ ...d, _index: i })));
|
|
292
|
-
|
|
293
|
-
let series = $derived(
|
|
294
|
-
Object.entries(signals).map(([key, label], i) => ({
|
|
295
|
-
key,
|
|
296
|
-
label,
|
|
297
|
-
color: chartColors[i % chartColors.length]
|
|
298
|
-
}))
|
|
299
|
-
);
|
|
300
|
-
|
|
301
|
-
let chartConfig = $derived(
|
|
302
|
-
Object.fromEntries(series.map((s) => [s.key, { label: s.label, color: s.color }]))
|
|
303
|
-
);
|
|
304
|
-
|
|
305
|
-
let useIndexX = $derived(maxPoints !== undefined);
|
|
306
|
-
let xDomain = $derived(useIndexX ? [0, (maxPoints || displayData.length) - 1] : undefined);
|
|
307
|
-
</script>
|
|
308
|
-
|
|
309
|
-
<Card class={cn('p-4', className)} {...restProps}>
|
|
310
|
-
<CardHeader class="flex flex-row items-center justify-between p-0">
|
|
311
|
-
<CardTitle class="text-foreground font-mono text-base uppercase">
|
|
312
|
-
{title}
|
|
313
|
-
</CardTitle>
|
|
314
|
-
{#if Icon}
|
|
315
|
-
<Icon strokeWidth={1.25} class="text-muted-foreground size-6" />
|
|
316
|
-
{/if}
|
|
317
|
-
</CardHeader>
|
|
318
|
-
|
|
319
|
-
<CardContent class="flex flex-col gap-6 p-0">
|
|
320
|
-
<Chart.Container config={chartConfig} class="aspect-auto h-[220px] w-full">
|
|
321
|
-
<LineChart
|
|
322
|
-
data={indexedData}
|
|
323
|
-
x={useIndexX ? '_index' : xKey}
|
|
324
|
-
xScale={useIndexX ? scaleLinear() : scaleUtc()}
|
|
325
|
-
{xDomain}
|
|
326
|
-
yScale={scaleLinear()}
|
|
327
|
-
yDomain={[yMin, yMax]}
|
|
328
|
-
{series}
|
|
329
|
-
tooltip={false}
|
|
330
|
-
props={{
|
|
331
|
-
spline: { curve: curveNatural, strokeWidth: 1.5 },
|
|
332
|
-
yAxis: { ticks: yTicks }
|
|
333
|
-
}}
|
|
334
|
-
/>
|
|
335
|
-
</Chart.Container>
|
|
336
|
-
|
|
337
|
-
{#if series.length > 0}
|
|
338
|
-
<div class="flex items-center justify-center gap-10">
|
|
339
|
-
{#each series as s (s.key)}
|
|
340
|
-
<div class="flex items-center gap-2">
|
|
341
|
-
<div
|
|
342
|
-
class="size-2 rounded-full bg-(--legend-color)"
|
|
343
|
-
style:--legend-color={s.color}
|
|
344
|
-
></div>
|
|
345
|
-
<span class="text-foreground text-sm">{s.label}</span>
|
|
346
|
-
</div>
|
|
347
|
-
{/each}
|
|
348
|
-
</div>
|
|
349
|
-
{/if}
|
|
350
|
-
</CardContent>
|
|
351
|
-
</Card>
|
|
352
|
-
```
|
|
256
|
+
For a complete chart pattern example, see the `sensor-chart` pattern source in `$lib/components/ui/patterns/sensor-chart/`.
|
|
@@ -75,22 +75,7 @@ When wrapping bits-ui primitives, import the primitive and wrap it:
|
|
|
75
75
|
</SelectPrimitive.Trigger>
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- `Dialog` - Dialog.Root, Dialog.Portal, Dialog.Content, Dialog.Trigger, Dialog.Close
|
|
81
|
-
- `AlertDialog` - AlertDialog.Root, AlertDialog.Trigger, AlertDialog.Content, AlertDialog.Action, AlertDialog.Cancel
|
|
82
|
-
- `Select` - Select.Root, Select.Trigger, Select.Content, Select.Item
|
|
83
|
-
- `Popover` - Popover.Root, Popover.Portal, Popover.Content, Popover.Trigger
|
|
84
|
-
- `HoverCard` - HoverCard.Root, HoverCard.Trigger, HoverCard.Content
|
|
85
|
-
- `Tooltip` - Tooltip.Root, Tooltip.Trigger, Tooltip.Content
|
|
86
|
-
- `DropdownMenu` - DropdownMenu.Root, DropdownMenu.Trigger, DropdownMenu.Content, DropdownMenu.Item
|
|
87
|
-
- `ContextMenu` - ContextMenu.Root, ContextMenu.Trigger, ContextMenu.Content, ContextMenu.Item
|
|
88
|
-
- `Accordion` - Accordion.Root, Accordion.Item, Accordion.Trigger, Accordion.Content
|
|
89
|
-
- `Tabs` - Tabs.Root, Tabs.List, Tabs.Trigger, Tabs.Content
|
|
90
|
-
- `Collapsible` - Collapsible.Root, Collapsible.Trigger, Collapsible.Content
|
|
91
|
-
- `Command` - Command.Root, Command.Input, Command.List, Command.Item
|
|
92
|
-
|
|
93
|
-
Additional bits-ui primitives: Calendar, RangeCalendar, Checkbox, Switch, Slider, Toggle, ToggleGroup, RadioGroup, Menubar, NavigationMenu, Pagination, InputOTP, Sidebar, Progress, Label, Separator, AspectRatio, Avatar, ScrollArea, Sheet. Check the source files for their wrapper patterns.
|
|
78
|
+
For the full primitives catalog with import paths, see `@skills/build-pattern`.
|
|
94
79
|
|
|
95
80
|
## tailwind-variants (tv)
|
|
96
81
|
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
paths:
|
|
3
|
+
- '**/*.svelte'
|
|
4
|
+
- '**/+page.svelte'
|
|
5
|
+
---
|
|
6
|
+
|
|
1
7
|
# Physical AI Design Principles
|
|
2
8
|
|
|
3
9
|
## Scope
|
|
@@ -53,4 +59,13 @@ Interaction unfolds within a three-way relationship: **person, system, and physi
|
|
|
53
59
|
|
|
54
60
|
- Default to interfaces that support perception and reasoning rather than autonomous AI action
|
|
55
61
|
- Where possible, distinguish between "the system shows" (Measure) and "the system suggests" (Reason)
|
|
56
|
-
- Prefer framing AI output as observations or suggestions rather than commands or decisions
|
|
62
|
+
- Prefer framing AI output as observations or suggestions rather than commands or decisions
|
|
63
|
+
|
|
64
|
+
## Aesthetic Conventions
|
|
65
|
+
|
|
66
|
+
### Typography
|
|
67
|
+
- Use mono font (`font-mono`) with careful consideration: prefer it on badges, buttons, card headers, and numeric values. Do not apply mono to body text or descriptions.
|
|
68
|
+
|
|
69
|
+
### Card Defaults
|
|
70
|
+
- For single-purpose card components (status display, score, chart), use BackgroundCard as the default container.
|
|
71
|
+
- Status cards showing a single metric or state often do not need a CardHeader — omit when content is self-explanatory.
|
package/files/rules/state.md
CHANGED
|
@@ -330,50 +330,18 @@ Log when values change (removed in production builds):
|
|
|
330
330
|
|
|
331
331
|
### Async Code Doesn't Track Dependencies
|
|
332
332
|
|
|
333
|
-
|
|
334
|
-
<script>
|
|
335
|
-
let color = $state('red');
|
|
336
|
-
let size = $state(100);
|
|
337
|
-
|
|
338
|
-
$effect(() => {
|
|
339
|
-
// color is tracked (read synchronously)
|
|
340
|
-
console.log(color);
|
|
341
|
-
|
|
342
|
-
setTimeout(() => {
|
|
343
|
-
// size is NOT tracked (read async)
|
|
344
|
-
console.log(size);
|
|
345
|
-
}, 100);
|
|
346
|
-
});
|
|
347
|
-
</script>
|
|
348
|
-
```
|
|
333
|
+
Only synchronously-read state inside `$effect` is tracked. State read inside `setTimeout`, `await`, or callbacks is not tracked.
|
|
349
334
|
|
|
350
335
|
### Exporting Reassigned State
|
|
351
336
|
|
|
352
|
-
Can't directly export state that gets reassigned:
|
|
337
|
+
Can't directly export state that gets reassigned. Wrap in an object instead:
|
|
353
338
|
|
|
354
339
|
```javascript
|
|
355
340
|
// state.svelte.js
|
|
356
|
-
|
|
357
|
-
// BAD - won't work across modules
|
|
358
|
-
export let count = $state(0);
|
|
359
|
-
export function increment() {
|
|
360
|
-
count++;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// GOOD - wrap in object
|
|
364
341
|
export const counter = $state({ count: 0 });
|
|
365
342
|
export function increment() {
|
|
366
343
|
counter.count++;
|
|
367
344
|
}
|
|
368
|
-
|
|
369
|
-
// GOOD - use getters
|
|
370
|
-
let count = $state(0);
|
|
371
|
-
export function getCount() {
|
|
372
|
-
return count;
|
|
373
|
-
}
|
|
374
|
-
export function increment() {
|
|
375
|
-
count++;
|
|
376
|
-
}
|
|
377
345
|
```
|
|
378
346
|
|
|
379
347
|
### Effects Only Run in Browser
|
package/files/rules/styling.md
CHANGED
|
@@ -6,68 +6,17 @@ paths:
|
|
|
6
6
|
|
|
7
7
|
# Styling Rules
|
|
8
8
|
|
|
9
|
-
## Semantic
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| `text-popover-foreground` | Text in popovers |
|
|
21
|
-
| `bg-muted` | Muted/subtle backgrounds |
|
|
22
|
-
| `text-muted-foreground` | Secondary/muted text |
|
|
23
|
-
|
|
24
|
-
### Interactive Colors
|
|
25
|
-
|
|
26
|
-
| Token | Usage |
|
|
27
|
-
| --------------------------- | ----------------------------- |
|
|
28
|
-
| `bg-primary` | Primary buttons, links |
|
|
29
|
-
| `text-primary-foreground` | Text on primary backgrounds |
|
|
30
|
-
| `bg-secondary` | Secondary buttons |
|
|
31
|
-
| `text-secondary-foreground` | Text on secondary backgrounds |
|
|
32
|
-
| `bg-accent` | Hover states, highlights |
|
|
33
|
-
| `text-accent-foreground` | Text on accent backgrounds |
|
|
34
|
-
| `bg-destructive` | Delete/error actions |
|
|
35
|
-
|
|
36
|
-
### Border & Input Colors
|
|
37
|
-
|
|
38
|
-
| Token | Usage |
|
|
39
|
-
| --------------- | -------------------- |
|
|
40
|
-
| `border-border` | Default border color |
|
|
41
|
-
| `border-input` | Input field borders |
|
|
42
|
-
| `ring-ring` | Focus ring color |
|
|
43
|
-
|
|
44
|
-
### Chart Colors
|
|
45
|
-
|
|
46
|
-
| Token | Usage |
|
|
47
|
-
| ----------- | -------------------------------- |
|
|
48
|
-
| `--chart-1` | First series color (purple) |
|
|
49
|
-
| `--chart-2` | Second series color (red-orange) |
|
|
50
|
-
| `--chart-3` | Third series color (green) |
|
|
51
|
-
| `--chart-4` | Fourth series color (yellow) |
|
|
52
|
-
| `--chart-5` | Fifth series color (coral) |
|
|
53
|
-
|
|
54
|
-
### ATAI Brand Colors
|
|
55
|
-
|
|
56
|
-
| Token | Usage |
|
|
57
|
-
| -------------------- | --------------------- |
|
|
58
|
-
| `bg-atai-neutral` | Brand blue accent |
|
|
59
|
-
| `text-atai-good` | Success/healthy state |
|
|
60
|
-
| `text-atai-warning` | Warning state |
|
|
61
|
-
| `text-atai-critical` | Critical/error state |
|
|
62
|
-
|
|
63
|
-
### Sidebar Colors
|
|
64
|
-
|
|
65
|
-
| Token | Usage |
|
|
66
|
-
| ------------------------- | -------------------- |
|
|
67
|
-
| `bg-sidebar` | Sidebar background |
|
|
68
|
-
| `text-sidebar-foreground` | Sidebar text |
|
|
69
|
-
| `bg-sidebar-accent` | Sidebar hover/active |
|
|
70
|
-
| `border-sidebar-border` | Sidebar borders |
|
|
9
|
+
## Semantic Tokens
|
|
10
|
+
|
|
11
|
+
For the complete token reference including dark mode overrides, type scale (h1–h6, p, small), and spacing definitions, read `node_modules/@archetypeai/ds-lib-tokens/theme.css`.
|
|
12
|
+
|
|
13
|
+
Token naming pattern: `bg-{token}`, `text-{token}-foreground`, `border-{token}`.
|
|
14
|
+
|
|
15
|
+
Core tokens: `background`, `foreground`, `primary`, `secondary`, `muted`, `card`, `accent`, `destructive`, `border`, `input`, `ring`.
|
|
16
|
+
|
|
17
|
+
ATAI brand tokens: `atai-neutral`, `atai-good`, `atai-warning`, `atai-critical`.
|
|
18
|
+
|
|
19
|
+
Chart series: `--chart-1` through `--chart-5` (see `@rules/charts`).
|
|
71
20
|
|
|
72
21
|
## When to Use Semantic vs Standard Tailwind
|
|
73
22
|
|
|
@@ -126,33 +75,7 @@ For custom dark mode overrides, use the `dark:` prefix:
|
|
|
126
75
|
<div class="bg-white dark:bg-slate-900"> <!-- custom dark override -->
|
|
127
76
|
```
|
|
128
77
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
Import and use for all class composition:
|
|
132
|
-
|
|
133
|
-
```javascript
|
|
134
|
-
import { cn } from '$lib/utils.js';
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
```svelte
|
|
138
|
-
<div class={cn(
|
|
139
|
-
'base-classes here',
|
|
140
|
-
conditional && 'conditional-classes',
|
|
141
|
-
className
|
|
142
|
-
)}>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
The utility:
|
|
146
|
-
|
|
147
|
-
- Uses `clsx` for conditional class joining
|
|
148
|
-
- Uses `tailwind-merge` to resolve conflicts (last wins)
|
|
149
|
-
|
|
150
|
-
Example conflict resolution:
|
|
151
|
-
|
|
152
|
-
```javascript
|
|
153
|
-
cn('p-4', 'p-2'); // → 'p-2' (later wins)
|
|
154
|
-
cn('bg-red-500', 'bg-background'); // → 'bg-background' (later wins)
|
|
155
|
-
```
|
|
78
|
+
For class merging with `cn()`, see `@rules/components`.
|
|
156
79
|
|
|
157
80
|
## CSS Import Order
|
|
158
81
|
|
|
@@ -212,34 +135,6 @@ Prefer Tailwind classes directly in markup. Use @apply only in base layer CSS:
|
|
|
212
135
|
|
|
213
136
|
## Common Patterns
|
|
214
137
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
```svelte
|
|
218
|
-
<button class="focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 outline-none">
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Disabled States
|
|
138
|
+
For focus ring, disabled state, and data-state animation CSS patterns, see `@rules/accessibility`.
|
|
222
139
|
|
|
223
|
-
|
|
224
|
-
<button class="disabled:pointer-events-none disabled:opacity-50">
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
### Data State Animations
|
|
228
|
-
|
|
229
|
-
```svelte
|
|
230
|
-
<div class="data-[state=open]:animate-in data-[state=closed]:animate-out">
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Responsive Design
|
|
234
|
-
|
|
235
|
-
```svelte
|
|
236
|
-
<div class="w-full max-w-[calc(100%-2rem)] sm:max-w-lg">
|
|
237
|
-
<div class="flex flex-col sm:flex-row">
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Icon Sizing
|
|
241
|
-
|
|
242
|
-
```svelte
|
|
243
|
-
<!-- Default icon sizing utility -->
|
|
244
|
-
<button class="[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
|
|
245
|
-
```
|
|
140
|
+
For icon sizing conventions, see `@rules/components`.
|
|
@@ -9,6 +9,8 @@ Patterns are composite components assembled from design system primitives.
|
|
|
9
9
|
|
|
10
10
|
## Decision: Pattern vs Extension
|
|
11
11
|
|
|
12
|
+
**Before building, fetch `https://design-system.archetypeai.workers.dev/r/patterns.json` and check if an existing pattern covers the use case — even partially. Use or extend it rather than creating a new one.**
|
|
13
|
+
|
|
12
14
|
**Build a pattern when:**
|
|
13
15
|
|
|
14
16
|
- Combining 3+ primitives into a reusable unit
|
|
@@ -187,7 +187,7 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
|
|
|
187
187
|
|
|
188
188
|
Panels should contain pattern components, not raw markup. Before building new components:
|
|
189
189
|
|
|
190
|
-
1.
|
|
190
|
+
1. Fetch `https://design-system.archetypeai.workers.dev/r/patterns.json` to discover available patterns. Each has a `description` summarizing its purpose. If one fits, use it.
|
|
191
191
|
2. If no existing pattern fits, create one via `@skills/build-pattern`
|
|
192
192
|
3. Each panel should contain one primary component with clear props for data flow
|
|
193
193
|
|
|
@@ -8,7 +8,20 @@ argument-hint: [csv-file-path]
|
|
|
8
8
|
|
|
9
9
|
Generate a script that streams time-series data from a CSV file to the Archetype AI Embedding Lens and collects embedding vectors. Supports both Python and JavaScript/Web.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Frontend Architecture
|
|
12
|
+
|
|
13
|
+
Decompose the UI into components. See `@rules/frontend-architecture` for conventions.
|
|
14
|
+
|
|
15
|
+
### Recommended decomposition
|
|
16
|
+
|
|
17
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
18
|
+
|---------|-----------|-------------------|-----------|
|
|
19
|
+
| File input | `DataInput.svelte` | BackgroundCard, Button, Input | `onselect`, `status` |
|
|
20
|
+
| Scatter plot | Reuse ScatterChart pattern | BackgroundCard, Chart | `data[]`, `categories` |
|
|
21
|
+
| Progress | `StreamProgress.svelte` | BackgroundCard, Progress | `current`, `total` |
|
|
22
|
+
|
|
23
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
24
|
+
- Extract streaming and session logic into `$lib/api/embeddings.js`
|
|
12
25
|
|
|
13
26
|
---
|
|
14
27
|
|
|
@@ -8,7 +8,20 @@ argument-hint: [source-type]
|
|
|
8
8
|
|
|
9
9
|
Generate a script that streams real-time IMU sensor data to the Archetype AI Embedding Lens for live embedding extraction. Supports both Python and JavaScript/Web.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Frontend Architecture
|
|
12
|
+
|
|
13
|
+
Decompose the UI into components. See `@rules/frontend-architecture` for conventions.
|
|
14
|
+
|
|
15
|
+
### Recommended decomposition
|
|
16
|
+
|
|
17
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
18
|
+
|---------|-----------|-------------------|-----------|
|
|
19
|
+
| Sensor input | `DataInput.svelte` | BackgroundCard, Button, Input | `onselect`, `status` |
|
|
20
|
+
| Scatter plot | Reuse ScatterChart pattern | BackgroundCard, Chart | `data[]`, `categories` |
|
|
21
|
+
| Progress | `StreamProgress.svelte` | BackgroundCard, Progress | `current`, `total` |
|
|
22
|
+
|
|
23
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
24
|
+
- Extract streaming and session logic into `$lib/api/embeddings.js`
|
|
12
25
|
|
|
13
26
|
---
|
|
14
27
|
|
|
@@ -8,7 +8,20 @@ argument-hint: [csv-file-path]
|
|
|
8
8
|
|
|
9
9
|
Generate a script that uploads a CSV file to the Archetype AI platform and extracts embeddings server-side. The server reads the file directly — no local streaming loop required. Supports both Python and JavaScript/Web.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Frontend Architecture
|
|
12
|
+
|
|
13
|
+
Decompose the UI into components. See `@rules/frontend-architecture` for conventions.
|
|
14
|
+
|
|
15
|
+
### Recommended decomposition
|
|
16
|
+
|
|
17
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
18
|
+
|---------|-----------|-------------------|-----------|
|
|
19
|
+
| File upload | `DataInput.svelte` | BackgroundCard, Button, Input | `onselect`, `status` |
|
|
20
|
+
| Scatter plot | Reuse ScatterChart pattern | BackgroundCard, Chart | `data[]`, `categories` |
|
|
21
|
+
| Progress | `StreamProgress.svelte` | BackgroundCard, Progress | `current`, `total` |
|
|
22
|
+
|
|
23
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
24
|
+
- Extract upload and session logic into `$lib/api/embeddings.js`
|
|
12
25
|
|
|
13
26
|
---
|
|
14
27
|
|
|
@@ -78,7 +78,7 @@ Decompose the UI into components rather than building a monolithic `+page.svelte
|
|
|
78
78
|
| Video input | `VideoUpload.svelte` (or reuse VideoPlayer pattern) | Card, Button | `onupload`, `status`, `videoUrl` |
|
|
79
79
|
| Status | `ProcessingStatus.svelte` | Card, Badge, Spinner | `status`, `message` |
|
|
80
80
|
| Summary | `AnalysisSummary.svelte` | Card | `title`, `summary` |
|
|
81
|
-
| Log |
|
|
81
|
+
| Log | Use FlatLogItem pattern in ScrollArea | FlatLogItem, ScrollArea | `status`, `message`, `detail` |
|
|
82
82
|
|
|
83
83
|
### Layout and API logic
|
|
84
84
|
|
|
@@ -9,7 +9,20 @@ allowed-tools: Bash(python *), Read
|
|
|
9
9
|
|
|
10
10
|
Capture live webcam frames, encode as base64 JPEG, and send to Newton's vision model via `model.query` (synchronous request/response). Supports Python (OpenCV) and JavaScript (getUserMedia + canvas).
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Frontend Architecture
|
|
13
|
+
|
|
14
|
+
Decompose the UI into components. See `@rules/frontend-architecture` for conventions.
|
|
15
|
+
|
|
16
|
+
### Recommended decomposition
|
|
17
|
+
|
|
18
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
19
|
+
|---------|-----------|-------------------|-----------|
|
|
20
|
+
| Camera feed | `WebcamView.svelte` | Card, AspectRatio | `stream`, `status` |
|
|
21
|
+
| Status | `ConnectionStatus.svelte` | StatusBadge pattern | `status`, `label` |
|
|
22
|
+
| Results | Use FlatLogItem pattern in ScrollArea | FlatLogItem, ScrollArea | `status`, `message`, `detail` |
|
|
23
|
+
|
|
24
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
25
|
+
- Extract webcam capture and API logic into `$lib/api/camera-analysis.js`
|
|
13
26
|
|
|
14
27
|
**This skill is for LIVE WEBCAM input only.** For analyzing uploaded video files, use `/activity-monitor-lens-on-video` instead.
|
|
15
28
|
|
|
@@ -9,6 +9,15 @@ allowed-tools: Bash(python *), Read
|
|
|
9
9
|
|
|
10
10
|
Send a text query directly to Newton via `POST /v0.5/query`. No lens registration, no session, no SSE — just a simple request/response. Use for API testing, text Q&A, or post-processing results from other lenses.
|
|
11
11
|
|
|
12
|
+
## Frontend Architecture
|
|
13
|
+
|
|
14
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
15
|
+
|---------|-----------|-------------------|-----------|
|
|
16
|
+
| Query input | `QueryInput.svelte` | BackgroundCard, Input, Button | `onsubmit`, `loading` |
|
|
17
|
+
| Response | `QueryResponse.svelte` | BackgroundCard | `response`, `loading` |
|
|
18
|
+
|
|
19
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
20
|
+
|
|
12
21
|
---
|
|
13
22
|
|
|
14
23
|
## API Endpoint
|
|
@@ -8,7 +8,21 @@ argument-hint: [csv-file-path]
|
|
|
8
8
|
|
|
9
9
|
Generate a script that streams time-series data from a CSV file to the Archetype AI Machine State Lens for n-shot state classification. Supports both Python and JavaScript/Web.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Frontend Architecture
|
|
12
|
+
|
|
13
|
+
Decompose the UI into components. See `@rules/frontend-architecture` for conventions.
|
|
14
|
+
|
|
15
|
+
### Recommended decomposition
|
|
16
|
+
|
|
17
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
18
|
+
|---------|-----------|-------------------|-----------|
|
|
19
|
+
| File input | `DataInput.svelte` | BackgroundCard, Button, Input | `onselect`, `status` |
|
|
20
|
+
| Classification | `StateDisplay.svelte` | BackgroundCard, Badge | `currentState`, `confidence` |
|
|
21
|
+
| Time series | Reuse SensorChart pattern | BackgroundCard, Chart | `data[]`, `signals` |
|
|
22
|
+
| Results | Use FlatLogItem pattern in ScrollArea | FlatLogItem, ScrollArea | `status`, `message`, `detail` |
|
|
23
|
+
|
|
24
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
25
|
+
- Extract streaming and session logic into `$lib/api/machine-state.js`
|
|
12
26
|
|
|
13
27
|
---
|
|
14
28
|
|
|
@@ -8,7 +8,21 @@ argument-hint: [source-type]
|
|
|
8
8
|
|
|
9
9
|
Generate a script that streams real-time IMU sensor data to the Archetype AI Machine State Lens for live n-shot state classification. Supports both Python and JavaScript/Web.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Frontend Architecture
|
|
12
|
+
|
|
13
|
+
Decompose the UI into components. See `@rules/frontend-architecture` for conventions.
|
|
14
|
+
|
|
15
|
+
### Recommended decomposition
|
|
16
|
+
|
|
17
|
+
| UI Area | Component | Pattern/Primitives | Key Props |
|
|
18
|
+
|---------|-----------|-------------------|-----------|
|
|
19
|
+
| Sensor input | `DataInput.svelte` | BackgroundCard, Button, Input | `onselect`, `status` |
|
|
20
|
+
| Classification | `StateDisplay.svelte` | BackgroundCard, Badge | `currentState`, `confidence` |
|
|
21
|
+
| Time series | Reuse SensorChart pattern | BackgroundCard, Chart | `data[]`, `signals` |
|
|
22
|
+
| Results | Use FlatLogItem pattern in ScrollArea | FlatLogItem, ScrollArea | `status`, `message`, `detail` |
|
|
23
|
+
|
|
24
|
+
- Use `@skills/create-dashboard` for the page layout
|
|
25
|
+
- Extract streaming and session logic into `$lib/api/machine-state.js`
|
|
12
26
|
|
|
13
27
|
---
|
|
14
28
|
|
|
@@ -256,20 +256,40 @@ export async function installComponents(pm, projectPath, componentUrls) {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
// add a demo page with
|
|
259
|
+
// add a demo page with design system examples to app
|
|
260
260
|
export function createDemoPage(projectPath) {
|
|
261
261
|
const pagePath = join(projectPath, 'src/routes/+page.svelte');
|
|
262
262
|
const demoContent = `<script>
|
|
263
|
-
\timport
|
|
263
|
+
\timport Menubar from '$lib/components/ui/patterns/menubar/index.js';
|
|
264
|
+
\timport { Button } from '$lib/components/ui/primitives/button/index.js';
|
|
265
|
+
\timport BackgroundCard from '$lib/components/ui/patterns/background-card/index.js';
|
|
266
|
+
\timport ActivityIcon from '@lucide/svelte/icons/activity';
|
|
267
|
+
\timport CpuIcon from '@lucide/svelte/icons/cpu';
|
|
268
|
+
\timport GaugeIcon from '@lucide/svelte/icons/gauge';
|
|
269
|
+
\timport ThermometerIcon from '@lucide/svelte/icons/thermometer';
|
|
264
270
|
</script>
|
|
265
271
|
|
|
266
|
-
<div
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
<div
|
|
273
|
+
\tclass="bg-background text-foreground grid h-screen w-screen grid-rows-[auto_1fr] overflow-hidden"
|
|
274
|
+
>
|
|
275
|
+
\t<Menubar>
|
|
276
|
+
\t\t<Button variant="link" class="text-muted-foreground">Send Report</Button>
|
|
277
|
+
\t</Menubar>
|
|
278
|
+
|
|
279
|
+
\t<main class="grid grid-cols-2 grid-rows-2 gap-4 overflow-hidden p-4">
|
|
280
|
+
\t\t<BackgroundCard title="Panel 1" icon={ActivityIcon} class="max-h-full">
|
|
281
|
+
\t\t\t<p class="text-muted-foreground text-sm">Placeholder content</p>
|
|
282
|
+
\t\t</BackgroundCard>
|
|
283
|
+
\t\t<BackgroundCard title="Panel 2" icon={CpuIcon} class="max-h-full">
|
|
284
|
+
\t\t\t<p class="text-muted-foreground text-sm">Placeholder content</p>
|
|
285
|
+
\t\t</BackgroundCard>
|
|
286
|
+
\t\t<BackgroundCard title="Panel 3" icon={GaugeIcon} class="max-h-full">
|
|
287
|
+
\t\t\t<p class="text-muted-foreground text-sm">Placeholder content</p>
|
|
288
|
+
\t\t</BackgroundCard>
|
|
289
|
+
\t\t<BackgroundCard title="Panel 4" icon={ThermometerIcon} class="max-h-full">
|
|
290
|
+
\t\t\t<p class="text-muted-foreground text-sm">Placeholder content</p>
|
|
291
|
+
\t\t</BackgroundCard>
|
|
292
|
+
\t</main>
|
|
273
293
|
</div>
|
|
274
294
|
`;
|
|
275
295
|
writeFile(pagePath, demoContent);
|