@usevyre/ai-context 0.1.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.
@@ -0,0 +1,293 @@
1
+ # useVyre Rules for Windsurf
2
+
3
+ # useVyre Design System — AI Context
4
+ # Version: 0.1.0
5
+ # Include this file in your AI agent's system prompt, .cursor/rules, or CLAUDE.md
6
+ # Source: https://usevyre.com/ai-context
7
+
8
+ ---
9
+
10
+ ## What is useVyre?
11
+
12
+ useVyre is an AI-native design system for React and Vue. It uses CSS custom properties
13
+ (variables) as its single source of truth, making it inherently AI-friendly — no magic,
14
+ no runtime transforms, just semantic token names that describe intent.
15
+
16
+ ---
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ # Tokens (required by everything)
22
+ pnpm add @usevyre/tokens
23
+
24
+ # React components
25
+ pnpm add @usevyre/react
26
+
27
+ # Vue components
28
+ pnpm add @usevyre/vue
29
+ ```
30
+
31
+ ## CSS Setup
32
+
33
+ ```css
34
+ /* In your global CSS entry point */
35
+ @import "@usevyre/tokens/css"; /* design tokens */
36
+ @import "@usevyre/react/styles"; /* component styles (React) */
37
+ /* or */
38
+ @import "@usevyre/vue/styles"; /* component styles (Vue) */
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Token Naming Convention
44
+
45
+ ALL tokens follow this pattern:
46
+ ```
47
+ --vyre-[category]-[subcategory]-[variant]
48
+ ```
49
+
50
+ Examples:
51
+ - `--vyre-color-semantic-accent` ✅ Use this
52
+ - `--vyre-color-primitive-amber-400` ❌ Never use primitives in components
53
+ - `--vyre-spacing-4` ✅ 16px spacing
54
+ - `--vyre-typography-font-size-sm` ✅ 13px font size
55
+
56
+ ---
57
+
58
+ ## Semantic Color Tokens (use these in ALL component styling)
59
+
60
+ ### Surface layers (background → foreground)
61
+ - `--vyre-color-semantic-background` Page background. Deepest layer.
62
+ - `--vyre-color-semantic-surface` Cards, panels, sidebars.
63
+ - `--vyre-color-semantic-surface-raised` Dropdowns, inputs, elevated cards.
64
+ - `--vyre-color-semantic-surface-overlay` Modals, tooltips.
65
+
66
+ ### Borders
67
+ - `--vyre-color-semantic-border-subtle` Dividers, subtle separators.
68
+ - `--vyre-color-semantic-border` Default card/input borders.
69
+ - `--vyre-color-semantic-border-strong` Focus rings, selected states.
70
+
71
+ ### Text hierarchy
72
+ - `--vyre-color-semantic-text-primary` Headings, body text.
73
+ - `--vyre-color-semantic-text-secondary` Subtitles, descriptions.
74
+ - `--vyre-color-semantic-text-muted` Placeholders, helper text.
75
+ - `--vyre-color-semantic-text-disabled` Disabled state text.
76
+ - `--vyre-color-semantic-text-inverse` Text on light/accent backgrounds.
77
+
78
+ ### Brand colors
79
+ - `--vyre-color-semantic-accent` Primary CTA, highlights. (amber)
80
+ - `--vyre-color-semantic-accent-hover` Hover for accent elements.
81
+ - `--vyre-color-semantic-accent-subtle` Low-opacity accent backgrounds.
82
+ - `--vyre-color-semantic-teal` Secondary accent. Code, success. (teal)
83
+ - `--vyre-color-semantic-teal-hover` Hover for teal elements.
84
+ - `--vyre-color-semantic-teal-subtle` Low-opacity teal backgrounds.
85
+
86
+ ### Semantic status colors
87
+ - `--vyre-color-semantic-success` Confirmations, complete states.
88
+ - `--vyre-color-semantic-success-subtle` Success badge backgrounds.
89
+ - `--vyre-color-semantic-warning` Warnings, beta indicators.
90
+ - `--vyre-color-semantic-warning-subtle` Warning badge backgrounds.
91
+ - `--vyre-color-semantic-danger` Errors, destructive actions.
92
+ - `--vyre-color-semantic-danger-hover` Hover for danger elements.
93
+ - `--vyre-color-semantic-danger-subtle` Error badge backgrounds.
94
+
95
+ ---
96
+
97
+ ## Typography Tokens
98
+
99
+ ### Font families
100
+ - `--vyre-typography-font-family-display` Headlines, hero text (serif)
101
+ - `--vyre-typography-font-family-body` UI text, labels, body copy (sans-serif)
102
+ - `--vyre-typography-font-family-mono` Code, tokens, technical text (monospace)
103
+
104
+ ### Font sizes
105
+ - `--vyre-typography-font-size-2xs` 10px — tiny labels
106
+ - `--vyre-typography-font-size-xs` 11px — badge text, captions
107
+ - `--vyre-typography-font-size-sm` 13px — default UI text, buttons
108
+ - `--vyre-typography-font-size-md` 15px — body text
109
+ - `--vyre-typography-font-size-lg` 18px — large body, small headings
110
+ - `--vyre-typography-font-size-xl` 22px — section headings
111
+ - `--vyre-typography-font-size-2xl` 28px — page headings
112
+ - `--vyre-typography-font-size-3xl` 36px — large headings
113
+ - `--vyre-typography-font-size-4xl` 48px — hero headings
114
+ - `--vyre-typography-font-size-5xl` 64px — display headings
115
+
116
+ ### Font weights
117
+ - `--vyre-typography-font-weight-light` 300
118
+ - `--vyre-typography-font-weight-regular` 400
119
+ - `--vyre-typography-font-weight-medium` 500
120
+ - `--vyre-typography-font-weight-semibold` 600
121
+ - `--vyre-typography-font-weight-bold` 700
122
+
123
+ ---
124
+
125
+ ## Spacing Tokens (4px base grid)
126
+
127
+ - `--vyre-spacing-1` 4px
128
+ - `--vyre-spacing-2` 8px
129
+ - `--vyre-spacing-3` 12px
130
+ - `--vyre-spacing-4` 16px
131
+ - `--vyre-spacing-5` 20px
132
+ - `--vyre-spacing-6` 24px
133
+ - `--vyre-spacing-8` 32px
134
+ - `--vyre-spacing-10` 40px
135
+ - `--vyre-spacing-12` 48px
136
+ - `--vyre-spacing-16` 64px
137
+ - `--vyre-spacing-20` 80px
138
+ - `--vyre-spacing-24` 96px
139
+
140
+ ---
141
+
142
+ ## Border Radius Tokens
143
+
144
+ - `--vyre-border-radius-none` 0
145
+ - `--vyre-border-radius-sm` 4px — tight corners
146
+ - `--vyre-border-radius-md` 8px — default components
147
+ - `--vyre-border-radius-lg` 12px — cards, panels
148
+ - `--vyre-border-radius-xl` 16px — large cards
149
+ - `--vyre-border-radius-2xl` 24px — modals, sheets
150
+ - `--vyre-border-radius-full` 9999px — badges, pills, avatars
151
+
152
+ ---
153
+
154
+ ## Component API Reference
155
+
156
+ ### Button
157
+
158
+ ```tsx
159
+ import { Button } from "@usevyre/react"
160
+
161
+ // Props:
162
+ // variant = "primary" | "secondary" | "ghost" | "accent" | "teal" | "danger"
163
+ // size = "sm" | "md" | "lg" | "icon"
164
+ // loading = boolean
165
+ // disabled = boolean
166
+ // as = React.ElementType (default: "button")
167
+ // leftIcon = ReactNode
168
+ // rightIcon = ReactNode
169
+
170
+ // Examples:
171
+ <Button variant="accent" size="lg">Get Started</Button>
172
+ <Button variant="ghost" size="sm">Cancel</Button>
173
+ <Button variant="danger" loading>Deleting...</Button>
174
+ <Button as="a" href="/docs" variant="secondary">Read Docs</Button>
175
+ ```
176
+
177
+ ### Badge
178
+
179
+ ```tsx
180
+ import { Badge } from "@usevyre/react"
181
+
182
+ // Props:
183
+ // variant = "default" | "accent" | "teal" | "success" | "warning" | "danger"
184
+ // dot = boolean (live status indicator dot)
185
+
186
+ // Examples:
187
+ <Badge variant="success" dot>Online</Badge>
188
+ <Badge variant="warning">Beta</Badge>
189
+ <Badge variant="danger">Error</Badge>
190
+ ```
191
+
192
+ ### Card
193
+
194
+ ```tsx
195
+ import { Card, CardHeader, CardBody, CardFooter } from "@usevyre/react"
196
+
197
+ // Card props:
198
+ // variant = "default" | "elevated" | "outlined" | "ghost" | "accent"
199
+ // hoverable = boolean
200
+ // clickable = boolean
201
+
202
+ // Examples:
203
+ <Card variant="elevated">
204
+ <CardHeader>
205
+ <Badge variant="teal">New</Badge>
206
+ </CardHeader>
207
+ <CardBody>
208
+ <h3>Card Title</h3>
209
+ <p>Description text.</p>
210
+ </CardBody>
211
+ <CardFooter>
212
+ <Button variant="ghost" size="sm">Learn more</Button>
213
+ </CardFooter>
214
+ </Card>
215
+ ```
216
+
217
+ ### Field + Input + Textarea
218
+
219
+ ```tsx
220
+ import { Field, Input, Textarea } from "@usevyre/react"
221
+
222
+ // Field props:
223
+ // label = string
224
+ // hint = string
225
+ // state = "idle" | "error" | "success" | "warning"
226
+ // required = boolean
227
+
228
+ // Input props:
229
+ // size = "sm" | "md" | "lg"
230
+ // leftElement = ReactNode
231
+ // rightElement = ReactNode
232
+ // + all native input props
233
+
234
+ // Examples:
235
+ <Field label="Email" state="error" hint="Invalid format">
236
+ <Input type="email" placeholder="you@example.com" />
237
+ </Field>
238
+
239
+ <Field label="Search">
240
+ <Input leftElement={<SearchIcon />} placeholder="Search..." />
241
+ </Field>
242
+
243
+ <Field label="Bio">
244
+ <Textarea rows={4} placeholder="Tell us about yourself..." />
245
+ </Field>
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Styling Rules for AI Agents
251
+
252
+ 1. ALWAYS use semantic tokens (`--vyre-color-semantic-*`), never primitive tokens
253
+ 2. NEVER hardcode colors — every color decision has a semantic token
254
+ 3. Text hierarchy: `text-primary` → `text-secondary` → `text-muted` → `text-disabled`
255
+ 4. Interactive hover states: add `-hover` suffix to base token
256
+ 5. Low-opacity backgrounds: use `-subtle` suffix tokens
257
+ 6. Spacing: always use `--vyre-spacing-*` — never raw px values in component code
258
+ 7. Transitions: use `--vyre-transition-duration-*` and `--vyre-transition-easing-*`
259
+
260
+ ---
261
+
262
+ ## Common Patterns
263
+
264
+ ### Page layout with sidebar
265
+ ```tsx
266
+ <div style={{ display: "grid", gridTemplateColumns: "260px 1fr", minHeight: "100vh" }}>
267
+ <aside style={{ background: "var(--vyre-color-semantic-surface)", borderRight: "1px solid var(--vyre-color-semantic-border-subtle)" }}>
268
+ {/* sidebar content */}
269
+ </aside>
270
+ <main style={{ padding: "var(--vyre-spacing-12)" }}>
271
+ {/* main content */}
272
+ </main>
273
+ </div>
274
+ ```
275
+
276
+ ### Form with validation
277
+ ```tsx
278
+ <form>
279
+ <Field label="Email" state={errors.email ? "error" : "idle"} hint={errors.email}>
280
+ <Input type="email" value={email} onChange={e => setEmail(e.target.value)} />
281
+ </Field>
282
+ <Button variant="accent" type="submit" loading={isSubmitting}>
283
+ Submit
284
+ </Button>
285
+ </form>
286
+ ```
287
+
288
+ ### Status badge with live indicator
289
+ ```tsx
290
+ <Badge variant="success" dot>Live</Badge>
291
+ <Badge variant="danger" dot>Offline</Badge>
292
+ <Badge variant="warning">Beta</Badge>
293
+ ```
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@usevyre/ai-context",
3
+ "version": "0.1.0",
4
+ "description": "useVyre AI context — inject into LLM system prompts to eliminate UI hallucinations",
5
+ "keywords": [
6
+ "design-system",
7
+ "ai",
8
+ "llm",
9
+ "context",
10
+ "vyre"
11
+ ],
12
+ "license": "MIT",
13
+ "type": "module",
14
+ "exports": {
15
+ ".": "./dist/index.js",
16
+ "./cursor": "./dist/cursor-rules.md",
17
+ "./claude": "./dist/claude-context.md",
18
+ "./windsurf": "./dist/windsurf-rules.md",
19
+ "./copilot": "./dist/copilot-instructions.md",
20
+ "./full": "./dist/full-context.md"
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "scripts": {
26
+ "build": "node scripts/build.js",
27
+ "clean": "rm -rf dist"
28
+ }
29
+ }