@vadimcomanescu/nadicode-design-system 4.0.1 → 4.0.3

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.
Files changed (39) hide show
  1. package/.agents/skills/seed/SKILL.md +34 -163
  2. package/.agents/skills/seed/references/animation.md +2 -2
  3. package/.agents/skills/seed/references/responsive.md +1 -1
  4. package/README.md +2 -2
  5. package/eslint-rules/nadicode/config.js +0 -1
  6. package/eslint-rules/nadicode/index.js +0 -2
  7. package/eslint-rules/nadicode/rules/no-has-svg-selector.js +1 -1
  8. package/package.json +1 -2
  9. package/scripts/ds-check.mjs +0 -10
  10. package/scripts/ds-update.mjs +52 -14
  11. package/scripts/sync-seed-skill.mjs +0 -3
  12. package/.agents/skills/seed/contract.md +0 -110
  13. package/.agents/skills/seed/intent-map.md +0 -320
  14. package/.agents/skills/seed/recipes/agency-home.md +0 -311
  15. package/.agents/skills/seed/recipes/agents-chat.md +0 -305
  16. package/.agents/skills/seed/recipes/analytics.md +0 -253
  17. package/.agents/skills/seed/recipes/auth.md +0 -254
  18. package/.agents/skills/seed/recipes/blog-content.md +0 -307
  19. package/.agents/skills/seed/recipes/checkout.md +0 -311
  20. package/.agents/skills/seed/recipes/company-about.md +0 -276
  21. package/.agents/skills/seed/recipes/company-contact.md +0 -234
  22. package/.agents/skills/seed/recipes/crud-form.md +0 -233
  23. package/.agents/skills/seed/recipes/crud-list-detail.md +0 -230
  24. package/.agents/skills/seed/recipes/dashboard.md +0 -354
  25. package/.agents/skills/seed/recipes/digital-workers.md +0 -314
  26. package/.agents/skills/seed/recipes/error-pages.md +0 -199
  27. package/.agents/skills/seed/recipes/marketing-landing.md +0 -293
  28. package/.agents/skills/seed/recipes/marketing-shell.md +0 -156
  29. package/.agents/skills/seed/recipes/navigation-shell.md +0 -787
  30. package/.agents/skills/seed/recipes/onboarding.md +0 -258
  31. package/.agents/skills/seed/recipes/pricing.md +0 -271
  32. package/.agents/skills/seed/recipes/service-detail.md +0 -302
  33. package/.agents/skills/seed/recipes/settings.md +0 -252
  34. package/.agents/skills/seed/references/blocks.md +0 -128
  35. package/.agents/skills/seed/references/components.md +0 -287
  36. package/.agents/skills/seed/references/icons.md +0 -169
  37. package/.agents/skills/seed/references/nextjs.md +0 -49
  38. package/.agents/skills/seed/references/tokens.md +0 -88
  39. package/eslint-rules/nadicode/rules/no-deprecated-ds-import.js +0 -77
@@ -3,8 +3,8 @@ name: Seed Design System
3
3
  description: >
4
4
  Use when building UI with the Seed Design System or composing full pages from
5
5
  Seed components. Covers tokens, components, glass effects, animations,
6
- dual-axis theming, page recipes, and Next.js App Router integration.
7
- tags: [seed, design-system, arctic-glow, react, tailwind, radix, glassmorphism, recipes]
6
+ dual-axis theming, page-kits, and Next.js App Router integration.
7
+ tags: [seed, design-system, arctic-glow, react, tailwind, radix, glassmorphism, page-kits]
8
8
  ---
9
9
 
10
10
  # Seed Design System -- Agent Skill
@@ -44,55 +44,11 @@ const { LoginBlock, DashboardPageKit } = seedComponents
44
44
 
45
45
  **UI primitives** (Button, Heading, Input, etc.), icons, charts, and effects are imported via individual subpath exports. They are not registered in the catalog.
46
46
 
47
- See the full Import Rules in `contract.md`.
48
-
49
- The derived references under `references/components.md` and `references/blocks.md` are generated from the catalog. Any repo `Path` column there is a maintainer source path, not a consumer import path.
50
-
51
47
  ## Read Order
52
48
 
53
- 1. **This file** -- router, quick references, forbidden patterns
54
- 2. **`contract.md`** -- binary rules, package integration contract
55
- 3. **catalog** (`@vadimcomanescu/nadicode-design-system/catalog`) -- machine-readable component metadata (variants, props, tiers)
56
- 4. **`intent-map.md`** -- intent decision tree + recipe index
57
- 6. **`recipes/<page-type>.md`** -- matching recipe for your page
58
- 7. **`references/`** -- deep dives as needed
59
- 8. **`references/brand-override.md`** -- palette-only brand customization guide for seeded apps
60
-
61
- ---
62
-
63
- ## Intent Decision Tree
64
-
65
- What are you building? Follow the tree to find your recipe.
66
-
67
- ```
68
- Does user have a session?
69
- YES --> app-shell intents:
70
- dashboard .......... recipes/dashboard.md
71
- CRUD list/detail ... recipes/crud-list-detail.md
72
- CRUD form .......... recipes/crud-form.md
73
- settings ........... recipes/settings.md
74
- analytics .......... recipes/analytics.md
75
- agents/chat ........ recipes/agents-chat.md
76
- navigation shell ... recipes/navigation-shell.md
77
- NO --> auth?
78
- YES --> recipes/auth.md (auth-shell)
79
- onboarding?
80
- YES --> recipes/onboarding.md (onboarding-shell)
81
- marketing intents (marketing-shell):
82
- agency home ...... recipes/agency-home.md
83
- landing .......... recipes/marketing-landing.md
84
- digital workers .. recipes/digital-workers.md
85
- service detail ... recipes/service-detail.md
86
- pricing .......... recipes/pricing.md
87
- blog/content ..... recipes/blog-content.md
88
- about/team ....... recipes/company-about.md
89
- contact .......... recipes/company-contact.md
90
- checkout ......... recipes/checkout.md
91
- marketing shell .. recipes/marketing-shell.md
92
- error pages --> recipes/error-pages.md (fallback-shell)
93
- ```
94
-
95
- Full intent-to-recipe mapping with shell selection: see `intent-map.md`.
49
+ 1. **This file** -- router, quick references, forbidden patterns, binary rules
50
+ 2. **catalog** (`@vadimcomanescu/nadicode-design-system/catalog`) -- machine-readable component metadata (variants, props, tiers)
51
+ 3. **`references/`** -- deep dives as needed
96
52
 
97
53
  ---
98
54
 
@@ -115,6 +71,28 @@ Full intent-to-recipe mapping with shell selection: see `intent-map.md`.
115
71
  | CSS hex in vars: `--color-bg: #0F1114` | `--color-background: 15 17 20` | CSS vars use space-separated RGB |
116
72
  | Block without `interface *Props` | `interface MyBlockProps { title?: string }` | Integrity test enforces |
117
73
  | Required content props | Optional with defaults in destructuring | Blocks render standalone |
74
+ | Inline/floating labels | `Label` above control (stacked) | Form convention |
75
+ | `text-[10px]`, `text-[11px]` | `text-xs`, `text-sm`, `Heading`, `Typography` | No arbitrary text sizes |
76
+ | Ad-hoc `chat-*` classes | Compose Seed primitives + motion tokens | No custom chat classes |
77
+ | `import { BarChart } from "recharts"` | `import { BarChart } from "@vadimcomanescu/nadicode-design-system/charts"` | No direct recharts |
78
+ | Ad-hoc Card + value for KPIs | `MetricCard` | Use the DS component |
79
+ | Hex/rgb in chart config | `var(--color-chart-N)` tokens | Chart colors are tokenized |
80
+ | Generic English defaults | Override ALL default copy per brand | No shipping placeholder text |
81
+ | Hardcoded hex in components | Map to semantic tokens | Brand colors via tokens only |
82
+
83
+ ---
84
+
85
+ ## Brand Customization
86
+
87
+ Override all default copy. Map brand colors to semantic tokens. Verify contrast (WCAG AA: 4.5:1 body, 3:1 large). See `references/brand-override.md` for glass intensity presets.
88
+
89
+ ## Dashboard Rules
90
+
91
+ KPI cards: `MetricCard`. Charts: empty-data guard required (`data.length > 0`). Chart colors: `var(--color-chart-N)` tokens. Import from `./charts`, never `recharts` directly. Sidebar navigation must include IA grouping with `SidebarGroupLabel`.
92
+
93
+ ## Admin Chat
94
+
95
+ Chat features must include all three agentic layers: Conversation, Tooling, Traceability. See catalog for available components in each layer. Analytics must use Seed chart primitives.
118
96
 
119
97
  ---
120
98
 
@@ -134,7 +112,7 @@ Full intent-to-recipe mapping with shell selection: see `intent-map.md`.
134
112
 
135
113
  **Sidebar:** `sidebar`, `sidebar-foreground`, `sidebar-primary`, `sidebar-accent`, `sidebar-border`, `sidebar-ring`
136
114
 
137
- Full token tables with CSS variables and Radix scales: `references/tokens.md`
115
+ Token source of truth: `src/lib/tokens.config.js` (authored), `src/index.css` (generated).
138
116
 
139
117
  ---
140
118
 
@@ -225,13 +203,7 @@ import { motionSpring, fadeInUp, blockStagger } from "@/lib/motion"
225
203
 
226
204
  ### Spring Presets
227
205
 
228
- | Name | Stiffness | Damping | Mass | Use For |
229
- |------|-----------|---------|------|---------|
230
- | `snappy` | 400 | 28 | 0.8 | Micro-interactions, tooltips |
231
- | `gentle` | 200 | 20 | 1.0 | Page transitions, drawers |
232
- | `bouncy` | 300 | 14 | 0.8 | Celebration, completion |
233
- | `dramatic` | 500 | 24 | 1.2 | Hero entrances |
234
- | `wobbly` | bloom only | | | Extra bounce |
206
+ `snappy` (micro-interactions), `gentle` (page transitions), `bouncy` (celebration), `dramatic` (hero entrances), `wobbly` (bloom only). Full values: `references/animation.md`.
235
207
 
236
208
  ### Duration Tokens
237
209
 
@@ -269,19 +241,7 @@ import { SettingsIcon, BellIcon } from "@vadimcomanescu/nadicode-design-system/i
269
241
 
270
242
  **Total: 399 icons.** Before adding a new icon, check whether it already exports from `@vadimcomanescu/nadicode-design-system/icons` or a matching `@vadimcomanescu/nadicode-design-system/icons/<name>` subpath.
271
243
 
272
- ### Adding a New Icon
273
-
274
- 1. **Check if it exists** (399 total -- likely yes).
275
- 2. **If missing:** add it to `lucide-wrapped.tsx` using `createAnimatedIcon`:
276
- ```tsx
277
- import { Home } from "lucide-react"
278
- export const HomeIcon = createAnimatedIcon(Home, "HomeIcon")
279
- ```
280
- 3. **If the needed icon is missing**, stop and request an upstream DS export. Do not hand-craft a local scaffold copy just to bypass the package contract.
281
-
282
- `createAnimatedIcon` is also exported for consumers to wrap any Lucide icon ad-hoc without adding it to the catalog.
283
-
284
- Full catalog: `references/icons.md`
244
+ If an icon is missing, add it to `lucide-wrapped.tsx` via `createAnimatedIcon`. Do not hand-craft local copies to bypass the package contract.
285
245
 
286
246
  ---
287
247
 
@@ -330,6 +290,8 @@ Every page = **Shell > Sections > Components**.
330
290
  - 2-8 sections (vertical bands, no nesting)
331
291
  - 1-6 components per section via CSS grid/flex
332
292
 
293
+ Page-kits in the catalog ARE the ready-made compositions. Use `seedComponents.<Name>PageKit` from `@vadimcomanescu/nadicode-design-system/catalog/components` rather than assembling pages by hand.
294
+
333
295
  ### Shell Selection
334
296
 
335
297
  | Intent | Shell | Components |
@@ -342,68 +304,9 @@ Every page = **Shell > Sections > Components**.
342
304
 
343
305
  Content widths, vertical rhythm, responsive contracts: `references/composition.md`
344
306
 
345
- ### Kanban Board (Drag & Drop)
346
-
347
- Compound component for multi-column sortable boards (project boards, runs views, pipelines).
348
-
349
- ```tsx
350
- import { seedComponents } from "@vadimcomanescu/nadicode-design-system/catalog/components"
351
- const { KanbanBoard: kanban } = seedComponents
352
- const { KanbanBoard, KanbanColumn, KanbanColumnHeader, KanbanItem, KanbanHandle } = kanban
353
- import type { KanbanColumnState, KanbanMoveMeta } from '@vadimcomanescu/nadicode-design-system/kanban-board'
354
- ```
355
-
356
- **Architecture:** `@dnd-kit/core` + `@dnd-kit/sortable` internally. Consumer API is Seed-owned (no dnd-kit types leak).
307
+ ### Kanban Board
357
308
 
358
- **Usage:**
359
-
360
- ```tsx
361
- type Task = { id: string; title: string }
362
-
363
- const [columns, setColumns] = useState<KanbanColumnState<Task>[]>([
364
- { id: 'todo', items: [{ id: '1', title: 'Task A' }] },
365
- { id: 'done', items: [] },
366
- ])
367
-
368
- <KanbanBoard
369
- value={columns}
370
- onValueChange={(next, meta) => {
371
- setColumns([...next])
372
- // meta: { item, itemId, fromColumnId, toColumnId, fromIndex, toIndex }
373
- }}
374
- getItemId={(task) => task.id}
375
- getItemLabel={(task) => task.title}
376
- canMove={({ fromColumnId, toColumnId }) => isAllowed(fromColumnId, toColumnId)}
377
- renderOverlay={(task) => <MyCard task={task} />}
378
- >
379
- {columns.map((col) => (
380
- <KanbanColumn key={col.id} id={col.id} items={col.items} aria-label={col.name}>
381
- <KanbanColumnHeader>{col.name} <Badge variant="outline">{col.items.length}</Badge></KanbanColumnHeader>
382
- {col.items.map((task) => (
383
- <KanbanItem key={task.id} value={task}>
384
- <KanbanHandle aria-label={`Move ${task.title}`} />
385
- <MyCard task={task} />
386
- </KanbanItem>
387
- ))}
388
- </KanbanColumn>
389
- ))}
390
- </KanbanBoard>
391
- ```
392
-
393
- **Key props:**
394
-
395
- | Prop | Required | Purpose |
396
- |------|----------|---------|
397
- | `value` | Yes | `KanbanColumnState<T>[]` -- controlled column state |
398
- | `onValueChange` | Yes | `(next, meta) => void` -- fires with new state + move metadata |
399
- | `getItemId` | Yes | Extract stable ID from item |
400
- | `getItemLabel` | No | Human label for screen reader announcements |
401
- | `canMove` | No | Constraint callback to reject moves |
402
- | `renderOverlay` | No | Custom drag ghost (renders inside `glass-floating`) |
403
- | `activationDistance` | No | Px before drag starts (default: 5) |
404
- | `items` on Column | Yes | Pass the column's items array for SortableContext |
405
-
406
- **Card content is consumer-owned.** The DS provides the board structure, drag mechanics, glass styling, and accessibility. Compose card interiors from existing DS primitives: `Badge`, `StatusDot`, `Typography`, `Button`, `Avatar`.
309
+ Compound component via `seedComponents`. Uses `@dnd-kit` internally (no dnd-kit types leak). Card content is consumer-owned. See catalog entry for full props and sub-components. Types: `@vadimcomanescu/nadicode-design-system/kanban-board`.
407
310
 
408
311
  ---
409
312
 
@@ -416,46 +319,14 @@ Patterns: `references/state-machines.md`
416
319
 
417
320
  ---
418
321
 
419
- ## Recipe Index
420
-
421
- | Intent | Recipe | Shell |
422
- |--------|--------|-------|
423
- | Dashboard | `recipes/dashboard.md` | app-shell |
424
- | Marketing Landing | `recipes/marketing-landing.md` | marketing-shell |
425
- | Agency Home | `recipes/agency-home.md` | marketing-shell |
426
- | Digital Workers | `recipes/digital-workers.md` | marketing-shell |
427
- | Service Detail | `recipes/service-detail.md` | marketing-shell |
428
- | CRUD List + Detail | `recipes/crud-list-detail.md` | app-shell |
429
- | CRUD Form | `recipes/crud-form.md` | app-shell |
430
- | Settings | `recipes/settings.md` | app-shell |
431
- | Auth | `recipes/auth.md` | auth-shell |
432
- | Onboarding | `recipes/onboarding.md` | onboarding-shell |
433
- | Pricing | `recipes/pricing.md` | marketing-shell |
434
- | Analytics | `recipes/analytics.md` | app-shell |
435
- | Agent Chat | `recipes/agents-chat.md` | app-shell |
436
- | Error Pages | `recipes/error-pages.md` | fallback-shell |
437
- | Navigation Shell | `recipes/navigation-shell.md` | app-shell |
438
- | Blog / Content | `recipes/blog-content.md` | marketing-shell |
439
- | Company About | `recipes/company-about.md` | marketing-shell |
440
- | Company Contact | `recipes/company-contact.md` | marketing-shell |
441
- | Marketing Shell | `recipes/marketing-shell.md` | marketing-shell |
442
- | Checkout | `recipes/checkout.md` | marketing-shell |
443
-
444
- ---
445
-
446
322
  ## Reference Index
447
323
 
448
324
  | File | Contents |
449
325
  |------|----------|
450
- | `references/tokens.md` | Radix scales, semantic token map, CSS variables, bloom palette |
451
- | `references/components.md` | All UI components with tiers inline, Radix primitives, agentic UI |
452
326
  | `references/patterns.md` | Golden pattern + 4 code examples: Button, Input, Dialog, LoginBlock |
453
327
  | `references/animation.md` | Springs, easings, durations, stagger, choreography, reduced motion |
454
328
  | `references/glass-and-effects.md` | Glass tier CSS, decorative components, text effects, shaders |
455
- | `references/blocks.md` | Blocks by domain with import paths |
456
- | `references/icons.md` | Animated icon usage patterns |
457
329
  | `references/opinions.md` | Decision tables from Opinions Bible |
458
- | `references/nextjs.md` | App Router setup, providers, SSR boundaries, showcase |
459
330
  | `references/composition.md` | Layout algebra, spacing, grid patterns, content widths |
460
331
  | `references/responsive.md` | Breakpoint contracts, mobile-first, touch targets |
461
332
  | `references/state-machines.md` | State machines, loading tiers, streaming, error handling |
@@ -90,7 +90,7 @@ What is the element?
90
90
 
91
91
  ## Storyboard Format
92
92
 
93
- Every recipe includes an animation storyboard:
93
+ Animation storyboard format (use when documenting page-kit entrance sequences):
94
94
 
95
95
  ```
96
96
  ANIMATION STORYBOARD
@@ -254,7 +254,7 @@ When `prefers-reduced-motion` is active:
254
254
  - ScrollFadeIn elements visible immediately
255
255
  - Continuous animations (aurora, shimmer, meteor) paused via CSS
256
256
 
257
- Every recipe storyboard includes a `REDUCED` line specifying fallback behavior.
257
+ Every storyboard includes a `REDUCED` line specifying fallback behavior when `prefers-reduced-motion` is active.
258
258
 
259
259
  ---
260
260
 
@@ -17,7 +17,7 @@ Breakpoint contracts, mobile-first patterns, touch targets, and responsive rules
17
17
 
18
18
  **Design priority**: Mobile-first. Default styles target mobile, add complexity at breakpoints.
19
19
 
20
- **Primary breakpoints** (used in recipes): default, `sm:`, `lg:`, `xl:`. Use `md:` and `2xl:` sparingly.
20
+ **Primary breakpoints**: default, `sm:`, `lg:`, `xl:`. Use `md:` and `2xl:` sparingly.
21
21
 
22
22
  ---
23
23
 
package/README.md CHANGED
@@ -15,12 +15,13 @@ The dev server runs on `http://localhost:5001` and serves the showcase routes un
15
15
 
16
16
  Consumer apps install Seed through an exact released package version. For unpublished local work, stage a tarball under `.nadicode/packages/` and install that committed relative artifact instead. Do not point apps at a live DS repo directory.
17
17
 
18
+ Component discovery and consumption go through the catalog. Blocks and page-kits have no individual subpath exports.
19
+
18
20
  Canonical consumer docs:
19
21
 
20
22
  - [docs/nadicode/SCAFFOLDING_PROCESS.md](docs/nadicode/SCAFFOLDING_PROCESS.md), normative runtime and ownership contract
21
23
  - [docs/nadicode/ADOPTION_PLAYBOOK.md](docs/nadicode/ADOPTION_PLAYBOOK.md), step-by-step install and wiring flow
22
24
  - [.agents/skills/seed/SKILL.md](.agents/skills/seed/SKILL.md), synced agent-facing usage guide
23
- - [.agents/skills/seed/contract.md](.agents/skills/seed/contract.md), synced binary consumer rules
24
25
 
25
26
  ## Canonical Sources
26
27
 
@@ -31,7 +32,6 @@ The repo treats structured truth and prose differently.
31
32
  - Public package surface lives in `package.json` exports, `src/catalog/catalog.ts`, and `bin/shipped-files.json`.
32
33
  - Consumer ownership and package-backed runtime rules live in [docs/nadicode/SCAFFOLDING_PROCESS.md](docs/nadicode/SCAFFOLDING_PROCESS.md).
33
34
  - Release steps live in [docs/releasing-package.md](docs/releasing-package.md).
34
- - Component metadata lives in `dist/catalog/catalog.js`, generated from `src/catalog/catalog.ts`.
35
35
 
36
36
  Use prose docs for guidance and rationale. Use scripts, manifests, and generated artifacts for anything that must stay machine-accurate.
37
37
 
@@ -15,7 +15,6 @@ export const nadicodeRules = {
15
15
  "nadicode/no-admin-manual-chart-bars": "error",
16
16
  "nadicode/no-app-primitive-composition": "error",
17
17
  "nadicode/no-barrel-imports": "error",
18
- "nadicode/no-deprecated-ds-import": "warn",
19
18
  "nadicode/no-derived-state-via-useeffect": "error",
20
19
  "nadicode/no-direct-lucide-import": "error",
21
20
  "nadicode/no-external-ui-library": "error",
@@ -3,7 +3,6 @@ import noAdminManualChartBars from "./rules/no-admin-manual-chart-bars.js";
3
3
  import noAppPrimitiveComposition from "./rules/no-app-primitive-composition.js";
4
4
  import noArbitraryChartColor from "./rules/no-arbitrary-chart-color.js";
5
5
  import noBarrelImports from "./rules/no-barrel-imports.js";
6
- import noDeprecatedDsImport from "./rules/no-deprecated-ds-import.js";
7
6
  import noDeprecatedSegmentConfig from "./rules/no-deprecated-segment-config.js";
8
7
  import noDerivedStateViaUseeffect from "./rules/no-derived-state-via-useeffect.js";
9
8
  import noDirectLucideImport from "./rules/no-direct-lucide-import.js";
@@ -81,7 +80,6 @@ export const nadicodePlugin = {
81
80
  "no-app-primitive-composition": noAppPrimitiveComposition,
82
81
  "no-arbitrary-chart-color": noArbitraryChartColor,
83
82
  "no-barrel-imports": noBarrelImports,
84
- "no-deprecated-ds-import": noDeprecatedDsImport,
85
83
  "no-deprecated-segment-config": noDeprecatedSegmentConfig,
86
84
  "no-derived-state-via-useeffect": noDerivedStateViaUseeffect,
87
85
  "no-direct-lucide-import": noDirectLucideImport,
@@ -19,7 +19,7 @@ function reportMatches(context, node, tokens) {
19
19
  context.report({
20
20
  node,
21
21
  message:
22
- "Selector '{{sel}}' breaks with animated icon wrappers. Use a data-slot sub-component instead (see golden-pattern.md).",
22
+ "Selector '{{sel}}' breaks with animated icon wrappers. Use a data-slot sub-component instead (see references/patterns.md).",
23
23
  data: { sel: hit },
24
24
  });
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vadimcomanescu/nadicode-design-system",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,6 @@
49
49
  "release-governance:baseline": "node scripts/generate-release-governance-baseline.mjs",
50
50
  "release-governance:validate": "node scripts/validate-release-governance.mjs",
51
51
  "ds:task-pack": "node scripts/ds-generate-task-pack.mjs",
52
- "docs:api": "node scripts/docs-generate-api.mjs",
53
52
  "docs:check": "node scripts/docs-check.mjs",
54
53
  "docs:inventory": "node scripts/docs-inventory.mjs",
55
54
  "release:check": "npm run contracts:check && npm run docs:check && npm run test:all",
@@ -625,16 +625,6 @@ function checkSeedSkillContract() {
625
625
  "seed-skill-missing",
626
626
  ".agents/skills/seed/SKILL.md must exist so agents know how to use the design system.",
627
627
  );
628
- expectFile(
629
- [join(root, ".agents", "skills", "seed", "contract.md")],
630
- "seed-skill-contract-missing",
631
- ".agents/skills/seed/contract.md must exist so agents know the DS rules.",
632
- );
633
- expectFile(
634
- [join(root, ".agents", "skills", "seed", "intent-map.md")],
635
- "seed-skill-intent-map-missing",
636
- ".agents/skills/seed/intent-map.md must exist so agents can map intents to recipes.",
637
- );
638
628
  }
639
629
 
640
630
  function checkForbiddenDuplicatedDocs() {
@@ -10,6 +10,10 @@ function run(command) {
10
10
  execSync(command, { cwd: process.cwd(), stdio: "inherit" });
11
11
  }
12
12
 
13
+ function runCapture(command) {
14
+ return execSync(command, { cwd: process.cwd(), encoding: "utf8" }).trim();
15
+ }
16
+
13
17
  function readPackageJson() {
14
18
  const packageJsonPath = join(process.cwd(), "package.json");
15
19
  if (!existsSync(packageJsonPath)) {
@@ -23,28 +27,62 @@ function readSeedDependency() {
23
27
  const packageJson = readPackageJson();
24
28
  const dependency = packageJson.dependencies?.[PACKAGE_NAME];
25
29
  if (dependency) {
26
- return { spec: dependency, isDevDependency: false };
30
+ return { currentSpec: dependency, isDevDependency: false };
27
31
  }
28
32
 
29
33
  const devDependency = packageJson.devDependencies?.[PACKAGE_NAME];
30
34
  if (devDependency) {
31
- return { spec: devDependency, isDevDependency: true };
35
+ return { currentSpec: devDependency, isDevDependency: true };
32
36
  }
33
37
 
34
38
  throw new Error("package.json must declare @vadimcomanescu/nadicode-design-system before ds:update can run.");
35
39
  }
36
40
 
37
- const { spec, isDevDependency } = readSeedDependency();
38
- const installTarget = `${PACKAGE_NAME}@${spec}`;
39
- const packageManagerCommand = existsSync(join(process.cwd(), "pnpm-lock.yaml"))
40
- ? `pnpm add ${isDevDependency ? "-D " : ""}${JSON.stringify(installTarget)}`
41
- : existsSync(join(process.cwd(), "yarn.lock"))
42
- ? `yarn add ${isDevDependency ? "--dev " : ""}${JSON.stringify(installTarget)}`
43
- : existsSync(join(process.cwd(), "bun.lock"))
44
- ? `bun add ${isDevDependency ? "-d " : ""}${JSON.stringify(installTarget)}`
45
- : `npm install ${isDevDependency ? "-D " : ""}${JSON.stringify(installTarget)}`;
41
+ function fetchLatestVersion() {
42
+ try {
43
+ return runCapture(`npm view ${PACKAGE_NAME} version`);
44
+ } catch {
45
+ throw new Error(`Failed to fetch latest version of ${PACKAGE_NAME} from the registry.`);
46
+ }
47
+ }
48
+
49
+ function detectPackageManager() {
50
+ if (existsSync(join(process.cwd(), "pnpm-lock.yaml"))) return "pnpm";
51
+ if (existsSync(join(process.cwd(), "yarn.lock"))) return "yarn";
52
+ if (existsSync(join(process.cwd(), "bun.lock"))) return "bun";
53
+ return "npm";
54
+ }
55
+
56
+ function buildInstallCommand(pm, target, isDevDependency) {
57
+ const devFlag = {
58
+ pnpm: isDevDependency ? "-D " : "",
59
+ yarn: isDevDependency ? "--dev " : "",
60
+ bun: isDevDependency ? "-d " : "",
61
+ npm: isDevDependency ? "-D " : "",
62
+ };
63
+
64
+ const command = {
65
+ pnpm: "pnpm add --save-exact",
66
+ yarn: "yarn add --exact",
67
+ bun: "bun add --exact",
68
+ npm: "npm install --save-exact",
69
+ };
70
+
71
+ return `${command[pm]} ${devFlag[pm]}${JSON.stringify(target)}`;
72
+ }
73
+
74
+ const { currentSpec, isDevDependency } = readSeedDependency();
75
+ const latestVersion = fetchLatestVersion();
76
+ const installTarget = `${PACKAGE_NAME}@${latestVersion}`;
77
+ const pm = detectPackageManager();
78
+
79
+ if (currentSpec === latestVersion) {
80
+ console.log(`Already on latest version (${latestVersion}). Syncing skill docs.`);
81
+ } else {
82
+ console.log(`Updating ${PACKAGE_NAME}: ${currentSpec} -> ${latestVersion}`);
83
+ run(buildInstallCommand(pm, installTarget, isDevDependency));
84
+ }
46
85
 
47
- run(packageManagerCommand);
48
- run(`node ${JSON.stringify(join(process.cwd(), "node_modules", "@vadimcomanescu/nadicode-design-system", "scripts", "sync-seed-skill.mjs"))} ${JSON.stringify(process.cwd())}`);
86
+ run(`node ${JSON.stringify(join(process.cwd(), "node_modules", PACKAGE_NAME, "scripts", "sync-seed-skill.mjs"))} ${JSON.stringify(process.cwd())}`);
49
87
 
50
- console.log("Done. Run npm run ds:check to verify.");
88
+ console.log(`Done (${latestVersion}). Run npm run ds:check to verify.`);
@@ -16,9 +16,6 @@ const targetRoot = resolve(targetArg);
16
16
  const targetDir = join(targetRoot, ".agents", "skills", "seed");
17
17
  const syncedPaths = [
18
18
  "SKILL.md",
19
- "contract.md",
20
- "intent-map.md",
21
- "recipes",
22
19
  "references",
23
20
  ];
24
21
 
@@ -1,110 +0,0 @@
1
- # Seed Contract
2
-
3
- Binary rules for consumer apps using the Seed Design System. Every rule is non-negotiable.
4
-
5
- ## Scope
6
-
7
- - Apply only to the explicit migration scope you were given.
8
- - Do not edit files outside scope unless the build is blocked by a required wiring step.
9
-
10
- ## Component Catalog
11
-
12
- The catalog is the single starting point for component discovery. Read it via the `./catalog` subpath export for the authoritative list of components, variant names, props, and tiers. Get actual React components from `./catalog/components`. Verify component names and variant values against the catalog. Do not guess variant names or prop values.
13
-
14
- ```ts
15
- // Discovery (server-safe)
16
- import { seedComponentDefinitions } from "@vadimcomanescu/nadicode-design-system/catalog"
17
-
18
- // Components (client)
19
- import { seedComponents } from "@vadimcomanescu/nadicode-design-system/catalog/components"
20
- ```
21
-
22
- ## Import Rules
23
-
24
- 1. **Blocks and page-kits**: import from `seedComponents` via `@vadimcomanescu/nadicode-design-system/catalog/components`. No individual subpath imports for blocks or page-kits.
25
- ```ts
26
- import { seedComponents } from "@vadimcomanescu/nadicode-design-system/catalog/components"
27
- const { LoginBlock, DashboardPageKit } = seedComponents
28
- ```
29
- 2. **UI primitives, charts, effects, text-effects**: import via individual subpath exports (e.g., `@vadimcomanescu/nadicode-design-system/button`, `@vadimcomanescu/nadicode-design-system/charts`). These are not in the catalog.
30
- 3. **Icons**: import from `@vadimcomanescu/nadicode-design-system/icons` or the matching `@vadimcomanescu/nadicode-design-system/icons/<name>` subpath. Never import from `lucide-react` directly.
31
- 4. **Infrastructure** (tokens.css, tailwind preset, eslint-plugin, theme-provider, messages, test, lib/*): import via subpath exports. These are configuration wiring, not component consumption.
32
- 5. Do not vendor or recreate DS runtime files inside the scaffold. If a needed primitive is missing, stop and report it. Do not invent ad-hoc replacements.
33
-
34
- ## Token Rules
35
-
36
- 4. Semantic tokens only (`bg-background`, `bg-surface`, `text-text-primary`, `border-border`, etc.).
37
- 5. Never use raw Tailwind palette classes (`bg-zinc-900`, `text-gray-500`).
38
- 6. Never use `text-foreground`, `text-muted-foreground`, or `border-error`.
39
- 7. Never use `bg-black/80` for overlays. Use `bg-overlay/80`.
40
-
41
- ## Container Rules
42
-
43
- 8. Use glass tiers for containers: `.glass-panel`, `.glass-floating`, or `.glass-overlay`.
44
-
45
- ## Form Rules
46
-
47
- 9. Stacked labels only (`Label` above control). Never inline or floating labels.
48
-
49
- ## Admin UI Rules
50
-
51
- 10. No arbitrary text sizes (`text-[10px]`, `text-[11px]`). Use `Heading`, `Typography`, or the standard Tailwind scale (`text-xs`, `text-sm`).
52
- 11. No ad-hoc `chat-*` classes. Conversation UIs must compose existing Seed primitives and motion tokens.
53
- 12. Admin chat features must include all three agentic layers:
54
- - Conversation: `Conversation`, `ChatMessage`, `ChatResponse`, `ChatGreeting`, `ChatThinkingMessage`, `ChatShimmer`, `ConversationThread`, or `AgentMessageBubble`
55
- - Tooling: `ChatToolCall`, `ChatPromptInput`, `ChatActions`, `ChatSuggestion`, `ToolCallCard`, or `ThinkingIndicator`
56
- - Traceability: `ChatReasoning`, `ChatChainOfThought`, `ChatSources`, `ChatPlan`, `ChatQueue`, `ChatConfirmation`, `ChatBranch`, `SourceCitation`, `AgentTimeline`, `WorkflowGraph`, or `HandoffIndicator`
57
- 13. Admin sidebar navigation must include IA grouping with `SidebarGroupLabel`. No flat unlabeled menus.
58
- 14. Admin analytics must use Seed chart primitives (`AreaChart`, `BarChart`, `LineChart`, `PieChart`, `ChartContainer`). No pseudo-charts from raw `<div>` bars.
59
- ## Page Composition
60
-
61
- 16. Page architecture MUST match a `page_intent` from `intent-map.md`.
62
- 17. If an intent is missing from the catalog, stop and report it. Do not improvise.
63
- 18. Routes without a mapped intent + recipe are invalid.
64
-
65
- ## Brand Customization Rules
66
-
67
- 19. Always override ALL default copy. Never ship generic English defaults from block components.
68
- 20. Always map brand colors to semantic tokens. Never hardcode hex values in components.
69
- 21. Always verify contrast ratios after color override (WCAG AA: 4.5:1 body, 3:1 large text).
70
- 22. Glass intensity must match brand personality. See `references/brand-override.md` for presets.
71
- 23. Always update `src/site.config.ts` (name, description, tagline, nav) before building pages.
72
-
73
- ## Dashboard Rules
74
-
75
- 24. Dashboard KPI cards must use `MetricCard`, not ad-hoc Card + value compositions.
76
- 25. Chart components must not be rendered without an empty-data guard (`data.length > 0` or `ChartCard`).
77
- 26. Chart color configs must use `var(--color-chart-N)` tokens, never hex/rgb/hsl literals.
78
- 27. Import chart primitives from `@vadimcomanescu/nadicode-design-system/charts` or the matching `@vadimcomanescu/nadicode-design-system/charts/<chart-name>` subpath (charts are UI primitives, not catalog items). Do not import `recharts` directly into scaffold app code.
79
-
80
- ## ESLint Rule Reference
81
-
82
- These rules are enforced at lint time (Layer 1):
83
-
84
- | Rule | Severity | What it catches |
85
- |------|----------|-----------------|
86
- | `nadicode/no-raw-recharts-import` | error | Direct `recharts` imports outside chart wrappers |
87
- | `nadicode/require-chart-empty-handler` | error | Chart rendered without data-length guard |
88
- | `nadicode/no-arbitrary-chart-color` | error | Hex/rgb/hsl in chart config instead of tokens |
89
- | `nadicode/require-dashboard-loading-skeleton` | warn | Dashboard routes missing Skeleton import |
90
- | `nadicode/require-stagger-on-metric-grid` | warn | 3+ MetricCard grid without StaggerChildren |
91
-
92
- ## i18n Test Mocking
93
-
94
- The consumer app owns `next-intl` setup, including `src/i18n/request.ts`, locale routing, `NextIntlClientProvider`, `timeZone`, and `now`. Seed only supplies DS message catalogs plus merge helpers.
95
-
96
- Consumer tests that render Seed components using `useTranslations` must provide merged messages. Use `mergeSeedMessages()` from `@vadimcomanescu/nadicode-design-system/lib/merge-messages` in `src/i18n/request.ts` to combine package-backed DS catalogs such as `@vadimcomanescu/nadicode-design-system/messages/<locale>` with `messages/<locale>.json` (consumer keys) and pass the result to your test's `NextIntlClientProvider`.
97
- When a test only needs the Seed theme/provider wrapper, import `SeedTestProvider` from `@vadimcomanescu/nadicode-design-system/test`. The showcase app may keep using `@/test/SeedTestProvider` for in-repo tests.
98
- Do not copy DS catalog files into the app.
99
-
100
- ## Done Criteria
101
-
102
- All of these must pass before a task is complete:
103
-
104
- ```bash
105
- npx tsc --noEmit
106
- npm run build
107
- npm run lint
108
- npm run test
109
- npm run ds:check
110
- ```