@behavioral-agentic-design-system/core 0.5.0 → 0.7.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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +39 -7
  3. package/scripts/bads-sync.mjs +1 -1
  4. package/scripts/build-fonts.cjs +97 -0
  5. package/scripts/build-tokens.cjs +202 -10
  6. package/src/api/brand-fonts.ts +301 -0
  7. package/src/api/brand-mark.ts +146 -0
  8. package/src/api/layers/file.ts +8 -5
  9. package/src/api/layers.ts +27 -4
  10. package/src/api/site-auth.ts +50 -0
  11. package/src/app/preview/cards/page.tsx +1 -1
  12. package/src/app/preview/components/page.tsx +78 -1
  13. package/src/app/preview/icons/page.tsx +5 -0
  14. package/src/app/shell.tsx +105 -39
  15. package/src/app/site-login/page.tsx +82 -0
  16. package/src/brand-fonts.css +5 -0
  17. package/src/components/Foundations/Motion.stories.tsx +66 -0
  18. package/src/components/brand-mark.tsx +64 -0
  19. package/src/components/customize/brand-mark-section.tsx +265 -0
  20. package/src/components/customize/font-pickers.tsx +293 -0
  21. package/src/components/customize/letter-spacing.tsx +3 -2
  22. package/src/components/customize/save-bar.tsx +11 -5
  23. package/src/components/customize/type-scale.tsx +3 -2
  24. package/src/components/customize-tab.tsx +330 -24
  25. package/src/components/dev-identity-badge.tsx +92 -0
  26. package/src/components/home-tab.tsx +1291 -380
  27. package/src/components/layers-tab.tsx +179 -12
  28. package/src/components/ui/alert.tsx +10 -2
  29. package/src/components/ui/bottom-sheet.tsx +124 -0
  30. package/src/components/ui/button.tsx +2 -2
  31. package/src/components/ui/calendar.tsx +1 -1
  32. package/src/components/ui/chart.tsx +118 -7
  33. package/src/components/ui/checkbox.tsx +3 -2
  34. package/src/components/ui/dialog.tsx +3 -3
  35. package/src/components/ui/index.ts +1 -0
  36. package/src/components/ui/radio-group.tsx +4 -3
  37. package/src/components/ui/sheet.tsx +1 -1
  38. package/src/components/ui/sidebar.tsx +6 -1
  39. package/src/components/ui/sonner.tsx +18 -0
  40. package/src/components/ui/switch.tsx +9 -3
  41. package/src/components/ui/tabs.tsx +7 -1
  42. package/src/fonts/HyperlegibleSans-Bold.woff2 +0 -0
  43. package/src/fonts/HyperlegibleSans-BoldItalic.woff2 +0 -0
  44. package/src/fonts/HyperlegibleSans-Italic.woff2 +0 -0
  45. package/src/fonts/HyperlegibleSans-Medium.woff2 +0 -0
  46. package/src/fonts/HyperlegibleSans-MediumItalic.woff2 +0 -0
  47. package/src/fonts/HyperlegibleSans-Regular.woff2 +0 -0
  48. package/src/fonts/InterVariable-Italic.woff2 +0 -0
  49. package/src/fonts/InterVariable.woff2 +0 -0
  50. package/src/fonts.css +99 -0
  51. package/src/hooks/use-global-brand-mark.ts +64 -0
  52. package/src/hooks/use-global-mono-font.ts +13 -3
  53. package/src/hooks/use-global-primary-color.ts +192 -9
  54. package/src/hooks/use-global-sans-font.ts +5 -3
  55. package/src/hooks/use-global-serif-font.ts +13 -3
  56. package/src/lib/storage.ts +29 -0
  57. package/src/lib/svg-sanitize.ts +272 -0
  58. package/src/styles.css +126 -6
  59. package/src/tokens.json +100 -9
  60. package/src/app/preview/mail/page.tsx +0 -4
  61. package/src/app/preview/pricing/page.tsx +0 -4
@@ -32,6 +32,9 @@ import {
32
32
  Combine,
33
33
  GitCompare,
34
34
  KeyRound,
35
+ ChevronRight,
36
+ MessageSquare,
37
+ Briefcase,
35
38
  } from "lucide-react";
36
39
  import { brand } from "@/brand.config";
37
40
  import {
@@ -45,10 +48,16 @@ import { Badge } from "@behavioral-agentic-design-system/core/components/ui/badg
45
48
  import { Button } from "@behavioral-agentic-design-system/core/components/ui/button";
46
49
  import { Separator } from "@behavioral-agentic-design-system/core/components/ui/separator";
47
50
  import { ScrollArea } from "@behavioral-agentic-design-system/core/components/ui/scroll-area";
51
+ import { BrandMark } from "@behavioral-agentic-design-system/core/components/brand-mark";
48
52
  import registry from "@/layer-5-component-registry/component-registry.json";
49
53
  import tokens from "@/packages/core/src/tokens.json";
50
54
  import corePkg from "@/packages/core/package.json";
51
55
  import { BadsUpdateBanner } from "@behavioral-agentic-design-system/core/components/bads-update-banner";
56
+ import { useShellNav } from "@behavioral-agentic-design-system/core/app/shell";
57
+
58
+ type HomeTabProps = {
59
+ onBrowseComponents?: () => void;
60
+ };
52
61
 
53
62
  type RegistryEntry = {
54
63
  usage?: string;
@@ -73,66 +82,149 @@ const componentCount = componentNames.length;
73
82
  const SHIPPED_LAYERS = [
74
83
  {
75
84
  n: "1",
76
- name: "Brand & Voice",
77
- note: "framework, voice, microcopy",
85
+ name: "Foundation",
86
+ note: "company, brand, voice, microcopy, personas, research, real content",
78
87
  status: "shipped",
88
+ details: [
89
+ "Strategic foundation — who the company is, who it's for, how it sounds, and the research that anchors all of it. Everything downstream is a consequence of this layer",
90
+ "Company orientation (intro.md, strategic-opportunity.md) — what the product does and why this system exists",
91
+ "Brand framework — position, story, and platform (audience, vision, promise, values, 4 personality axes)",
92
+ "Headline + microcopy banks with tone shifts by surface type",
93
+ "Three-tier personas (Primary / Secondary / Other) with goals, pain points, devices, voice modifiers, and a 5-dimension Accessibility profile (Vision / Hearing / Motor / Cognitive / Situational)",
94
+ "Two reserved stress-test personas on every fork: screen-reader user + keyboard-only user — WCAG pressure-tested at the screen layer, not only at the token layer",
95
+ "research/ sub-discipline — 5 templates (user, competitive, market, accessibility, brand-voice) that derive personas, voice rules, and references from real evidence instead of intuition",
96
+ "Persona content pool (content/personas/<slug>.json) — real names, jargon, edge cases; replaces Lorem ipsum across every prototype and story",
97
+ "Persona pressure-test prompt walks any screen first-person and ranks breaks BLOCKER → LOW",
98
+ ],
79
99
  },
80
100
  {
81
101
  n: "2",
82
102
  name: "Ethics & Responsibility",
83
- note: "decision trees, anti-patterns, AI ethics",
103
+ note: "decision trees, anti-patterns, AI ethics, futures thinking",
84
104
  status: "shipped",
105
+ details: [
106
+ "Builds user trust and protects the brand from legal + reputational risk — responsible decisions compound into loyal users",
107
+ "5 ethical principles (Transparency, Equity, Privacy-First, Consent-Driven, Anti-Dark-Patterns)",
108
+ "9 anti-patterns we never ship",
109
+ "AI labeling + algorithmic transparency rules",
110
+ "Pre-commit ethics linter",
111
+ "Futures-thinking framework with 5 lenses (Scale, Time, Adversary, Behavior, Drift) — surfaces 2nd / 3rd order harms",
112
+ "prompts/futures-check.md as a standalone run; independent-critique includes a mandatory futures pass",
113
+ ],
85
114
  },
86
115
  {
87
116
  n: "3",
88
- name: "Foundation",
89
- note: "primitives, motion, icons, a11y",
117
+ name: "Primitive Tokens",
118
+ note: "raw colors, type, spacing, motion, icons",
90
119
  status: "shipped",
120
+ details: [
121
+ "The visual primitive tier — raw colors, type sizes, spacing values, motion durations, icon strokes. Everything Layer 4 (Semantic Tokens) aliases sits here as a literal value",
122
+ "Color primitive palette in oklch (with sRGB hex fallback)",
123
+ "Type scale (xs through 8xl) with a 14px floor enforced by a11y:lint",
124
+ "Spacing scale and radius primitives",
125
+ "Motion tokens with prefers-reduced-motion respected at the base CSS layer",
126
+ "Icon system at strokeWidth 1.5 (canonical for every lucide icon in the system)",
127
+ "WCAG 2.2 AAA baseline baked in — 7:1 normal text, 4.5:1 large text, 3:1 non-text",
128
+ ],
91
129
  },
92
130
  {
93
131
  n: "4",
94
132
  name: "Semantic Tokens",
95
133
  note: "light + dark, perceptually tuned",
96
134
  status: "shipped",
135
+ details: [
136
+ "Separates design intent from component code — change a brand color once and it ripples everywhere, enabling fast visual iterations",
137
+ "Full light + dark theme pairs",
138
+ "Generated CSS variables via pnpm build:tokens",
139
+ "Perceptually tuned contrast ratios",
140
+ "Tokens.json as single source of truth",
141
+ ],
97
142
  },
98
143
  {
99
144
  n: "5",
100
145
  name: "Component Registry",
101
146
  note: `${componentCount} components, full a11y contracts`,
102
147
  status: "shipped",
148
+ details: [
149
+ "Reduces development time by providing pre-built, tested components — teams ship faster when they don't reinvent the button",
150
+ `${componentCount} components with full props + variant docs`,
151
+ "Per-component a11y contracts (role, keyboard, focus, target size)",
152
+ "Anti-patterns listed per component",
153
+ "component-registry.json as machine-readable manifest",
154
+ ],
155
+ },
156
+ {
157
+ n: "6",
158
+ name: "Patterns & Rules",
159
+ note: "decision trees for component picks",
160
+ status: "shipped",
161
+ details: [
162
+ "Provides decision trees for common UX choices — ensures consistent patterns that users recognize across surfaces",
163
+ "Decision trees for component selection",
164
+ "Pattern library for common UX flows",
165
+ ],
103
166
  },
104
167
  {
105
168
  n: "7",
106
169
  name: "Agent Interface",
107
170
  note: "rules for Cursor, Claude Code, v0",
108
171
  status: "shipped",
172
+ details: [
173
+ "Lets AI tools (Claude Code, Cursor, v0) generate code that respects the system — designs ship faster with fewer manual tweaks",
174
+ "CLAUDE.md with full agent instructions",
175
+ ".cursorrules for Cursor",
176
+ "layer-7-agent-interface/system-prompt.md and v0-system.md for v0 sessions",
177
+ "AGENTS.md with loading precedence + escalation rules",
178
+ ],
109
179
  },
110
180
  {
111
181
  n: "8",
112
182
  name: "Documentation",
113
- note: "static surface, generated from source",
183
+ note: "Storybook, preview app, capabilities index, exemplars",
114
184
  status: "shipped",
185
+ details: [
186
+ "Makes every component discoverable and learnable — designers and engineers self-serve instead of asking questions",
187
+ "Storybook coverage for every component (Default + all variants)",
188
+ "Preview app with Home, Components, Cards, Dashboard, Layers, Customize, and Icons tabs",
189
+ "Chromatic visual regression wired to CI",
190
+ "CAPABILITIES.md as the single discoverable index of every feature BADS ships",
191
+ "Per-brand exemplars/ folder — pinned 'what good looks like' screenshots with annotations",
192
+ "corrections.md — per-fork anti-pattern log read before every Path B build",
193
+ ],
115
194
  },
116
195
  {
117
- n: "10",
196
+ n: "9",
118
197
  name: "Enforcement",
119
- note: "pre-commit warnings, AI fix path",
198
+ note: "pre-commit + CI gates, rule audit",
120
199
  status: "shipped",
200
+ details: [
201
+ "Catches accessibility and brand violations before they ship — prevents costly bugs and ensures quality standards stick",
202
+ "pnpm wcag:audit — AAA contrast check on every token pair",
203
+ "pnpm a11y:lint — static scan for token violations + a11y issues",
204
+ "pnpm check:stories — blocks commits missing story updates",
205
+ "pnpm lint:bypass — flags raw card-shaped divs that bypass the <Card> primitive",
206
+ "pnpm audit:rules — every CLAUDE.md / layer-* rule must have a concrete example (CI runs --strict)",
207
+ "lint-tokens / lint-ui-contrast / lint-target-size / lint-ethics — additional source + WCAG checks",
208
+ ],
121
209
  },
122
210
  {
123
- n: "11",
211
+ n: "10",
124
212
  name: "Automate",
125
- note: "tokens build, story coverage, rename script",
213
+ note: "token build, CI workflows, scheduled loops, launchd",
126
214
  status: "shipped",
215
+ details: [
216
+ "Eliminates repetitive manual work — one token change ripples everywhere, CI catches regressions automatically",
217
+ "pnpm build:tokens regenerates styles.css + globals.css from tokens.json",
218
+ "pnpm fix:stories seeds missing story files from component source",
219
+ "Chromatic CI on every push to main",
220
+ "audit-rules CI on every PR touching CLAUDE.md or layer-*/README.md",
221
+ "Weekly digest Issue (Mondays 14:00 UTC) with ledger summaries, staleness, correction clusters",
222
+ "Monthly + quarterly Issues queue the Agent prompts for promotions, recipe mining, anti-defaults refresh",
223
+ "Local launchd plist runs pnpm aggregate weekly for cross-fork signal aggregation",
224
+ ],
127
225
  },
128
226
  ] as const;
129
227
 
130
- const DEFERRED_LAYERS = [
131
- { n: "6", name: "Patterns & Rules", note: "decision trees for component picks" },
132
- { n: "9", name: "Documentation (Advanced)", note: "search, versioning, telemetry" },
133
- { n: "12", name: "Automate (Advanced)", note: "Figma sync, agent PRs, full a11y CI" },
134
- ] as const;
135
-
136
228
  const COMPONENT_GROUPS = [
137
229
  {
138
230
  title: "Inputs",
@@ -204,6 +296,354 @@ const A11Y_COMMITMENTS = [
204
296
  },
205
297
  ];
206
298
 
299
+ const COMPONENT_ADDITION_STEPS = [
300
+ {
301
+ title: "Prove the gap",
302
+ detail:
303
+ "Start with the registry. Compose existing primitives first; add a new component only when the product need cannot be solved by an existing component or approved variant.",
304
+ icon: Combine,
305
+ },
306
+ {
307
+ title: "Write the contract",
308
+ detail:
309
+ "Document usage, props, defaults, anti-patterns, and the full a11y contract in component-registry.json before the implementation becomes public API.",
310
+ icon: Database,
311
+ },
312
+ {
313
+ title: "Build from tokens",
314
+ detail:
315
+ "Use semantic color, spacing, type, radius, shadow, and motion tokens. No hardcoded values, no one-off styling, and no component behavior outside the registry.",
316
+ icon: Palette,
317
+ },
318
+ {
319
+ title: "Story every state",
320
+ detail:
321
+ "Ship Default, variants, disabled, loading, error, empty, and realistic-use stories so Chromatic and humans can review the actual surface area.",
322
+ icon: BookOpen,
323
+ },
324
+ ] as const;
325
+
326
+ const COMPONENT_QUALITY_GATES = [
327
+ {
328
+ label: "Schema validation",
329
+ detail:
330
+ "Tokens and registry entries must stay structurally valid, so agents and humans read the same source of truth.",
331
+ icon: KeyRound,
332
+ },
333
+ {
334
+ label: "Story coverage",
335
+ detail:
336
+ "Every changed component needs matching stories before commit, including states that tend to regress quietly.",
337
+ icon: FolderGit2,
338
+ },
339
+ {
340
+ label: "Token and contrast lint",
341
+ detail:
342
+ "Hardcoded styling, low-contrast token pairs, missing labels, and source-level a11y issues are caught early.",
343
+ icon: ShieldCheck,
344
+ },
345
+ {
346
+ label: "Target-size audit",
347
+ detail:
348
+ "Interactive components are checked against the touch-target floor so small icon controls do not slip through.",
349
+ icon: Accessibility,
350
+ },
351
+ {
352
+ label: "Pixel regression",
353
+ detail:
354
+ "Storybook snapshots catch pixel-level drift across variants, themes, and viewport sizes before a visual change becomes baseline.",
355
+ icon: Eye,
356
+ },
357
+ {
358
+ label: "Route-level visual diff",
359
+ detail:
360
+ "Playwright full-page snapshots catch layout shifts that isolated component stories can miss.",
361
+ icon: GitCompare,
362
+ },
363
+ ] as const;
364
+
365
+ const CAPABILITY_SECTIONS = [
366
+ {
367
+ title: "Design exploration",
368
+ icon: Wand2,
369
+ summary:
370
+ "Direction-first builds with web research, Mobbin sweep, exemplars, anti-defaults, self + adversarial critique.",
371
+ highlights: [
372
+ "11 prompts and rules",
373
+ "Direction sketches before code on every Path B build",
374
+ "Independent critique runs adversarial review",
375
+ ],
376
+ doc: "CAPABILITIES.md → Design exploration workflow",
377
+ },
378
+ {
379
+ title: "Persona discipline",
380
+ icon: MessageSquare,
381
+ summary:
382
+ "Three-tier personas + a persona pressure-test prompt + a data-driven analyst prompt + the real-content pool.",
383
+ highlights: [
384
+ "Primary / Secondary / Other tiers per fork",
385
+ "First-person pressure test ranks breaks BLOCKER → LOW",
386
+ "Real-content pool replaces Lorem ipsum across every story and prototype",
387
+ ],
388
+ doc: "CAPABILITIES.md → Persona discipline",
389
+ },
390
+ {
391
+ title: "Component building",
392
+ icon: Package,
393
+ summary:
394
+ "The 7-phase component-builder skill, triage buckets, plan-before-code, the first-time-right checklist, useReducedMotion.",
395
+ highlights: [
396
+ "Triage buckets A/B/C/D force a bucket decision before any code",
397
+ ".scratch/components/<name>.plan.md captures API, states, story matrix, a11y contract",
398
+ "pnpm visual-diff for image-mode builds",
399
+ ],
400
+ doc: "CAPABILITIES.md → Component-building workflow",
401
+ },
402
+ {
403
+ title: "Tokens + theming",
404
+ icon: Palette,
405
+ summary:
406
+ "W3C DTCG tokens with BADS extensions, JSON schemas, chart palette derivation, Tokens Studio (Figma) integration.",
407
+ highlights: [
408
+ "BADS.wcag + BADS.modes $extensions in tokens.json",
409
+ "JSON schemas validated pre-commit",
410
+ "Tokens Studio (Figma) round-trips via DTCG without a custom export",
411
+ ],
412
+ doc: "CAPABILITIES.md → Tokens + theming",
413
+ },
414
+ {
415
+ title: "Customize tab",
416
+ icon: Sparkles,
417
+ summary:
418
+ "In-product theme editor: brand picker, per-token swatches, font picker, type scale, letter spacing, brand mark, theme IO.",
419
+ highlights: [
420
+ "AAA grade pills + warning badges on non-AAA picks",
421
+ "Type scale + letter-spacing editors with live preview",
422
+ "Brand mark editor (paste or upload SVG, sanitized + monotone-detected)",
423
+ ],
424
+ doc: "CAPABILITIES.md → Customize tab",
425
+ },
426
+ {
427
+ title: "Accessibility floor",
428
+ icon: Accessibility,
429
+ summary:
430
+ "WCAG 2.2 AAA enforced at build + audit time across token contrast, focus, target size, bypass, reduced motion.",
431
+ highlights: [
432
+ "pnpm wcag:audit blocks regressions on every commit",
433
+ "lint-target-size validates 24×24 hit area against the registry",
434
+ "lint-ui-contrast checks border/focus pairs ≥3:1",
435
+ ],
436
+ doc: "CAPABILITIES.md → Accessibility floor",
437
+ },
438
+ {
439
+ title: "Patterns + rules",
440
+ icon: Combine,
441
+ summary:
442
+ "Decision trees for disclosure, empty states, loading states, feedback, confirmation. Lazy-loaded per task.",
443
+ highlights: [
444
+ "5 canonical pattern files",
445
+ "Loaded only when triggerKeywords in patterns.json match the task",
446
+ "Manifest-driven — agents pick what to read",
447
+ ],
448
+ doc: "CAPABILITIES.md → Patterns + rules",
449
+ },
450
+ {
451
+ title: "Agent interface",
452
+ icon: Terminal,
453
+ summary:
454
+ "Single source of truth for AI tools: CLAUDE.md, manifests, AGENTS.md, .cursorrules, system-prompt, v0-system.",
455
+ highlights: [
456
+ "Three lazy-load manifests at session start (≈1k tokens each)",
457
+ "Layer files win over CLAUDE.md for in-scope rules",
458
+ "Layer 3 skill.md describes the primitive-tokens skill in machine-readable form",
459
+ ],
460
+ doc: "CAPABILITIES.md → Agent interface",
461
+ },
462
+ {
463
+ title: "Developer experience",
464
+ icon: Terminal,
465
+ summary:
466
+ "pnpm dev:fresh, predev hook, verify-served + visual verification rules, audit scripts, pre-commit orchestrator.",
467
+ highlights: [
468
+ "predev hook auto-clears stale .next state",
469
+ "Visual verification rule forces screenshot before declaring done",
470
+ ".husky/pre-commit runs the full gate suite",
471
+ ],
472
+ doc: "CAPABILITIES.md → Developer experience",
473
+ },
474
+ {
475
+ title: "CI / CD + release",
476
+ icon: GitCompare,
477
+ summary:
478
+ "Chromatic, audit-rules on PR, weekly digest, monthly + quarterly Issue openers, publish-core on tag, changesets.",
479
+ highlights: [
480
+ "audit-rules.yml blocks merges that add vague rules",
481
+ "weekly-digest.yml posts to a labeled Issue every Monday",
482
+ "publish-core.yml ships to npm on v* tags with provenance",
483
+ ],
484
+ doc: "CAPABILITIES.md → CI / CD + release",
485
+ },
486
+ {
487
+ title: "Self-improvement loops",
488
+ icon: Zap,
489
+ summary:
490
+ "Ledgers + monthly/quarterly Agent runs turn one-shot work into permanent memory across forks.",
491
+ highlights: [
492
+ "Three append-only JSONL ledgers under ledgers/",
493
+ "Monthly: promote-corrections + recipe-miner",
494
+ "Quarterly: anti-defaults refresh + staleness + cross-fork aggregator",
495
+ ],
496
+ doc: "CAPABILITIES.md → Self-improvement loops",
497
+ },
498
+ {
499
+ title: "Sync model",
500
+ icon: GitCompare,
501
+ summary:
502
+ "Two-direction sync (upstream → forks via npm; forks → upstream via PR). Cross-fork aggregator informs upstream.",
503
+ highlights: [
504
+ "pnpm bads:sync pulls the latest @<slug>/core into a fork",
505
+ "BadsUpdateBanner surfaces new releases in-product",
506
+ "Aggregator anonymizes stakeholder names before any report",
507
+ ],
508
+ doc: "CAPABILITIES.md → Sync model",
509
+ },
510
+ ] as const;
511
+
512
+ const SELF_IMPROVEMENT_LOOPS = [
513
+ {
514
+ name: "Critique ledger",
515
+ cadence: "Per critique",
516
+ where: "ledgers/critiques.jsonl",
517
+ summary:
518
+ "Every prompts/independent-critique.md run appends one row per finding. Reveals which axes the system is weakest on (typography, motion, color-as-system, etc.) so future critiques weight them higher.",
519
+ runWith: "pnpm ledger:critiques",
520
+ },
521
+ {
522
+ name: "Verdict + recipe ledger",
523
+ cadence: "Per handoff",
524
+ where: "ledgers/prototypes.jsonl",
525
+ summary:
526
+ "After every Path B handoff: route, direction, exemplars cited, round count, Sir's verdict, recipe (primitives + patterns + tokens). Ship-first recipes become templates; bounce recipes trigger interventions.",
527
+ runWith: "pnpm ledger:prototypes",
528
+ },
529
+ {
530
+ name: "Futures ledger",
531
+ cadence: "Per futures-check",
532
+ where: "ledgers/futures.jsonl",
533
+ summary:
534
+ "Records 2nd / 3rd order findings across the five lenses (Scale, Time, Adversary, Behavior, Drift) with paired mitigations. Independent-critique includes a mandatory futures pass; prompts/futures-check.md runs standalone for pre-implementation work.",
535
+ runWith: "pnpm ledger:futures",
536
+ },
537
+ {
538
+ name: "Corrections log",
539
+ cadence: "Per rejection",
540
+ where: "corrections.md",
541
+ summary:
542
+ "Numbered anti-pattern entries with screenshot + Sir's verbatim reason + fix applied + recurrence watch. Read before every Path B build. Recurring patterns get promoted to rules or lints.",
543
+ runWith: "pnpm cluster:corrections",
544
+ },
545
+ {
546
+ name: "Promote corrections → lints",
547
+ cadence: "First Monday / month",
548
+ where: "prompts/promote-corrections.md",
549
+ summary:
550
+ "Mines corrections.md + critique ledger for clusters appearing 2+ times and drafts a candidate lint script or CLAUDE.md rule for Sir's review. Max 3 candidates per run; explicit abstain if data is thin.",
551
+ runWith: "loops-monthly.yml opens an Issue with the run command",
552
+ },
553
+ {
554
+ name: "Recipe miner",
555
+ cadence: "First Monday / month",
556
+ where: "prompts/recipe-miner.md",
557
+ summary:
558
+ "Ranks ship-first vs bounce recipes from prototypes.jsonl. Surfaces templates worth copying and anti-templates worth flagging. Output saved to ledgers/reports/recipes-<YYYY-MM>.md.",
559
+ runWith: "loops-monthly.yml opens an Issue with the run command",
560
+ },
561
+ {
562
+ name: "Anti-defaults refresh",
563
+ cadence: "First Monday / quarter",
564
+ where: "prompts/anti-defaults-refresh.md",
565
+ summary:
566
+ "Pressure-tests the current anti-defaults list against the last 90 days of corrections + critiques + fresh Mobbin and web research. Max 5 proposals per run; abstention is healthy.",
567
+ runWith: "loops-quarterly.yml opens an Issue with the run command",
568
+ },
569
+ {
570
+ name: "Staleness check",
571
+ cadence: "Quarterly",
572
+ where: "scripts/check-staleness.mjs",
573
+ summary:
574
+ "Flags references and exemplars older than 12 months (references.meta.json + exemplars/<brand>/annotations.md carry capturedAt dates). Sir reviews flagged entries: confirm-in-place or replace.",
575
+ runWith: "pnpm check:staleness",
576
+ },
577
+ {
578
+ name: "Cross-fork aggregator",
579
+ cadence: "Quarterly",
580
+ where: "aggregator/, scripts/aggregate-forks.mjs",
581
+ summary:
582
+ "Local CLI that pulls signals from every active fork and surfaces patterns appearing in N≥2 forks. Recommends upstream BADS promotions. Privacy-safe: never reads content/personas/, anonymizes stakeholder names.",
583
+ runWith: "pnpm aggregate",
584
+ },
585
+ {
586
+ name: "Rule audit",
587
+ cadence: "Every PR",
588
+ where: "scripts/audit-rules.mjs",
589
+ summary:
590
+ "Scans CLAUDE.md + layer-*/README.md for rules without concrete examples or pointers. A rule without an example is too vague to enforce and silently gets ignored.",
591
+ runWith: ".github/workflows/audit-rules.yml (strict on PR)",
592
+ },
593
+ ] as const;
594
+
595
+ const AUTOMATION_SURFACES = [
596
+ {
597
+ label: "audit-rules.yml",
598
+ cadence: "Every PR",
599
+ summary:
600
+ "Runs pnpm audit:rules:strict on every PR touching CLAUDE.md, layer-*/README.md, or the audit script itself. Blocks merge if any new rule lacks a concrete example.",
601
+ where: ".github/workflows/audit-rules.yml",
602
+ },
603
+ {
604
+ label: "weekly-digest.yml",
605
+ cadence: "Mondays 14:00 UTC",
606
+ summary:
607
+ "Executes check:staleness + ledger:critiques + ledger:prototypes + ledger:futures + cluster:corrections + lint:bypass:warn. Opens or updates a labeled self-improvement:weekly-digest Issue.",
608
+ where: ".github/workflows/weekly-digest.yml",
609
+ },
610
+ {
611
+ label: "loops-monthly.yml",
612
+ cadence: "First Monday / month",
613
+ summary:
614
+ "Opens a labeled self-improvement:monthly Issue queueing the two monthly Agent prompts (promote-corrections, recipe-miner) as checkbox checklists.",
615
+ where: ".github/workflows/loops-monthly.yml",
616
+ },
617
+ {
618
+ label: "loops-quarterly.yml",
619
+ cadence: "First Monday / quarter",
620
+ summary:
621
+ "Opens a labeled self-improvement:quarterly Issue queueing anti-defaults-refresh, staleness deep dive, the cross-fork aggregator, and the capability + rule hygiene pass.",
622
+ where: ".github/workflows/loops-quarterly.yml",
623
+ },
624
+ {
625
+ label: "com.bads.aggregate.plist",
626
+ cadence: "Mondays 09:30 local",
627
+ summary:
628
+ "Local launchd job (opt-in). Runs pnpm aggregate across the forks configured in aggregator/forks.json. Local-only because the aggregator needs filesystem access to multiple repos.",
629
+ where: "automation/local/ (bash install.sh / uninstall.sh)",
630
+ },
631
+ {
632
+ label: "chromatic.yml",
633
+ cadence: "Every push to main + PRs",
634
+ summary:
635
+ "Storybook visual regression. First push sets baseline; every PR posts a diff. Needs CHROMATIC_PROJECT_TOKEN secret.",
636
+ where: ".github/workflows/chromatic.yml",
637
+ },
638
+ {
639
+ label: "publish-core.yml",
640
+ cadence: "On v* tags",
641
+ summary:
642
+ "Builds tokens and publishes @behavioral-agentic-design-system/core to npm with provenance. Triggered by git tag push.",
643
+ where: ".github/workflows/publish-core.yml",
644
+ },
645
+ ] as const;
646
+
207
647
  function MetricCard({
208
648
  icon: Icon,
209
649
  value,
@@ -294,7 +734,7 @@ Steps to run, in order:
294
734
 
295
735
  3. BRAND CONTEXT — follow prompts/0-brand-context.md. If step 2 extracted artifacts, use them as inputs (don't re-ask). Otherwise ask me for marketing site URL/text, founder notes, one-liner, industry context. Fill BRIEF.md and brand.config.ts AI-brief fields. Diff, confirm, commit.
296
736
 
297
- 4. VOICE — follow prompts/1-brand-voice.md. If extraction ran, the voice-signals artifact is the input — don't ask again. Otherwise ask for examples of existing copy and voice references. Fill layer-1-brand-voice/{framework,voice-and-tone,language}.md. Diff, confirm, commit.
737
+ 4. VOICE — follow prompts/1-brand-voice.md. If extraction ran, the voice-signals artifact is the input — don't ask again. Otherwise ask for examples of existing copy and voice references. Fill layer-1-foundation/{framework,voice-and-tone,language}.md. Diff, confirm, commit.
298
738
 
299
739
  5. MICROCOPY — follow prompts/2-microcopy.md. If extraction ran, the microcopy-patterns artifact is the seed — fill the gaps from there. Validate JSON parses. Diff, confirm, commit.
300
740
 
@@ -514,7 +954,360 @@ Operating rules:
514
954
 
515
955
  Begin with step 1.`;
516
956
 
517
- export function HomeTab() {
957
+ export function HomeTab({ onBrowseComponents }: HomeTabProps) {
958
+ const [openLayers, setOpenLayers] = useState<Set<string>>(new Set());
959
+ const { setTab } = useShellNav();
960
+ const handleBrowseComponents = () => {
961
+ if (onBrowseComponents) {
962
+ onBrowseComponents();
963
+ return;
964
+ }
965
+
966
+ document.getElementById("components")?.scrollIntoView({
967
+ behavior: "smooth",
968
+ block: "start",
969
+ });
970
+ };
971
+
972
+ // Fresh fork: not upstream, brand name still "BADS"
973
+ const isFreshFork = !brand.isUpstreamTemplate && brand.name === "BADS";
974
+
975
+ // Customized client fork: not upstream, brand name changed
976
+ const isCustomizedFork = !brand.isUpstreamTemplate && brand.name !== "BADS";
977
+
978
+ const toggleLayer = (n: string) => {
979
+ setOpenLayers((prev) => {
980
+ const next = new Set(prev);
981
+ if (next.has(n)) next.delete(n);
982
+ else next.add(n);
983
+ return next;
984
+ });
985
+ };
986
+
987
+ // Fresh fork: minimal onboarding view
988
+ if (isFreshFork) {
989
+ return (
990
+ <ScrollArea className="size-full">
991
+ <div className="max-w-4xl mx-auto px-8 py-12 space-y-8">
992
+ <section className="space-y-6">
993
+ <div className="space-y-3">
994
+ <h1 className="text-4xl font-semibold tracking-tight">
995
+ Welcome to BADS
996
+ </h1>
997
+ <p className="text-lg text-muted-foreground max-w-2xl leading-relaxed">
998
+ This is a fresh fork of the Behavioral Agentic Design System. In a few
999
+ minutes, you can customize it for your product — brand colors, typography,
1000
+ voice, ethics, and more. The system guides you through every step.
1001
+ </p>
1002
+ </div>
1003
+
1004
+ <div className="flex items-center gap-2 flex-wrap pt-2">
1005
+ <Button size="sm" variant="default" className="gap-2" asChild>
1006
+ <a href="#setup">
1007
+ <Wand2 className="h-4 w-4" strokeWidth={1.5} /> Set up now
1008
+ </a>
1009
+ </Button>
1010
+ <Button size="sm" variant="outline" className="gap-2" asChild>
1011
+ <a href="https://github.com/matthewlarn/behavioral-agentic-design-system" target="_blank" rel="noreferrer">
1012
+ <BookOpen className="h-4 w-4" strokeWidth={1.5} /> Learn more
1013
+ </a>
1014
+ </Button>
1015
+ </div>
1016
+ </section>
1017
+
1018
+ <Separator />
1019
+
1020
+ <section className="space-y-6" id="setup">
1021
+ <div className="space-y-2 max-w-2xl">
1022
+ <h2 className="text-2xl font-semibold tracking-tight">Set it up in one prompt</h2>
1023
+ <p className="text-base text-muted-foreground leading-relaxed">
1024
+ Paste the prompt below into a Claude Code session. Claude will walk you through
1025
+ the full setup — rename, brand context, voice, tokens, components — with a
1026
+ commit at every step.
1027
+ </p>
1028
+ </div>
1029
+ <CopyablePromptCard
1030
+ title="Run the full setup with one prompt"
1031
+ description="Paste into Claude Code at the repo root. Includes rename, brand context, voice, microcopy, tokens, and components."
1032
+ prompt={SETUP_PROMPT}
1033
+ icon={Wand2}
1034
+ highlighted
1035
+ />
1036
+ </section>
1037
+
1038
+ <Separator />
1039
+
1040
+ <footer className="text-sm text-muted-foreground py-8">
1041
+ <p>
1042
+ <Sparkles className="h-3.5 w-3.5 inline mr-1" strokeWidth={1.5} />
1043
+ This is a BADS fork. Questions? Check out the{" "}
1044
+ <a href="https://github.com/matthewlarn/behavioral-agentic-design-system" className="underline hover:text-foreground">
1045
+ full documentation
1046
+ </a>
1047
+ .
1048
+ </p>
1049
+ </footer>
1050
+ </div>
1051
+ </ScrollArea>
1052
+ );
1053
+ }
1054
+
1055
+ // Customized client fork: dashboard view focused on their design system
1056
+ if (isCustomizedFork) {
1057
+ return (
1058
+ <ScrollArea className="size-full">
1059
+ <div className="max-w-6xl mx-auto px-8 py-12 space-y-12">
1060
+ {/* HERO */}
1061
+ <section className="space-y-6">
1062
+ <div className="flex items-start gap-5">
1063
+ <div className="h-16 w-16 rounded-2xl bg-primary flex items-center justify-center shrink-0 shadow-sm text-primary-foreground">
1064
+ <BrandMark size={32} />
1065
+ </div>
1066
+ <div className="space-y-3 flex-1">
1067
+ <h1 className="text-4xl font-semibold tracking-tight">
1068
+ {brand.name}
1069
+ </h1>
1070
+ <p className="text-lg text-muted-foreground leading-relaxed">
1071
+ Your design system. Built on BADS.
1072
+ </p>
1073
+ </div>
1074
+ </div>
1075
+
1076
+ <div className="flex items-center gap-2 flex-wrap pt-2">
1077
+ <Button size="sm" variant="default" className="gap-2" asChild>
1078
+ <a href="#customize">
1079
+ <Wand2 className="h-4 w-4" strokeWidth={1.5} /> Customize
1080
+ </a>
1081
+ </Button>
1082
+ <Button size="sm" variant="outline" className="gap-2" onClick={handleBrowseComponents} type="button">
1083
+ <Package className="h-4 w-4" strokeWidth={1.5} /> Components
1084
+ </Button>
1085
+ <Button size="sm" variant="outline" className="gap-2" asChild>
1086
+ <a href="#quickstart">
1087
+ <Terminal className="h-4 w-4" strokeWidth={1.5} /> Install
1088
+ </a>
1089
+ </Button>
1090
+ </div>
1091
+ </section>
1092
+
1093
+ <Separator />
1094
+
1095
+ {/* METRICS */}
1096
+ <section className="space-y-6">
1097
+ <SectionHeading
1098
+ eyebrow="At a glance"
1099
+ title="Your design system"
1100
+ />
1101
+ <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
1102
+ <MetricCard
1103
+ icon={Package}
1104
+ value={componentCount}
1105
+ label="Components"
1106
+ />
1107
+ <MetricCard
1108
+ icon={Palette}
1109
+ value={semanticTokenCount}
1110
+ label="Semantic tokens"
1111
+ />
1112
+ <MetricCard
1113
+ icon={ShieldCheck}
1114
+ value="AAA"
1115
+ label="WCAG-ready"
1116
+ />
1117
+ <MetricCard
1118
+ icon={Heart}
1119
+ value={brand.colors.length}
1120
+ label="Brand colors"
1121
+ />
1122
+ </div>
1123
+ </section>
1124
+
1125
+ <Separator />
1126
+
1127
+ {/* BRAND SNAPSHOT */}
1128
+ <section className="space-y-6">
1129
+ <SectionHeading
1130
+ eyebrow="Identity"
1131
+ title="Brand at a glance"
1132
+ />
1133
+ <div className="grid md:grid-cols-3 gap-4">
1134
+ {/* Color */}
1135
+ <Card className="gap-0">
1136
+ <CardHeader className="pb-2">
1137
+ <CardTitle className="text-base flex items-center gap-2">
1138
+ <Palette className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
1139
+ Colors
1140
+ </CardTitle>
1141
+ </CardHeader>
1142
+ <CardContent className="flex-1 flex flex-col gap-3">
1143
+ <div className="h-20 rounded-lg bg-primary border" />
1144
+ {brand.colors.length > 1 && (
1145
+ <div
1146
+ className="grid gap-1.5"
1147
+ style={{
1148
+ gridTemplateColumns: `repeat(${Math.min(brand.colors.length - 1, 8)}, minmax(0, 1fr))`,
1149
+ }}
1150
+ >
1151
+ {brand.colors.slice(1).map((c) => (
1152
+ <div
1153
+ key={c.id}
1154
+ className="aspect-square rounded border"
1155
+ style={{ backgroundColor: c.primary }}
1156
+ title={`${c.label} · ${c.primary}`}
1157
+ />
1158
+ ))}
1159
+ </div>
1160
+ )}
1161
+ <Button
1162
+ size="sm"
1163
+ variant="outline"
1164
+ className="mt-auto w-full gap-2"
1165
+ onClick={() => setTab("colors")}
1166
+ >
1167
+ <Wand2 className="h-3.5 w-3.5" strokeWidth={1.5} /> Customize
1168
+ </Button>
1169
+ </CardContent>
1170
+ </Card>
1171
+
1172
+ {/* Type */}
1173
+ <Card className="gap-0">
1174
+ <CardHeader className="pb-2">
1175
+ <CardTitle className="text-base flex items-center gap-2">
1176
+ <Type className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
1177
+ Typography
1178
+ </CardTitle>
1179
+ </CardHeader>
1180
+ <CardContent className="flex-1 flex flex-col gap-3">
1181
+ <div className="space-y-1">
1182
+ <p className="text-2xl font-semibold leading-none">The quick brown fox</p>
1183
+ <p className="text-base">Body text at 18px by default.</p>
1184
+ </div>
1185
+ <dl className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs">
1186
+ <dt className="text-muted-foreground">Sans</dt>
1187
+ <dd className="font-sans truncate">{brand.fonts?.[0]?.label ?? "Default sans"}</dd>
1188
+ <dt className="text-muted-foreground">Serif</dt>
1189
+ <dd className="font-serif truncate">Default serif</dd>
1190
+ <dt className="text-muted-foreground">Mono</dt>
1191
+ <dd className="font-mono truncate">Default mono</dd>
1192
+ </dl>
1193
+ <Button
1194
+ size="sm"
1195
+ variant="outline"
1196
+ className="mt-auto w-full gap-2"
1197
+ onClick={() => setTab("colors")}
1198
+ >
1199
+ <Wand2 className="h-3.5 w-3.5" strokeWidth={1.5} /> Customize
1200
+ </Button>
1201
+ </CardContent>
1202
+ </Card>
1203
+
1204
+ {/* Voice */}
1205
+ <Card className="gap-0">
1206
+ <CardHeader className="pb-2">
1207
+ <CardTitle className="text-base flex items-center gap-2">
1208
+ <Heart className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
1209
+ Voice
1210
+ </CardTitle>
1211
+ </CardHeader>
1212
+ <CardContent className="flex-1 flex flex-col gap-3">
1213
+ <div className="flex flex-wrap gap-1.5">
1214
+ <Badge variant="secondary" className="text-xs">Friendly</Badge>
1215
+ <Badge variant="secondary" className="text-xs">Daring</Badge>
1216
+ <Badge variant="secondary" className="text-xs">Radiant</Badge>
1217
+ <Badge variant="secondary" className="text-xs">Genuine</Badge>
1218
+ </div>
1219
+ {brand.tagline && (
1220
+ <p className="text-sm text-muted-foreground italic leading-snug">
1221
+ &ldquo;{brand.tagline}&rdquo;
1222
+ </p>
1223
+ )}
1224
+ <Button
1225
+ size="sm"
1226
+ variant="outline"
1227
+ className="mt-auto w-full gap-2"
1228
+ onClick={() => setTab("layers")}
1229
+ >
1230
+ <BookOpen className="h-3.5 w-3.5" strokeWidth={1.5} /> Edit
1231
+ </Button>
1232
+ </CardContent>
1233
+ </Card>
1234
+ </div>
1235
+ </section>
1236
+
1237
+ <Separator />
1238
+
1239
+ {/* NEXT STEPS */}
1240
+ <section className="space-y-6">
1241
+ <SectionHeading
1242
+ eyebrow="What's next"
1243
+ title="Get started using your system"
1244
+ />
1245
+ <div className="grid md:grid-cols-2 gap-4">
1246
+ <Card>
1247
+ <CardHeader>
1248
+ <CardTitle className="text-base flex items-center gap-2">
1249
+ <Eye className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} /> Preview components
1250
+ </CardTitle>
1251
+ <CardDescription>Browse all components in the showcase</CardDescription>
1252
+ </CardHeader>
1253
+ <CardContent>
1254
+ <Button size="sm" variant="outline" className="w-full gap-2" onClick={handleBrowseComponents} type="button">
1255
+ <Package className="h-4 w-4" strokeWidth={1.5} /> View
1256
+ </Button>
1257
+ </CardContent>
1258
+ </Card>
1259
+ <Card>
1260
+ <CardHeader>
1261
+ <CardTitle className="text-base flex items-center gap-2">
1262
+ <Terminal className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} /> Install in your product
1263
+ </CardTitle>
1264
+ <CardDescription>Copy the npm install command</CardDescription>
1265
+ </CardHeader>
1266
+ <CardContent>
1267
+ <Button size="sm" variant="outline" className="w-full gap-2" asChild>
1268
+ <a href="#quickstart">
1269
+ <Code2 className="h-4 w-4" strokeWidth={1.5} /> Install
1270
+ </a>
1271
+ </Button>
1272
+ </CardContent>
1273
+ </Card>
1274
+ <Card>
1275
+ <CardHeader>
1276
+ <CardTitle className="text-base flex items-center gap-2">
1277
+ <Layers className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} /> Customize colors + fonts
1278
+ </CardTitle>
1279
+ <CardDescription>Edit tokens in the Customize tab</CardDescription>
1280
+ </CardHeader>
1281
+ <CardContent>
1282
+ <Button size="sm" variant="outline" className="w-full gap-2" asChild>
1283
+ <a href="#customize">
1284
+ <Wand2 className="h-4 w-4" strokeWidth={1.5} /> Customize
1285
+ </a>
1286
+ </Button>
1287
+ </CardContent>
1288
+ </Card>
1289
+ </div>
1290
+ </section>
1291
+
1292
+ <Separator />
1293
+
1294
+ {/* FOOTER */}
1295
+ <footer className="text-sm text-muted-foreground py-8">
1296
+ <p>
1297
+ <Sparkles className="h-3.5 w-3.5 inline mr-1" strokeWidth={1.5} />
1298
+ Built on{" "}
1299
+ <a href="https://github.com/matthewlarn/behavioral-agentic-design-system" className="underline hover:text-foreground">
1300
+ BADS
1301
+ </a>
1302
+ . Components, tokens, and brand voice — all in one system.
1303
+ </p>
1304
+ </footer>
1305
+ </div>
1306
+ </ScrollArea>
1307
+ );
1308
+ }
1309
+
1310
+ // Full home tab for upstream BADS
518
1311
  return (
519
1312
  <ScrollArea className="size-full">
520
1313
  {/* Entrance animation: each top-level section fades up in sequence on
@@ -561,8 +1354,8 @@ export function HomeTab() {
561
1354
  </div>
562
1355
 
563
1356
  <div className="flex items-start gap-5">
564
- <div className="h-16 w-16 rounded-2xl bg-primary flex items-center justify-center shrink-0 shadow-sm">
565
- <Sparkles className="h-8 w-8 text-primary-foreground" strokeWidth={1.5} />
1357
+ <div className="h-16 w-16 rounded-2xl bg-primary flex items-center justify-center shrink-0 shadow-sm text-primary-foreground">
1358
+ <BrandMark size={32} />
566
1359
  </div>
567
1360
  <div className="space-y-3">
568
1361
  <h1 className="text-5xl font-semibold tracking-tight">
@@ -583,25 +1376,8 @@ export function HomeTab() {
583
1376
  <Wand2 className="h-4 w-4" strokeWidth={1.5} /> Onboard with AI
584
1377
  </a>
585
1378
  </Button>
586
- <Button size="sm" variant="outline" className="gap-2" asChild>
587
- <a href="#quickstart">
588
- <Terminal className="h-4 w-4" strokeWidth={1.5} /> Quickstart
589
- </a>
590
- </Button>
591
- <Button size="sm" variant="outline" className="gap-2" asChild>
592
- <a href="#components">
593
- <Package className="h-4 w-4" strokeWidth={1.5} /> Browse components
594
- </a>
595
- </Button>
596
- <Button size="sm" variant="outline" className="gap-2" asChild>
597
- <a href="#chromatic">
598
- <GitCompare className="h-4 w-4" strokeWidth={1.5} /> Wire up Chromatic
599
- </a>
600
- </Button>
601
- <Button size="sm" variant="ghost" className="gap-2" asChild>
602
- <a href="#docs">
603
- <BookOpen className="h-4 w-4" strokeWidth={1.5} /> Read the docs
604
- </a>
1379
+ <Button size="sm" variant="outline" className="gap-2" onClick={handleBrowseComponents} type="button">
1380
+ <Package className="h-4 w-4" strokeWidth={1.5} /> Browse components
605
1381
  </Button>
606
1382
  </div>
607
1383
  </section>
@@ -632,7 +1408,7 @@ export function HomeTab() {
632
1408
  icon={Layers}
633
1409
  value={SHIPPED_LAYERS.length}
634
1410
  label="Layers shipped"
635
- hint={`${DEFERRED_LAYERS.length} deferred to v2`}
1411
+ hint="All 10 layers complete"
636
1412
  />
637
1413
  <MetricCard
638
1414
  icon={ShieldCheck}
@@ -647,71 +1423,227 @@ export function HomeTab() {
647
1423
  <section className="space-y-6">
648
1424
  <SectionHeading
649
1425
  eyebrow="The stack"
650
- title="Twelve layers, nine shipped"
1426
+ title="Ten layers, all shipped"
651
1427
  description="A layered architecture where lower layers are the ingredients and higher layers are the recipes. v1 ships everything you need to leave the system in a good place. v2 is gated behind real signals — added only when a real problem asks for them."
652
1428
  />
653
- <div className="grid md:grid-cols-2 gap-3">
654
- {SHIPPED_LAYERS.map((layer) => (
655
- <Card key={layer.n}>
656
- <CardContent className="py-4 flex items-start gap-3">
657
- <CheckCircle2
658
- className="h-5 w-5 text-primary mt-0.5 shrink-0"
659
- strokeWidth={1.5}
660
- />
661
- <div className="flex-1 min-w-0">
662
- <div className="flex items-baseline gap-2">
663
- <span className="text-xs font-mono text-muted-foreground">
664
- Layer {layer.n}
665
- </span>
666
- <span className="font-semibold">{layer.name}</span>
667
- </div>
668
- <p className="text-sm text-muted-foreground mt-0.5">{layer.note}</p>
669
- </div>
670
- <Badge variant="secondary" className="text-xs shrink-0">
671
- Shipped
672
- </Badge>
673
- </CardContent>
674
- </Card>
675
- ))}
676
- </div>
677
-
678
- <details className="group">
679
- <summary className="text-sm text-muted-foreground cursor-pointer hover:text-foreground select-none inline-flex items-center gap-1">
680
- Deferred to v2 ({DEFERRED_LAYERS.length})
681
- <ArrowUpRight
682
- className="h-3.5 w-3.5 transition-transform group-open:rotate-45"
683
- strokeWidth={1.5}
684
- />
685
- </summary>
686
- <div className="grid md:grid-cols-2 gap-3 mt-4">
687
- {DEFERRED_LAYERS.map((layer) => (
688
- <Card key={layer.n} className="border-dashed">
689
- <CardContent className="py-4 flex items-start gap-3">
690
- <Circle
691
- className="h-5 w-5 text-muted-foreground/50 mt-0.5 shrink-0"
1429
+ <div className="space-y-2">
1430
+ {SHIPPED_LAYERS.map((layer) => {
1431
+ const isOpen = openLayers.has(layer.n);
1432
+ const isDeferred = (layer.status as "shipped" | "deferred") === "deferred";
1433
+ return (
1434
+ <button
1435
+ key={layer.n}
1436
+ onClick={() => toggleLayer(layer.n)}
1437
+ className={`w-full text-left transition-colors rounded-lg border ${
1438
+ isDeferred
1439
+ ? "border-dashed hover:bg-accent/40"
1440
+ : "hover:bg-accent/40"
1441
+ }`}
1442
+ >
1443
+ <div className="p-4 flex items-start gap-3">
1444
+ <ChevronRight
1445
+ className={`h-5 w-5 text-muted-foreground mt-0.5 shrink-0 transition-transform ${
1446
+ isOpen ? "rotate-90" : ""
1447
+ }`}
692
1448
  strokeWidth={1.5}
693
1449
  />
1450
+ {isDeferred ? (
1451
+ <Circle
1452
+ className="h-5 w-5 text-muted-foreground/50 mt-0.5 shrink-0"
1453
+ strokeWidth={1.5}
1454
+ />
1455
+ ) : (
1456
+ <CheckCircle2
1457
+ className="h-5 w-5 text-primary mt-0.5 shrink-0"
1458
+ strokeWidth={1.5}
1459
+ />
1460
+ )}
694
1461
  <div className="flex-1 min-w-0">
695
- <div className="flex items-baseline gap-2">
1462
+ <div className="flex items-baseline gap-2 flex-wrap">
696
1463
  <span className="text-xs font-mono text-muted-foreground">
697
1464
  Layer {layer.n}
698
1465
  </span>
699
- <span className="font-semibold text-muted-foreground">
1466
+ <span
1467
+ className={`font-semibold ${
1468
+ isDeferred ? "text-muted-foreground" : ""
1469
+ }`}
1470
+ >
700
1471
  {layer.name}
701
1472
  </span>
702
1473
  </div>
703
- <p className="text-sm text-muted-foreground mt-0.5">{layer.note}</p>
1474
+ <p className="text-sm text-muted-foreground mt-0.5">
1475
+ {layer.note}
1476
+ </p>
704
1477
  </div>
705
- <Badge variant="outline" className="text-xs shrink-0">
706
- v2
707
- </Badge>
1478
+ </div>
1479
+
1480
+ {isOpen && (
1481
+ <div className="px-4 pb-4 ml-8 border-l border-border space-y-2">
1482
+ {layer.details.map((detail, idx) => (
1483
+ <div key={idx} className="flex gap-2 text-sm">
1484
+ <span className="text-muted-foreground shrink-0">•</span>
1485
+ <span className="text-foreground/80">{detail}</span>
1486
+ </div>
1487
+ ))}
1488
+ </div>
1489
+ )}
1490
+ </button>
1491
+ );
1492
+ })}
1493
+ </div>
1494
+ </section>
1495
+
1496
+ <Separator />
1497
+
1498
+ {/* CAPABILITIES */}
1499
+ <section className="space-y-6" id="capabilities">
1500
+ <SectionHeading
1501
+ eyebrow="Capabilities at a glance"
1502
+ title="Everything the system ships, in one read"
1503
+ description="Every feature BADS includes — design exploration, persona discipline, components, accessibility, automation, self-improvement loops, sync model. The full discoverable index lives in CAPABILITIES.md; the cards below are the orientation."
1504
+ />
1505
+ <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-4">
1506
+ {CAPABILITY_SECTIONS.map((section) => {
1507
+ const Icon = section.icon;
1508
+ return (
1509
+ <Card key={section.title} className="flex flex-col">
1510
+ <CardHeader>
1511
+ <CardTitle className="text-base flex items-center gap-2">
1512
+ <Icon className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
1513
+ {section.title}
1514
+ </CardTitle>
1515
+ <CardDescription className="leading-relaxed">
1516
+ {section.summary}
1517
+ </CardDescription>
1518
+ </CardHeader>
1519
+ <CardContent className="flex-1 space-y-3">
1520
+ <ul className="space-y-1.5">
1521
+ {section.highlights.map((h) => (
1522
+ <li key={h} className="flex gap-2 text-sm">
1523
+ <span className="text-muted-foreground shrink-0">•</span>
1524
+ <span className="text-foreground/80 leading-relaxed">{h}</span>
1525
+ </li>
1526
+ ))}
1527
+ </ul>
1528
+ <p className="text-xs font-mono text-muted-foreground pt-1">
1529
+ {section.doc}
1530
+ </p>
708
1531
  </CardContent>
709
1532
  </Card>
1533
+ );
1534
+ })}
1535
+ </div>
1536
+ <p className="text-sm text-muted-foreground">
1537
+ Full discoverable index with every script, prompt, and surface:{" "}
1538
+ <code className="font-mono text-xs text-foreground">CAPABILITIES.md</code>
1539
+ </p>
1540
+ </section>
1541
+
1542
+ <Separator />
1543
+
1544
+ {/* SELF-IMPROVEMENT LOOPS */}
1545
+ <section className="space-y-6" id="loops">
1546
+ <SectionHeading
1547
+ eyebrow="Self-improvement loops"
1548
+ title="The system compounds"
1549
+ description="Ten feedback loops turn one-shot work into permanent memory. Critique findings, prototype verdicts, and futures-risk findings land in append-only JSONL ledgers; monthly and quarterly Agent runs mine them into rules, lints, and refreshed anti-defaults. Cross-fork patterns aggregate locally."
1550
+ />
1551
+ <div className="grid md:grid-cols-2 gap-4">
1552
+ {SELF_IMPROVEMENT_LOOPS.map((loop) => (
1553
+ <Card key={loop.name}>
1554
+ <CardHeader className="pb-3">
1555
+ <div className="flex items-center justify-between gap-3">
1556
+ <CardTitle className="text-base">{loop.name}</CardTitle>
1557
+ <Badge variant="outline" className="text-xs font-mono whitespace-nowrap">
1558
+ {loop.cadence}
1559
+ </Badge>
1560
+ </div>
1561
+ <CardDescription className="leading-relaxed">
1562
+ {loop.summary}
1563
+ </CardDescription>
1564
+ </CardHeader>
1565
+ <CardContent className="space-y-1.5 pt-0">
1566
+ <div className="flex gap-2 text-sm">
1567
+ <span className="text-muted-foreground shrink-0 w-16">where</span>
1568
+ <code className="font-mono text-xs text-foreground/80">
1569
+ {loop.where}
1570
+ </code>
1571
+ </div>
1572
+ <div className="flex gap-2 text-sm">
1573
+ <span className="text-muted-foreground shrink-0 w-16">run</span>
1574
+ <code className="font-mono text-xs text-foreground/80">
1575
+ {loop.runWith}
1576
+ </code>
1577
+ </div>
1578
+ </CardContent>
1579
+ </Card>
1580
+ ))}
1581
+ </div>
1582
+ <p className="text-sm text-muted-foreground">
1583
+ End-to-end documentation:{" "}
1584
+ <code className="font-mono text-xs text-foreground">CLAUDE.md → Self-improvement loops</code>{" "}
1585
+ and{" "}
1586
+ <code className="font-mono text-xs text-foreground">ledgers/README.md</code>
1587
+ </p>
1588
+ </section>
1589
+
1590
+ <Separator />
1591
+
1592
+ {/* AUTOMATION */}
1593
+ <section className="space-y-6" id="automation">
1594
+ <SectionHeading
1595
+ eyebrow="Automation"
1596
+ title="Schedulers behind the loops"
1597
+ description="GitHub Actions for everything CI-friendly; a local launchd plist for the cross-fork aggregator (which needs filesystem access to multiple forks). Each surface can be disabled independently by deleting its workflow file or running the uninstall script."
1598
+ />
1599
+ <Card>
1600
+ <CardContent className="py-4 divide-y divide-border">
1601
+ {AUTOMATION_SURFACES.map((surface) => (
1602
+ <div key={surface.label} className="py-3 first:pt-0 last:pb-0">
1603
+ <div className="flex items-center justify-between gap-3 flex-wrap">
1604
+ <code className="font-mono text-sm text-foreground font-medium">
1605
+ {surface.label}
1606
+ </code>
1607
+ <Badge variant="outline" className="text-xs font-mono">
1608
+ {surface.cadence}
1609
+ </Badge>
1610
+ </div>
1611
+ <p className="text-sm text-muted-foreground leading-relaxed mt-1.5">
1612
+ {surface.summary}
1613
+ </p>
1614
+ <p className="text-xs font-mono text-muted-foreground mt-1.5">
1615
+ {surface.where}
1616
+ </p>
1617
+ </div>
710
1618
  ))}
711
- </div>
712
- </details>
1619
+ </CardContent>
1620
+ </Card>
1621
+ <p className="text-sm text-muted-foreground">
1622
+ Full surface documentation:{" "}
1623
+ <code className="font-mono text-xs text-foreground">automation/README.md</code>
1624
+ </p>
1625
+ </section>
1626
+
1627
+ <Separator />
1628
+
1629
+ {/* ONBOARD */}
1630
+ <section className="space-y-10" id="onboard">
1631
+ <SectionHeading
1632
+ eyebrow="Quickstart"
1633
+ title="Get the design system running"
1634
+ description="This is an engineer's guide. Fork the repo, then run the setup flow below. Claude Code will guide you through renaming the fork, importing brand + tokens + components from your product, linting accessibility, and syncing everything to git — pausing for input at each step."
1635
+ />
1636
+ <CopyablePromptCard
1637
+ title="Run the full setup with one prompt"
1638
+ description="Copy this prompt, paste it into Claude Code at the repo root. Claude walks you through rename, source discovery, token setup, component registry, and accessibility baseline — committing at each step."
1639
+ prompt={SETUP_PROMPT}
1640
+ icon={Wand2}
1641
+ highlighted
1642
+ />
713
1643
  </section>
714
1644
 
1645
+ <Separator />
1646
+
715
1647
  {/* BRAND SNAPSHOT */}
716
1648
  <section className="space-y-6">
717
1649
  <SectionHeading
@@ -780,7 +1712,7 @@ export function HomeTab() {
780
1712
  errors, brief on success.&rdquo;
781
1713
  </p>
782
1714
  <p className="text-xs font-mono text-muted-foreground">
783
- layer-1-brand-voice/voice-and-tone.md
1715
+ layer-1-foundation/voice-and-tone.md
784
1716
  </p>
785
1717
  </CardContent>
786
1718
  </Card>
@@ -814,6 +1746,84 @@ export function HomeTab() {
814
1746
  </div>
815
1747
  </section>
816
1748
 
1749
+ {/* COMPONENT QUALITY */}
1750
+ <section className="space-y-6">
1751
+ <SectionHeading
1752
+ eyebrow="Adding components"
1753
+ title="From component idea to pixel-perfect baseline"
1754
+ description="New components move through a constrained path: prove the need, write the registry contract, build from tokens, story every state, then let automated checks catch drift before release."
1755
+ />
1756
+ <div className="grid lg:grid-cols-2 gap-4">
1757
+ <Card>
1758
+ <CardHeader>
1759
+ <CardTitle className="text-base flex items-center gap-2">
1760
+ <Package className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
1761
+ How a component gets added
1762
+ </CardTitle>
1763
+ <CardDescription>
1764
+ The registry is the gate. Implementation follows the contract.
1765
+ </CardDescription>
1766
+ </CardHeader>
1767
+ <CardContent className="space-y-4">
1768
+ {COMPONENT_ADDITION_STEPS.map((step, index) => {
1769
+ const Icon = step.icon;
1770
+ return (
1771
+ <div key={step.title} className="flex gap-3">
1772
+ <div className="h-9 w-9 rounded-lg border bg-muted flex items-center justify-center shrink-0">
1773
+ <Icon className="h-4 w-4 text-primary" strokeWidth={1.5} />
1774
+ </div>
1775
+ <div className="space-y-1">
1776
+ <div className="flex items-center gap-2 flex-wrap">
1777
+ <span className="text-xs font-mono text-muted-foreground">
1778
+ 0{index + 1}
1779
+ </span>
1780
+ <p className="text-sm font-medium">{step.title}</p>
1781
+ </div>
1782
+ <p className="text-sm text-muted-foreground leading-relaxed">
1783
+ {step.detail}
1784
+ </p>
1785
+ </div>
1786
+ </div>
1787
+ );
1788
+ })}
1789
+ </CardContent>
1790
+ </Card>
1791
+
1792
+ <Card>
1793
+ <CardHeader>
1794
+ <CardTitle className="text-base flex items-center gap-2">
1795
+ <Zap className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
1796
+ Quality gates before it ships
1797
+ </CardTitle>
1798
+ <CardDescription>
1799
+ Pixel quality is protected by schema, a11y, story, and visual-regression checks.
1800
+ </CardDescription>
1801
+ </CardHeader>
1802
+ <CardContent>
1803
+ <div className="divide-y divide-border">
1804
+ {COMPONENT_QUALITY_GATES.map((gate) => {
1805
+ const Icon = gate.icon;
1806
+ return (
1807
+ <div key={gate.label} className="py-3 first:pt-0 last:pb-0 flex gap-3">
1808
+ <Icon
1809
+ className="h-4 w-4 text-primary mt-0.5 shrink-0"
1810
+ strokeWidth={1.5}
1811
+ />
1812
+ <div className="space-y-1 min-w-0">
1813
+ <p className="text-sm font-medium">{gate.label}</p>
1814
+ <p className="text-sm text-muted-foreground leading-relaxed">
1815
+ {gate.detail}
1816
+ </p>
1817
+ </div>
1818
+ </div>
1819
+ );
1820
+ })}
1821
+ </div>
1822
+ </CardContent>
1823
+ </Card>
1824
+ </div>
1825
+ </section>
1826
+
817
1827
  {/* ACCESSIBILITY */}
818
1828
  <section className="space-y-6">
819
1829
  <SectionHeading
@@ -829,9 +1839,9 @@ export function HomeTab() {
829
1839
  className="h-5 w-5 text-primary mt-0.5 shrink-0"
830
1840
  strokeWidth={1.5}
831
1841
  />
832
- <div>
833
- <p className="font-medium text-sm">{c.label}</p>
834
- <p className="text-sm text-muted-foreground">{c.detail}</p>
1842
+ <div className="min-w-0 space-y-0.5">
1843
+ <p className="m-0 font-medium text-sm leading-tight">{c.label}</p>
1844
+ <p className="m-0 text-sm text-muted-foreground leading-snug">{c.detail}</p>
835
1845
  </div>
836
1846
  </CardContent>
837
1847
  </Card>
@@ -873,331 +1883,237 @@ export function HomeTab() {
873
1883
  </p>
874
1884
  </section>
875
1885
 
876
- {/* ONBOARD */}
877
- <section className="space-y-10" id="onboard">
1886
+ <Separator />
1887
+
1888
+ {/* QUICKSTART */}
1889
+ <section className="space-y-6" id="quickstart">
878
1890
  <SectionHeading
879
- eyebrow="Onboard"
880
- title="Set up your design system in one prompt"
881
- description="Designer, engineer, founder, agency — anyone shipping a product can fork this and make it your own. Don't fill every layer by hand. Paste the prompt below into Claude Code and walk through the whole setup — name, brand context, voice, microcopy, ethics, tokens, components, patterns — guided, with a commit at every step."
882
- />
883
- <CopyablePromptCard
884
- title="Run the full onboarding with one prompt"
885
- description="Paste this into a Claude Code session at the root of this repo. Claude will walk through the rename, source discovery, brand context, voice, microcopy, ethics, tokens, components, and patterns — pausing at each step for your input."
886
- prompt={SETUP_PROMPT}
887
- icon={Wand2}
888
- highlighted
1891
+ eyebrow="For engineers"
1892
+ title="Everything you need to know"
1893
+ description="Installation, setup, customization, and reference docs for consuming and extending this system."
889
1894
  />
890
1895
 
891
- <div className="space-y-4">
892
- <SectionHeading
893
- eyebrow="Or pull answers from what you already have"
894
- title="Extract prompts"
895
- description="If the product already exists, point AI at your existing source instead of pasting raw text. Each extract prompt outputs the same artifact shape as the main onboarding, so the agent can drop the results straight into BRIEF.md, brand.config.ts, voice docs, and tokens. Uses Claude Code's Glob / Grep / Read for codebases, WebFetch for sites, and any MCP for knowledge bases."
896
- />
897
- <div className="grid gap-4 lg:grid-cols-2">
898
- <CopyablePromptCard
899
- title="From a codebase"
900
- description="Reads a product repo and derives brand context, voice tics, microcopy patterns, and visual cues — citing file:line for every extracted string."
901
- prompt={EXTRACT_FROM_CODEBASE}
902
- icon={FolderGit2}
903
- />
904
- <CopyablePromptCard
905
- title="From a website"
906
- description="Fetches a homepage + auto-discovered sub-pages. Pulls headline hierarchy, CTA labels, and visible hex codes from rendered styles. Flags weak differentiators."
907
- prompt={EXTRACT_FROM_WEBSITE}
908
- icon={Globe}
909
- />
910
- <CopyablePromptCard
911
- title="From a knowledge base"
912
- description="Reads Notion / Confluence / shared docs. Weights sources by recency, surfaces disagreements between brand guide and actual writing, returns a company outline."
913
- prompt={EXTRACT_FROM_KB}
914
- icon={Database}
915
- />
916
- <CopyablePromptCard
917
- title="Triangulate all three"
918
- description="Combo prompt for mature products. Reads codebase + site + knowledge base, surfaces contradictions explicitly as the most-important artifact (the human's homework)."
919
- prompt={EXTRACT_COMBO}
920
- icon={Combine}
921
- />
1896
+ {/* Installation */}
1897
+ <div>
1898
+ <h3 className="text-sm font-semibold mb-3">Installation & Setup</h3>
1899
+ <div className="grid md:grid-cols-2 gap-4">
1900
+ <Card>
1901
+ <CardHeader>
1902
+ <CardTitle className="text-sm flex items-center gap-2">
1903
+ <Terminal className="h-4 w-4" strokeWidth={1.5} /> Install the package
1904
+ </CardTitle>
1905
+ </CardHeader>
1906
+ <CardContent>
1907
+ <CodeBlock>{`pnpm add ${corePkg.name}`}</CodeBlock>
1908
+ </CardContent>
1909
+ </Card>
1910
+ <Card>
1911
+ <CardHeader>
1912
+ <CardTitle className="text-sm flex items-center gap-2">
1913
+ <Palette className="h-4 w-4" strokeWidth={1.5} /> Import styles globally
1914
+ </CardTitle>
1915
+ </CardHeader>
1916
+ <CardContent>
1917
+ <CodeBlock>{`import "${corePkg.name}/styles.css";`}</CodeBlock>
1918
+ </CardContent>
1919
+ </Card>
922
1920
  </div>
923
1921
  </div>
924
1922
 
925
- <p className="text-sm text-muted-foreground">
926
- Prefer to run individual layer prompts (voice, ethics, tokens, etc.) by hand?
927
- Find them in <code className="font-mono text-xs">prompts/</code> with order in{" "}
928
- <code className="font-mono text-xs">prompts/README.md</code>. Works for personal
929
- products, internal tools, agency work, anything.
930
- </p>
931
- </section>
932
-
933
- {/* CHROMATIC */}
934
- <section className="space-y-6" id="chromatic">
935
- <SectionHeading
936
- eyebrow="Visual regression"
937
- title="Wire up Chromatic"
938
- description="Every Storybook story snapshotted on every PR — light + dark, multiple viewports, with per-story a11y captured by addon-a11y. The infrastructure is already in this fork. The only thing left is connecting it to your Chromatic project."
939
- />
940
- <div className="grid lg:grid-cols-3 gap-4">
1923
+ {/* Component Usage */}
1924
+ <div>
1925
+ <h3 className="text-sm font-semibold mb-3">Using Components</h3>
941
1926
  <Card>
942
- <CardHeader className="pb-3">
943
- <CardTitle className="text-sm flex items-center gap-2">
944
- <GitCompare className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
945
- 1. Create the project
946
- </CardTitle>
947
- </CardHeader>
948
- <CardContent className="text-sm text-muted-foreground space-y-2">
949
- <p>
950
- Sign in at{" "}
951
- <code className="font-mono text-xs text-foreground">
952
- chromatic.com/start
953
- </code>{" "}
954
- with the GitHub account that owns this repo. Click{" "}
955
- <em>Add project</em> and pick this fork. Copy the token (starts with{" "}
956
- <code className="font-mono text-xs text-foreground">chpt_</code>).
957
- </p>
958
- </CardContent>
959
- </Card>
960
- <Card>
961
- <CardHeader className="pb-3">
962
- <CardTitle className="text-sm flex items-center gap-2">
963
- <KeyRound className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
964
- 2. Add the secret
965
- </CardTitle>
966
- </CardHeader>
967
- <CardContent className="text-sm text-muted-foreground space-y-2">
968
- <p>
969
- GitHub → repo → Settings → Secrets and variables → Actions → New
970
- repository secret. Name it{" "}
971
- <code className="font-mono text-xs text-foreground">
972
- CHROMATIC_PROJECT_TOKEN
973
- </code>
974
- , paste the token, save. Don&apos;t commit it anywhere.
975
- </p>
976
- </CardContent>
977
- </Card>
978
- <Card>
979
- <CardHeader className="pb-3">
1927
+ <CardHeader>
980
1928
  <CardTitle className="text-sm flex items-center gap-2">
981
- <CheckCircle2 className="h-4 w-4 text-muted-foreground" strokeWidth={1.5} />
982
- 3. Seed the baseline
1929
+ <Code2 className="h-4 w-4" strokeWidth={1.5} /> Import and use
983
1930
  </CardTitle>
984
1931
  </CardHeader>
985
- <CardContent className="text-sm text-muted-foreground space-y-2">
986
- <p>
987
- Push to <code className="font-mono text-xs text-foreground">main</code>{" "}
988
- and the workflow runs automatically. Or run locally:{" "}
989
- <code className="font-mono text-xs text-foreground">
990
- CHROMATIC_PROJECT_TOKEN=… pnpm chromatic
991
- </code>
992
- . First build becomes the rolling baseline.
993
- </p>
1932
+ <CardContent>
1933
+ <CodeBlock>{`import { Button, Card, Input } from "${corePkg.name}/components/ui";
1934
+
1935
+ export function Example() {
1936
+ return (
1937
+ <Card>
1938
+ <Button>Start here</Button>
1939
+ <Input placeholder="Enter text..." />
1940
+ </Card>
1941
+ );
1942
+ }`}</CodeBlock>
994
1943
  </CardContent>
995
1944
  </Card>
1945
+ <p className="text-sm text-muted-foreground mt-3">
1946
+ All components are unstyled by default and accept Tailwind class strings via <code className="font-mono text-xs text-foreground">className</code>. Full component registry with props, variants, and a11y contracts at <code className="font-mono text-xs text-foreground">layer-5-component-registry/component-registry.json</code>.
1947
+ </p>
996
1948
  </div>
997
1949
 
998
- <CopyablePromptCard
999
- title="Or let Claude Code wire it up"
1000
- description="Paste this into a Claude Code session at the repo root. Claude walks through every step, pauses for the human-only parts (creating the project, adding the secret), and never logs the token."
1001
- prompt={CHROMATIC_PROMPT}
1002
- icon={GitCompare}
1003
- />
1950
+ {/* Customization */}
1951
+ <div>
1952
+ <h3 className="text-sm font-semibold mb-3">Customization</h3>
1953
+ <div className="grid md:grid-cols-2 gap-4">
1954
+ <Card>
1955
+ <CardHeader>
1956
+ <CardTitle className="text-sm flex items-center gap-2">
1957
+ <Palette className="h-4 w-4" strokeWidth={1.5} /> Tokens & theme
1958
+ </CardTitle>
1959
+ </CardHeader>
1960
+ <CardContent className="text-sm text-muted-foreground space-y-2">
1961
+ <p>Edit <code className="font-mono text-xs text-foreground">tokens.json</code> to customize colors, spacing, typography, and motion. Run <code className="font-mono text-xs text-foreground">pnpm build:tokens</code> to regenerate CSS variables.</p>
1962
+ </CardContent>
1963
+ </Card>
1964
+ <Card>
1965
+ <CardHeader>
1966
+ <CardTitle className="text-sm flex items-center gap-2">
1967
+ <Sparkles className="h-4 w-4" strokeWidth={1.5} /> Brand config
1968
+ </CardTitle>
1969
+ </CardHeader>
1970
+ <CardContent className="text-sm text-muted-foreground space-y-2">
1971
+ <p>Update <code className="font-mono text-xs text-foreground">brand.config.ts</code> with your mission, audience, product surfaces, and brand colors. This flows into the preview shell header and the Customize tab.</p>
1972
+ </CardContent>
1973
+ </Card>
1974
+ </div>
1975
+ </div>
1004
1976
 
1005
- <p className="text-sm text-muted-foreground">
1006
- Full reference, troubleshooting, and the kill-switch (
1007
- <code className="font-mono text-xs">CHROMATIC_ENABLED=false</code>) live in{" "}
1008
- <code className="font-mono text-xs">docs/chromatic-setup.md</code>. The
1009
- workflow is at{" "}
1010
- <code className="font-mono text-xs">.github/workflows/chromatic.yml</code> and
1011
- its config at{" "}
1012
- <code className="font-mono text-xs">chromatic.config.json</code> — already
1013
- tuned for{" "}
1014
- <code className="font-mono text-xs">onlyChanged: true</code> and{" "}
1015
- <code className="font-mono text-xs">autoAcceptChanges: main</code>.
1016
- </p>
1017
- </section>
1977
+ {/* Development */}
1978
+ <div>
1979
+ <h3 className="text-sm font-semibold mb-3">Development</h3>
1980
+ <div className="grid md:grid-cols-2 gap-4">
1981
+ <Card>
1982
+ <CardHeader>
1983
+ <CardTitle className="text-sm flex items-center gap-2">
1984
+ <FileText className="h-4 w-4" strokeWidth={1.5} /> Storybook
1985
+ </CardTitle>
1986
+ </CardHeader>
1987
+ <CardContent className="text-sm text-muted-foreground">
1988
+ <CodeBlock>{`pnpm storybook`}</CodeBlock>
1989
+ <p className="mt-2">Test matrix: every component, all variants, all sizes, disabled/loading/error states.</p>
1990
+ </CardContent>
1991
+ </Card>
1992
+ <Card>
1993
+ <CardHeader>
1994
+ <CardTitle className="text-sm flex items-center gap-2">
1995
+ <Eye className="h-4 w-4" strokeWidth={1.5} /> Preview app
1996
+ </CardTitle>
1997
+ </CardHeader>
1998
+ <CardContent className="text-sm text-muted-foreground">
1999
+ <CodeBlock>{`pnpm dev`}</CodeBlock>
2000
+ <p className="mt-2">Live preview with all tabs: Components, Cards, Dashboard, Mail, Pricing, Customize, Layers.</p>
2001
+ </CardContent>
2002
+ </Card>
2003
+ </div>
2004
+ </div>
1018
2005
 
1019
- <Separator />
2006
+ {/* Reference */}
2007
+ <div>
2008
+ <h3 className="text-sm font-semibold mb-3">Reference</h3>
2009
+ <div className="grid md:grid-cols-2 gap-4">
2010
+ <Card>
2011
+ <CardHeader>
2012
+ <CardTitle className="text-sm">TypeScript support</CardTitle>
2013
+ </CardHeader>
2014
+ <CardContent className="text-sm text-muted-foreground">
2015
+ Full TypeScript support. All components export prop types. CVA variants are fully typed.
2016
+ </CardContent>
2017
+ </Card>
2018
+ <Card>
2019
+ <CardHeader>
2020
+ <CardTitle className="text-sm">Browser & Node support</CardTitle>
2021
+ </CardHeader>
2022
+ <CardContent className="text-sm text-muted-foreground">
2023
+ Node 18+. Browsers: Chrome, Firefox, Safari, Edge (latest 2 versions). ESM only.
2024
+ </CardContent>
2025
+ </Card>
2026
+ <Card>
2027
+ <CardHeader>
2028
+ <CardTitle className="text-sm">Accessibility</CardTitle>
2029
+ </CardHeader>
2030
+ <CardContent className="text-sm text-muted-foreground">
2031
+ WCAG 2.2 AAA baseline. 7:1 contrast, 44×44px touch targets, full keyboard support, <code className="font-mono text-xs text-foreground">prefers-reduced-motion</code> honored.
2032
+ </CardContent>
2033
+ </Card>
2034
+ <Card>
2035
+ <CardHeader>
2036
+ <CardTitle className="text-sm">Pre-commit checks</CardTitle>
2037
+ </CardHeader>
2038
+ <CardContent className="text-sm text-muted-foreground">
2039
+ <code className="font-mono text-xs text-foreground">pnpm a11y</code> runs contrast audit + a11y lint. <code className="font-mono text-xs text-foreground">pnpm check:stories</code> blocks commits without story coverage.
2040
+ </CardContent>
2041
+ </Card>
2042
+ </div>
2043
+ </div>
1020
2044
 
1021
- {/* QUICKSTART */}
1022
- <section className="space-y-6" id="quickstart">
2045
+ {/* Docs Reference */}
2046
+ <Card>
2047
+ <CardHeader>
2048
+ <CardTitle className="text-sm">Full docs</CardTitle>
2049
+ </CardHeader>
2050
+ <CardContent className="text-sm text-muted-foreground space-y-2">
2051
+ <p>
2052
+ See <code className="font-mono text-xs text-foreground">README.md</code> for getting started, <code className="font-mono text-xs text-foreground">DESIGN.md</code> for design principles and layout rhythm, <code className="font-mono text-xs text-foreground">COMPONENT_INDEX.md</code> for the human-readable component guide, and <code className="font-mono text-xs text-foreground">CLAUDE.md</code> for agent/AI integration rules.
2053
+ </p>
2054
+ </CardContent>
2055
+ </Card>
2056
+ </section>
2057
+
2058
+ {/* FEEDBACK */}
2059
+ <section className="space-y-6">
1023
2060
  <SectionHeading
1024
- eyebrow="Quickstart"
1025
- title="Wire it up in three commands"
1026
- description="The system is published as an npm package and consumed like any other library. Tokens, styles, and components ship together."
2061
+ eyebrow="Questions?"
2062
+ title="Feedback or need help?"
2063
+ description="Found a bug? Have an idea? Let me know what's working and what's not."
1027
2064
  />
1028
2065
  <div className="grid md:grid-cols-2 gap-4">
1029
2066
  <Card>
1030
2067
  <CardHeader>
1031
2068
  <CardTitle className="text-base flex items-center gap-2">
1032
- <Terminal className="h-4 w-4" strokeWidth={1.5} /> 1. Install
2069
+ <MessageSquare className="h-4 w-4" strokeWidth={1.5} /> Report feedback
1033
2070
  </CardTitle>
1034
2071
  </CardHeader>
1035
- <CardContent>
1036
- <CodeBlock>{`pnpm add ${corePkg.name}`}</CodeBlock>
2072
+ <CardContent className="text-sm text-muted-foreground">
2073
+ Open an issue at{" "}
2074
+ {brand.repo ? (
2075
+ <a
2076
+ href={`${brand.repo}/issues`}
2077
+ target="_blank"
2078
+ rel="noreferrer"
2079
+ className="font-mono text-xs text-link underline-offset-4 hover:underline"
2080
+ >
2081
+ {brand.repo.replace(/^https?:\/\//, "")}/issues
2082
+ </a>
2083
+ ) : (
2084
+ <code className="font-mono text-xs text-foreground">
2085
+ github repo not configured
2086
+ </code>
2087
+ )}
2088
+ .
1037
2089
  </CardContent>
1038
2090
  </Card>
1039
2091
  <Card>
1040
2092
  <CardHeader>
1041
2093
  <CardTitle className="text-base flex items-center gap-2">
1042
- <Palette className="h-4 w-4" strokeWidth={1.5} /> 2. Import styles
1043
- </CardTitle>
1044
- </CardHeader>
1045
- <CardContent>
1046
- <CodeBlock>{`import "${corePkg.name}/styles.css";`}</CodeBlock>
1047
- </CardContent>
1048
- </Card>
1049
- <Card className="md:col-span-2">
1050
- <CardHeader>
1051
- <CardTitle className="text-base flex items-center gap-2">
1052
- <Code2 className="h-4 w-4" strokeWidth={1.5} /> 3. Use components
2094
+ <Briefcase className="h-4 w-4" strokeWidth={1.5} /> Hire me
1053
2095
  </CardTitle>
1054
2096
  </CardHeader>
1055
- <CardContent>
1056
- <CodeBlock>{`import { Button } from "${corePkg.name}/components/ui/button";
1057
-
1058
- export function Example() {
1059
- return <Button>Get started</Button>;
1060
- }`}</CodeBlock>
2097
+ <CardContent className="text-sm text-muted-foreground">
2098
+ Need help getting your design system set up, or want a fractional design leader plugged into your team? I do both — long-running engagements and one-off stand-ups.{" "}
2099
+ <a
2100
+ href="mailto:work@matthewstephens.com"
2101
+ className="text-primary hover:underline font-medium"
2102
+ >
2103
+ work@matthewstephens.com
2104
+ </a>
1061
2105
  </CardContent>
1062
2106
  </Card>
1063
2107
  </div>
1064
2108
  </section>
1065
2109
 
1066
- {/* DOCS */}
1067
- <section className="space-y-6" id="docs">
1068
- <SectionHeading
1069
- eyebrow="Documentation"
1070
- title="Where to look next"
1071
- description="Everything that ships with this system is in the repo. Designers, engineers, and AI all read from the same source."
1072
- />
1073
- <div className="grid md:grid-cols-2 lg:grid-cols-3 gap-3">
1074
- {[
1075
- {
1076
- file: "README.md",
1077
- label: "Read me first",
1078
- desc: "Project overview, install, scripts.",
1079
- icon: BookOpen,
1080
- },
1081
- {
1082
- file: "DESIGN.md",
1083
- label: "Design principles",
1084
- desc: "Visual system, layout rhythm, a11y floors.",
1085
- icon: Eye,
1086
- },
1087
- {
1088
- file: "CLAUDE.md",
1089
- label: "AI instructions",
1090
- desc: "How agents work in this repo. Read by Cursor + Claude Code.",
1091
- icon: Sparkles,
1092
- },
1093
- {
1094
- file: "DESIGN_SYSTEM_STACK.md",
1095
- label: "The stack",
1096
- desc: "All ten layers — what's shipped and what's deferred.",
1097
- icon: Layers,
1098
- },
1099
- {
1100
- file: "COMPONENT_INDEX.md",
1101
- label: "Component index",
1102
- desc: "Human-readable component guide.",
1103
- icon: Package,
1104
- },
1105
- {
1106
- file: "CLIENT_ONBOARDING.md",
1107
- label: "Onboarding",
1108
- desc: "How this system was set up for you, end to end.",
1109
- icon: FileText,
1110
- },
1111
- {
1112
- file: "docs/chromatic-setup.md",
1113
- label: "Chromatic setup",
1114
- desc: "Wire up visual regression on this fork. One-time, ~5 minutes.",
1115
- icon: GitCompare,
1116
- },
1117
- ].map((doc) => (
1118
- <Card key={doc.file}>
1119
- <CardContent className="py-4 flex items-start gap-3">
1120
- <doc.icon
1121
- className="h-5 w-5 text-muted-foreground mt-0.5 shrink-0"
1122
- strokeWidth={1.5}
1123
- />
1124
- <div className="min-w-0 flex-1">
1125
- <p className="font-medium text-sm">{doc.label}</p>
1126
- <p className="text-sm text-muted-foreground">{doc.desc}</p>
1127
- <p className="text-xs font-mono text-muted-foreground mt-1.5 truncate">
1128
- {doc.file}
1129
- </p>
1130
- </div>
1131
- </CardContent>
1132
- </Card>
1133
- ))}
1134
- </div>
1135
- </section>
1136
-
1137
- {/* WHAT TO DO NEXT */}
1138
- <section className="space-y-6">
1139
- <SectionHeading
1140
- eyebrow="Handoff"
1141
- title="What to do next"
1142
- description="A short, ordered list. Do them in sequence — each one unlocks the next."
1143
- />
1144
- <Card>
1145
- <CardContent className="py-6 space-y-5">
1146
- {[
1147
- {
1148
- step: "01",
1149
- title: "Walk the Customize tab",
1150
- body: "Try the brand color, fonts, type scale, and density controls. Save when you find a combo you like — it writes back to tokens.json.",
1151
- },
1152
- {
1153
- step: "02",
1154
- title: "Skim the Layers tab",
1155
- body: "Every governance doc — voice, ethics, a11y — is editable from here. Edits commit to git in one click.",
1156
- },
1157
- {
1158
- step: "03",
1159
- title: "Read CLAUDE.md and DESIGN.md",
1160
- body: "These two files teach humans and AI how to work in the system. They're the most-read files in the repo.",
1161
- },
1162
- {
1163
- step: "04",
1164
- title: "Wire up Chromatic visual regression",
1165
- body: "Create a Chromatic project for the fork, add the CHROMATIC_PROJECT_TOKEN GitHub secret, and let the first push to main seed the baseline. Walk-through in the Visual regression section above; full reference at docs/chromatic-setup.md.",
1166
- },
1167
- {
1168
- step: "05",
1169
- title: "Install in your product",
1170
- body: "Use the quickstart above. The package is already published — just point your app at it.",
1171
- },
1172
- {
1173
- step: "06",
1174
- title: "Tell us when you outgrow v1",
1175
- body: "v2 layers (search, Figma sync, agent PRs) get added when a real signal asks for them. We'll know it's time when you do.",
1176
- },
1177
- ].map((item) => (
1178
- <div key={item.step} className="flex items-start gap-4">
1179
- <div className="text-2xl font-mono font-semibold text-muted-foreground shrink-0 w-12">
1180
- {item.step}
1181
- </div>
1182
- <div className="space-y-1 flex-1 min-w-0">
1183
- <p className="font-semibold">{item.title}</p>
1184
- <p className="text-sm text-muted-foreground leading-relaxed">
1185
- {item.body}
1186
- </p>
1187
- </div>
1188
- </div>
1189
- ))}
1190
- </CardContent>
1191
- </Card>
1192
- </section>
1193
-
1194
2110
  {/* FOOTER */}
1195
2111
  <Separator />
1196
2112
  <footer className="space-y-3 pb-8">
1197
2113
  <div className="flex items-center justify-between flex-wrap gap-4">
1198
2114
  <div className="flex items-center gap-2">
1199
- <div className="h-7 w-7 rounded-md bg-primary flex items-center justify-center">
1200
- <Sparkles className="h-4 w-4 text-primary-foreground" strokeWidth={1.5} />
2115
+ <div className="h-7 w-7 rounded-md bg-primary flex items-center justify-center text-primary-foreground">
2116
+ <BrandMark size={16} />
1201
2117
  </div>
1202
2118
  <span className="font-semibold">{brand.name}</span>
1203
2119
  <Badge variant="outline" className="text-xs">
@@ -1215,11 +2131,6 @@ export function Example() {
1215
2131
  <span className="font-mono">{corePkg.name}</span>
1216
2132
  </div>
1217
2133
  </div>
1218
- <p className="text-xs text-muted-foreground">
1219
- <Zap className="h-3 w-3 inline mr-1" strokeWidth={1.5} />
1220
- This dashboard reads live from <span className="font-mono">tokens.json</span>{" "}
1221
- and the component registry. Every number updates as the system evolves.
1222
- </p>
1223
2134
  </footer>
1224
2135
  </div>
1225
2136
  </ScrollArea>