@archetypeai/ds-cli 0.3.16 → 0.3.18

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.
@@ -75,22 +75,7 @@ When wrapping bits-ui primitives, import the primitive and wrap it:
75
75
  </SelectPrimitive.Trigger>
76
76
  ```
77
77
 
78
- Common bits-ui primitives:
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.
@@ -31,6 +31,17 @@ The project includes pattern components that demonstrate these conventions. Stud
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
 
34
+ ## Directory structure
35
+
36
+ ```
37
+ $lib/components/ui/
38
+ primitives/ — DS registry primitives (Card, Badge, Button, etc.)
39
+ patterns/ — DS registry patterns (BackgroundCard, FlatLogItem, etc.)
40
+ custom/ — Project-specific components not from the registry
41
+ ```
42
+
43
+ Place custom components (ones you create for this project that are not installed from the registry) in `$lib/components/ui/custom/`. Never put custom components directly in `ui/` next to `primitives/` and `patterns/`.
44
+
34
45
  ## Component conventions
35
46
 
36
47
  Follow `@rules/components` for the full conventions. The essentials:
@@ -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
- ```svelte
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
@@ -6,68 +6,17 @@ paths:
6
6
 
7
7
  # Styling Rules
8
8
 
9
- ## Semantic Token Reference
10
-
11
- ### Background & Foreground Colors
12
-
13
- | Token | Usage |
14
- | ------------------------- | ---------------------------- |
15
- | `bg-background` | Page/app background |
16
- | `text-foreground` | Primary text color |
17
- | `bg-card` | Card backgrounds |
18
- | `text-card-foreground` | Text on cards |
19
- | `bg-popover` | Popover/dropdown backgrounds |
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
- ## cn() Utility
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
 
@@ -167,6 +90,16 @@ In your global CSS file:
167
90
 
168
91
  Order matters - tokens must come before Tailwind.
169
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
+ ```
102
+
170
103
  ## Tailwind v4 Specifics
171
104
 
172
105
  ### @theme Directive
@@ -212,34 +145,6 @@ Prefer Tailwind classes directly in markup. Use @apply only in base layer CSS:
212
145
 
213
146
  ## Common Patterns
214
147
 
215
- ### Focus States
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
222
-
223
- ```svelte
224
- <button class="disabled:pointer-events-none disabled:opacity-50">
225
- ```
226
-
227
- ### Data State Animations
148
+ For focus ring, disabled state, and data-state animation CSS patterns, see `@rules/accessibility`.
228
149
 
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
- ```
150
+ 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
@@ -33,7 +33,7 @@ Dashboards fill the entire viewport with no scrolling:
33
33
  Unless the user explicitly asks for a different layout:
34
34
 
35
35
  - **Equal-width columns** — use `grid-cols-2`, `grid-cols-3`, etc. Never mix fixed and fluid widths for card grids (e.g., don't use `grid-cols-[300px_1fr]` for cards — that's for sidebar layouts only)
36
- - **Equal-height cards** — CSS grid rows distribute height evenly. Add `max-h-full` to each Card so content stays constrained to its grid cell
36
+ - **Cards fill available height** — cards must stretch to fill their grid cell or flex container. Add `max-h-full` to constrain content. For asymmetric layouts (stacked cards in one column, full-height card in another), use a flex column with `flex-1` on the card that should grow
37
37
  - **Consistent spacing** — always use `gap-4` between cards and `p-4` padding around the grid
38
38
 
39
39
  ## Menubar
@@ -123,7 +123,7 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
123
123
  </main>
124
124
  ```
125
125
 
126
- ### Grid of Cards
126
+ ### Grid of Cards (Equal)
127
127
 
128
128
  ```svelte
129
129
  <main class="grid grid-cols-2 grid-rows-2 gap-4 overflow-hidden p-4">
@@ -134,6 +134,25 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
134
134
  </main>
135
135
  ```
136
136
 
137
+ ### Asymmetric Cards (Stacked Left + Full-Height Right)
138
+
139
+ When one column has multiple cards and the other has a single tall card, use `grid-rows-subgrid` or nested flex columns. Cards must stretch to fill available height — never leave empty space at the bottom.
140
+
141
+ ```svelte
142
+ <main class="grid grid-cols-[1fr_2fr] gap-4 overflow-hidden p-4">
143
+ <!-- Left column: stacked cards that fill height -->
144
+ <div class="flex flex-col gap-4 overflow-hidden">
145
+ <Card class="max-h-full"><!-- input --></Card>
146
+ <Card class="max-h-full"><!-- status --></Card>
147
+ <Card class="max-h-full flex-1"><!-- summary (grows to fill remaining space) --></Card>
148
+ </div>
149
+ <!-- Right column: single card spanning full height -->
150
+ <Card class="max-h-full overflow-hidden"><!-- log / results --></Card>
151
+ </main>
152
+ ```
153
+
154
+ The `flex-1` on the last left-column card makes it grow to fill remaining vertical space. Adjust column ratio (`1fr_2fr`, `1fr_1fr`, etc.) to match content needs.
155
+
137
156
  ## Key Tailwind Classes
138
157
 
139
158
  | Class | Purpose |
@@ -187,7 +206,7 @@ For co-branding, pass a `partnerLogo` snippet to replace the default placeholder
187
206
 
188
207
  Panels should contain pattern components, not raw markup. Before building new components:
189
208
 
190
- 1. Check if existing patterns fit the need `VideoPlayer`, `ExpandableLog`, `StatusBadge`, `HealthscoreCard`, `SensorChart`, `ScatterChart`
209
+ 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
210
  2. If no existing pattern fits, create one via `@skills/build-pattern`
192
211
  3. Each panel should contain one primary component with clear props for data flow
193
212
 
@@ -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
- > **Frontend architecture:** When building a web UI for this skill, decompose into components (file input, status display, visualization) rather than a monolithic page. Extract API/streaming logic into `$lib/api/`. See `@rules/frontend-architecture` for conventions and `@skills/create-dashboard` / `@skills/build-pattern` for layout and component patterns.
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
- > **Frontend architecture:** When building a web UI for this skill, decompose into components (sensor connection, status display, embedding visualization) rather than a monolithic page. Extract sensor and API logic into `$lib/api/`. See `@rules/frontend-architecture` for conventions and `@skills/create-dashboard` / `@skills/build-pattern` for layout and component patterns.
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
- > **Frontend architecture:** When building a web UI for this skill, decompose into components (file upload, status display, results view) rather than a monolithic page. Extract API logic into `$lib/api/`. See `@rules/frontend-architecture` for conventions and `@skills/create-dashboard` / `@skills/build-pattern` for layout and component patterns.
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 | Reuse ExpandableLog pattern | Collapsible, Badge, Item | `title`, `logs[]`, `count` |
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
- > **Frontend architecture:** When building a web UI for this skill, decompose into components (webcam input, status display, results view) rather than a monolithic page. Extract API logic into `$lib/api/`. See `@rules/frontend-architecture` for conventions and `@skills/create-dashboard` / `@skills/build-pattern` for layout and component patterns.
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
- > **Frontend architecture:** When building a web UI for this skill, decompose into components (file input, status display, results view) rather than a monolithic page. Extract API/streaming logic into `$lib/api/`. See `@rules/frontend-architecture` for conventions and `@skills/create-dashboard` / `@skills/build-pattern` for layout and component patterns.
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
- > **Frontend architecture:** When building a web UI for this skill, decompose into components (sensor connection, status display, results view) rather than a monolithic page. Extract sensor and API logic into `$lib/api/`. See `@rules/frontend-architecture` for conventions and `@skills/create-dashboard` / `@skills/build-pattern` for layout and component patterns.
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