@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
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: build-pattern
|
|
3
|
-
description: Creates composite UI patterns by assembling design system 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 primitives. Also use when the user asks to create a "component" or "widget" that should follow design system conventions.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Building Patterns
|
|
7
|
-
|
|
8
|
-
Patterns are composite components assembled from design system primitives.
|
|
9
|
-
|
|
10
|
-
## Decision: Pattern vs Extension
|
|
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
|
-
|
|
14
|
-
**Build a pattern when:**
|
|
15
|
-
|
|
16
|
-
- Combining 3+ primitives into a reusable unit
|
|
17
|
-
- The combination will be used in multiple places
|
|
18
|
-
- The component has its own props/state logic
|
|
19
|
-
|
|
20
|
-
**Extend a primitive instead when:**
|
|
21
|
-
|
|
22
|
-
- Adding variants to a single primitive
|
|
23
|
-
- Customizing styling without composition
|
|
24
|
-
|
|
25
|
-
## Pattern Structure
|
|
26
|
-
|
|
27
|
-
```svelte
|
|
28
|
-
<script>
|
|
29
|
-
import { cn } from '$lib/utils.js';
|
|
30
|
-
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/primitives/card/index.js';
|
|
31
|
-
import { Button } from '$lib/components/ui/primitives/button/index.js';
|
|
32
|
-
|
|
33
|
-
let { title, class: className, children, ...restProps } = $props();
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<Card class={cn('p-4', className)} {...restProps}>
|
|
37
|
-
<CardHeader>
|
|
38
|
-
<CardTitle>{title}</CardTitle>
|
|
39
|
-
</CardHeader>
|
|
40
|
-
<CardContent>
|
|
41
|
-
{@render children?.()}
|
|
42
|
-
</CardContent>
|
|
43
|
-
</Card>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Key Conventions
|
|
47
|
-
|
|
48
|
-
### Props Pattern
|
|
49
|
-
|
|
50
|
-
Always use this structure:
|
|
51
|
-
|
|
52
|
-
```javascript
|
|
53
|
-
let {
|
|
54
|
-
ref = $bindable(null), // optional DOM reference
|
|
55
|
-
class: className, // rename to avoid reserved word
|
|
56
|
-
children, // snippet for slot content
|
|
57
|
-
...restProps // pass-through attributes
|
|
58
|
-
} = $props();
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Class Merging
|
|
62
|
-
|
|
63
|
-
Always use `cn()` for classes:
|
|
64
|
-
|
|
65
|
-
```svelte
|
|
66
|
-
<div class={cn('bg-card p-4', className)}>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Never concatenate strings directly.
|
|
70
|
-
|
|
71
|
-
### Spreading restProps
|
|
72
|
-
|
|
73
|
-
Always spread on the root element:
|
|
74
|
-
|
|
75
|
-
```svelte
|
|
76
|
-
<Card class={cn('p-4', className)} {...restProps}>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
This ensures aria attributes, data attributes, and event handlers pass through.
|
|
80
|
-
|
|
81
|
-
### Rendering Children
|
|
82
|
-
|
|
83
|
-
Use `{@render}` for slot content:
|
|
84
|
-
|
|
85
|
-
```svelte
|
|
86
|
-
{@render children?.()}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Available Primitives
|
|
90
|
-
|
|
91
|
-
Import primitives from `$lib/components/ui/primitives/` and patterns from `$lib/components/ui/patterns/`. Before building, list these directories to discover all installed components.
|
|
92
|
-
|
|
93
|
-
### Layout & Structure
|
|
94
|
-
|
|
95
|
-
- **card** - Card, CardHeader, CardTitle, CardContent, CardFooter, CardAction, CardDescription
|
|
96
|
-
- **separator** - Separator
|
|
97
|
-
- **resizable** - ResizablePane, ResizablePaneGroup, ResizableHandle
|
|
98
|
-
- **scroll-area** - ScrollArea
|
|
99
|
-
- **aspect-ratio** - AspectRatio
|
|
100
|
-
- **skeleton** - Skeleton
|
|
101
|
-
- **collapsible** - Collapsible.Root, Collapsible.Trigger, Collapsible.Content
|
|
102
|
-
|
|
103
|
-
### Forms & Inputs
|
|
104
|
-
|
|
105
|
-
- **button** - Button (with variants via `buttonVariants`)
|
|
106
|
-
- **input** - Input
|
|
107
|
-
- **textarea** - Textarea
|
|
108
|
-
- **label** - Label
|
|
109
|
-
- **checkbox** - Checkbox
|
|
110
|
-
- **switch** - Switch
|
|
111
|
-
- **select** - Select.Root, Select.Trigger, Select.Content, Select.Item
|
|
112
|
-
- **native-select** - NativeSelect
|
|
113
|
-
- **radio-group** - RadioGroup.Root, RadioGroup.Item
|
|
114
|
-
- **slider** - Slider
|
|
115
|
-
- **toggle** - Toggle
|
|
116
|
-
- **toggle-group** - ToggleGroup.Root, ToggleGroup.Item
|
|
117
|
-
- **input-otp** - InputOTP
|
|
118
|
-
- **input-group** - InputGroup
|
|
119
|
-
- **field** - Field, FieldSet, FieldGroup, FieldLabel, FieldDescription, FieldError, FieldContent
|
|
120
|
-
|
|
121
|
-
### Data Display
|
|
122
|
-
|
|
123
|
-
- **table** - Table, TableHeader, TableBody, TableRow, TableCell, TableHead, TableFooter, TableCaption
|
|
124
|
-
- **data-table** - createSvelteTable, FlexRender
|
|
125
|
-
- **chart** - Chart.Container, Chart.Tooltip
|
|
126
|
-
- **badge** - Badge
|
|
127
|
-
- **avatar** - Avatar, AvatarImage, AvatarFallback
|
|
128
|
-
- **kbd** - Kbd
|
|
129
|
-
- **empty** - Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent
|
|
130
|
-
- **item** - Item, ItemGroup, ItemHeader, ItemContent, ItemTitle, ItemDescription, ItemActions, ItemMedia
|
|
131
|
-
- **spinner** - Spinner
|
|
132
|
-
- **progress** - Progress
|
|
133
|
-
- **carousel** - Carousel
|
|
134
|
-
|
|
135
|
-
### Overlays & Dialogs
|
|
136
|
-
|
|
137
|
-
- **dialog** - Dialog.Root, Dialog.Trigger, Dialog.Content, Dialog.Header, Dialog.Title, Dialog.Description, Dialog.Footer, Dialog.Close
|
|
138
|
-
- **alert-dialog** - AlertDialog.Root, AlertDialog.Trigger, AlertDialog.Content, AlertDialog.Header, AlertDialog.Title, AlertDialog.Description, AlertDialog.Footer, AlertDialog.Action, AlertDialog.Cancel
|
|
139
|
-
- **sheet** - Sheet.Root, Sheet.Trigger, Sheet.Content, Sheet.Header, Sheet.Title, Sheet.Description, Sheet.Footer, Sheet.Close
|
|
140
|
-
- **drawer** - Drawer.Root, Drawer.Trigger, Drawer.Content, Drawer.Header, Drawer.Title, Drawer.Description, Drawer.Footer, Drawer.Close
|
|
141
|
-
- **popover** - Popover.Root, Popover.Trigger, Popover.Content
|
|
142
|
-
- **hover-card** - HoverCard.Root, HoverCard.Trigger, HoverCard.Content
|
|
143
|
-
- **tooltip** - Tooltip.Root, Tooltip.Trigger, Tooltip.Content, Tooltip.Provider
|
|
144
|
-
- **command** - Command.Root, Command.Input, Command.List, Command.Item, Command.Group
|
|
145
|
-
- **sonner** - Toaster
|
|
146
|
-
|
|
147
|
-
### Navigation & Menus
|
|
148
|
-
|
|
149
|
-
- **tabs** - Tabs.Root, Tabs.List, Tabs.Trigger, Tabs.Content
|
|
150
|
-
- **accordion** - Accordion.Root, Accordion.Item, Accordion.Trigger, Accordion.Content
|
|
151
|
-
- **dropdown-menu** - DropdownMenu.Root, DropdownMenu.Trigger, DropdownMenu.Content, DropdownMenu.Item, DropdownMenu.Separator
|
|
152
|
-
- **context-menu** - ContextMenu.Root, ContextMenu.Trigger, ContextMenu.Content, ContextMenu.Item
|
|
153
|
-
- **menubar** - Menubar
|
|
154
|
-
- **navigation-menu** - NavigationMenu
|
|
155
|
-
- **breadcrumb** - Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator, BreadcrumbPage
|
|
156
|
-
- **pagination** - Pagination
|
|
157
|
-
- **sidebar** - Sidebar, SidebarProvider, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarTrigger
|
|
158
|
-
- **button-group** - ButtonGroup, ButtonGroupText, ButtonGroupSeparator
|
|
159
|
-
|
|
160
|
-
### Date Picking
|
|
161
|
-
|
|
162
|
-
- **calendar** - Calendar
|
|
163
|
-
- **range-calendar** - RangeCalendar
|
|
164
|
-
|
|
165
|
-
### Feedback
|
|
166
|
-
|
|
167
|
-
- **alert** - Alert, AlertTitle, AlertDescription
|
|
168
|
-
|
|
169
|
-
## Example: Sensor Card Pattern
|
|
170
|
-
|
|
171
|
-
```svelte
|
|
172
|
-
<script>
|
|
173
|
-
import { cn } from '$lib/utils.js';
|
|
174
|
-
import { Card, CardHeader, CardTitle, CardContent } from '$lib/components/ui/primitives/card/index.js';
|
|
175
|
-
import * as Chart from '$lib/components/ui/primitives/chart/index.js';
|
|
176
|
-
|
|
177
|
-
let { title = 'SENSOR', icon: Icon, data = [], class: className, ...restProps } = $props();
|
|
178
|
-
</script>
|
|
179
|
-
|
|
180
|
-
<Card class={cn('p-4', className)} {...restProps}>
|
|
181
|
-
<CardHeader class="flex flex-row items-center justify-between p-0">
|
|
182
|
-
<CardTitle class="text-foreground font-mono text-base uppercase">
|
|
183
|
-
{title}
|
|
184
|
-
</CardTitle>
|
|
185
|
-
{#if Icon}
|
|
186
|
-
<Icon class="text-muted-foreground size-6" aria-hidden="true" />
|
|
187
|
-
{/if}
|
|
188
|
-
</CardHeader>
|
|
189
|
-
<CardContent class="p-0">
|
|
190
|
-
<Chart.Container config={{}} class="h-[220px] w-full">
|
|
191
|
-
<!-- chart content -->
|
|
192
|
-
</Chart.Container>
|
|
193
|
-
</CardContent>
|
|
194
|
-
</Card>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## Detailed Conventions
|
|
198
|
-
|
|
199
|
-
See `@rules/components.md` for:
|
|
200
|
-
|
|
201
|
-
- bits-ui wrapper patterns
|
|
202
|
-
- tailwind-variants (tv) usage
|
|
203
|
-
- Conditional rendering patterns
|
|
204
|
-
- Icon handling
|