vibes-plug 2.5.0 → 2.11.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 (177) hide show
  1. package/.claude/rules/vibes-plug-core.md +32 -0
  2. package/.cursor/rules/vibes-plug-core.mdc +51 -0
  3. package/.cursorrules +42 -0
  4. package/AGENTS.md +37 -7
  5. package/BLUEPRINT.md +309 -217
  6. package/CHANGELOG.md +133 -1
  7. package/CLAUDE.md +70 -0
  8. package/LICENSE +1 -1
  9. package/README.md +641 -415
  10. package/index.js +19 -0
  11. package/package.json +44 -8
  12. package/plugin.json +24 -7
  13. package/scripts/generate_swarm_gif.py +295 -0
  14. package/scripts/install.js +201 -0
  15. package/skills/accessibility-testing-expert/SKILL.md +116 -0
  16. package/skills/ai-cost-token-optimizer/SKILL.md +82 -52
  17. package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
  18. package/skills/ai-llm-integration-expert/SKILL.md +185 -178
  19. package/skills/ai-media-generation-expert/SKILL.md +172 -0
  20. package/skills/ai-prompt-engineering-expert/SKILL.md +84 -0
  21. package/skills/angular-expert/SKILL.md +148 -0
  22. package/skills/api-design-expert/SKILL.md +6 -3
  23. package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
  24. package/skills/app-analyzer-optimizer/SKILL.md +6 -3
  25. package/skills/apple-ecosystem-expert/SKILL.md +144 -141
  26. package/skills/{asisten_ramah → asisten-ramah}/SKILL.md +7 -1
  27. package/skills/astro-framework-expert/SKILL.md +200 -0
  28. package/skills/async-queue-temporal-expert/SKILL.md +210 -24
  29. package/skills/authentication-identity-expert/SKILL.md +278 -275
  30. package/skills/auto-doc-updater/SKILL.md +7 -1
  31. package/skills/autonomous-chaos-monkey/SKILL.md +63 -63
  32. package/skills/autonomous-red-teamer/SKILL.md +172 -28
  33. package/skills/autonomous-tdd-debugger/SKILL.md +70 -64
  34. package/skills/background-jobs-queue-expert/SKILL.md +235 -0
  35. package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
  36. package/skills/blockchain-web3-expert/SKILL.md +115 -0
  37. package/skills/bootstrap-to-modern/SKILL.md +9 -6
  38. package/skills/brainstorming/SKILL.md +58 -50
  39. package/skills/browser-automation-expert/SKILL.md +197 -21
  40. package/skills/bun-runtime-expert/SKILL.md +7 -1
  41. package/skills/chatbot-messaging-expert/SKILL.md +114 -0
  42. package/skills/ci-cd-devops-architect/SKILL.md +45 -36
  43. package/skills/cloud-hosting-expert/SKILL.md +7 -1
  44. package/skills/coderabbit/SKILL.md +7 -1
  45. package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
  46. package/skills/cron-scheduler-expert/SKILL.md +303 -297
  47. package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
  48. package/skills/data-telemetry-expert/SKILL.md +7 -1
  49. package/skills/data-visualization-expert/SKILL.md +154 -0
  50. package/skills/database-migration-versioning-expert/SKILL.md +90 -0
  51. package/skills/database-orm-expert/SKILL.md +13 -3
  52. package/skills/dependency-upgrade-migrator/SKILL.md +300 -294
  53. package/skills/design-system-architect/SKILL.md +278 -259
  54. package/skills/desktop-electron-expert/SKILL.md +128 -0
  55. package/skills/documentation-site-expert/SKILL.md +59 -0
  56. package/skills/doku-mcp-server/SKILL.md +7 -1
  57. package/skills/doku-payment-gateway/SKILL.md +7 -1
  58. package/skills/domain-driven-design-expert/SKILL.md +82 -0
  59. package/skills/e2e-testing-expert/SKILL.md +7 -1
  60. package/skills/ecommerce-expert/SKILL.md +87 -0
  61. package/skills/edge-serverless-db-expert/SKILL.md +98 -42
  62. package/skills/email-notification-expert/SKILL.md +367 -361
  63. package/skills/error-resilience-expert/SKILL.md +485 -479
  64. package/skills/event-driven-architect/SKILL.md +7 -1
  65. package/skills/feature-flag-analytics-expert/SKILL.md +65 -45
  66. package/skills/file-upload-media-expert/SKILL.md +436 -430
  67. package/skills/firebase-security-expert/SKILL.md +7 -1
  68. package/skills/form-validation-expert/SKILL.md +406 -400
  69. package/skills/fullstack-expert/SKILL.md +60 -1
  70. package/skills/gemini-agent-booster/SKILL.md +173 -135
  71. package/skills/geospatial-maps-expert/SKILL.md +80 -0
  72. package/skills/global-a11y-i18n-expert/SKILL.md +7 -1
  73. package/skills/glsl-shader-expert/SKILL.md +106 -100
  74. package/skills/go-programming-expert/SKILL.md +21 -15
  75. package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
  76. package/skills/graphql-apollo-expert/SKILL.md +113 -107
  77. package/skills/headless-cms-expert/SKILL.md +181 -0
  78. package/skills/hig/SKILL.md +7 -1
  79. package/skills/js-backend-expert/SKILL.md +218 -216
  80. package/skills/legacy-code-translator/SKILL.md +70 -64
  81. package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
  82. package/skills/logging-error-tracking-expert/SKILL.md +343 -337
  83. package/skills/mcp-client-orchestrator/SKILL.md +75 -69
  84. package/skills/mcp-server-architect/SKILL.md +294 -194
  85. package/skills/micro-frontend-architect/SKILL.md +111 -105
  86. package/skills/mobile-expo-expert/SKILL.md +8 -2
  87. package/skills/mobile-push-notification-expert/SKILL.md +70 -50
  88. package/skills/modern-css-native-expert/SKILL.md +189 -0
  89. package/skills/monday-design-aesthetic/SKILL.md +7 -1
  90. package/skills/monorepo-architect/SKILL.md +7 -1
  91. package/skills/mpa-orchestrator/SKILL.md +20 -1
  92. package/skills/multi-agent-orchestration/SKILL.md +254 -234
  93. package/skills/multiple-entry-points/SKILL.md +37 -1
  94. package/skills/mvc-expert/SKILL.md +7 -1
  95. package/skills/n8n-automation-expert/SKILL.md +89 -0
  96. package/skills/nextjs-app-router-expert/SKILL.md +148 -0
  97. package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
  98. package/skills/payment-gateway-expert/SKILL.md +85 -1
  99. package/skills/pdf-document-generation-expert/SKILL.md +91 -0
  100. package/skills/performance-web-vitals/SKILL.md +7 -1
  101. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -57
  102. package/skills/prd-architect/SKILL.md +7 -1
  103. package/skills/proactive-background-watcher/SKILL.md +67 -61
  104. package/skills/production-ready-hardener/SKILL.md +461 -455
  105. package/skills/project-context-mapper/SKILL.md +84 -78
  106. package/skills/pwa-offline-first-expert/SKILL.md +185 -0
  107. package/skills/python-programming-expert/SKILL.md +407 -401
  108. package/skills/rate-limit-abuse-prevention/SKILL.md +376 -370
  109. package/skills/realtime-collaboration-expert/SKILL.md +55 -1
  110. package/skills/rich-text-editor-expert/SKILL.md +177 -0
  111. package/skills/rust-programming-expert/SKILL.md +7 -1
  112. package/skills/saas-billing/SKILL.md +7 -1
  113. package/skills/saas-multi-tenant/SKILL.md +7 -1
  114. package/skills/saas-mvp-launcher/SKILL.md +20 -1
  115. package/skills/saas-transformer/SKILL.md +499 -488
  116. package/skills/scalability-clean-code/SKILL.md +7 -1
  117. package/skills/search-engine-expert/SKILL.md +89 -0
  118. package/skills/secure-fuzz-testing/SKILL.md +7 -1
  119. package/skills/self-evolving-memory-graph/SKILL.md +90 -74
  120. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -57
  121. package/skills/senior-frontend/SKILL.md +141 -161
  122. package/skills/seo/SKILL.md +41 -17
  123. package/skills/session-context-loader/SKILL.md +82 -76
  124. package/skills/session-handoff-resume/SKILL.md +7 -1
  125. package/skills/{skill_baru → skill-baru}/SKILL.md +8 -2
  126. package/skills/solidjs-expert/SKILL.md +80 -0
  127. package/skills/spa-orchestrator/SKILL.md +20 -1
  128. package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
  129. package/skills/state-management-expert/SKILL.md +7 -1
  130. package/skills/supabase-migration/SKILL.md +47 -1
  131. package/skills/supabase-security-expert/SKILL.md +7 -1
  132. package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
  133. package/skills/svg-animation-motion-expert/SKILL.md +115 -0
  134. package/skills/tailwind-expert/SKILL.md +88 -136
  135. package/skills/tanstack-query-expert/SKILL.md +7 -1
  136. package/skills/tauri-expert/SKILL.md +7 -1
  137. package/skills/token-saver/SKILL.md +1 -1
  138. package/skills/typescript-expert/SKILL.md +12 -6
  139. package/skills/ui-components-expert/SKILL.md +165 -279
  140. package/skills/ui-ux-pro-max/SKILL.md +23 -3
  141. package/skills/vector-db-rag-expert/SKILL.md +175 -19
  142. package/skills/vibe-code-gardener/SKILL.md +1 -1
  143. package/skills/visual-qa-vision-agent/SKILL.md +70 -64
  144. package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
  145. package/skills/vue-frontend-expert/SKILL.md +131 -125
  146. package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
  147. package/skills/web-3d-graphics-expert/SKILL.md +136 -130
  148. package/skills/web-game-engine-expert/SKILL.md +101 -95
  149. package/skills/web-scraper/SKILL.md +157 -207
  150. package/skills/website-design-cloner/SKILL.md +179 -173
  151. package/skills/webxr-ar-vr-expert/SKILL.md +122 -116
  152. package/skills/wordpress-headless-expert/SKILL.md +144 -0
  153. package/skills/zero-to-prod-orchestrator/SKILL.md +52 -27
  154. package/skills/zero-trust-secret-vault/SKILL.md +87 -39
  155. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  156. package/.github/workflows/publish.yml +0 -20
  157. package/CONTRIBUTING.md +0 -199
  158. package/SECURITY.md +0 -21
  159. package/banner.png +0 -0
  160. package/skills/autonomous-swarm-director/SKILL.md +0 -69
  161. package/skills/hyper-context-synthesizer/SKILL.md +0 -55
  162. package/skills/llm-cost-arbitrage-router/SKILL.md +0 -59
  163. package/skills/senior-fullstack/SKILL.md +0 -167
  164. package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
  165. package/skills/senior-fullstack/references/development_workflows.md +0 -222
  166. package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
  167. package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
  168. package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
  169. package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
  170. package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
  171. package/skills/seo-geo/SKILL.md +0 -188
  172. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  173. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  174. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  175. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  176. package/skills/ui_ux_expert/SKILL.md +0 -125
  177. package/vibes-swarm-demo.gif +0 -0
@@ -1,260 +1,279 @@
1
- ---
2
- name: design-system-architect
3
- description: "Expert guide for designing, building, and maintaining scalable UI design systems with design tokens, headless primitives (Radix/Base UI), Tailwind v4 @theme, and WCAG 2.2 accessibility in English and Indonesian."
4
- author: vibes-plug-swarm
5
- ---
6
-
7
- # Design System Architect (2026 Edition — shadcn/ui Registry)
8
-
9
- [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
-
11
- ---
12
-
13
- <a name="english"></a>
14
- ## English
15
-
16
- ### Description
17
- Expert guide for building and maintaining scalable UI design systems. Covers design tokens with OKLCH and Tailwind v4 `@theme`, headless component primitives (Radix UI, **Base UI 1.x**), **shadcn/ui registry** for distributable component libraries, CVA for type-safe variants, and WCAG 2.2 accessibility compliance.
18
-
19
- ### Trigger Conditions
20
- - Building a shared UI component library from scratch.
21
- - Setting up design tokens (colors, typography, spacing) with Tailwind v4.
22
- - Using headless primitives (Radix UI, Base UI 1.x) with custom styling.
23
- - Distributing components via the **shadcn/ui registry** format.
24
- - Auditing a component library for WCAG 2.2 accessibility compliance.
25
-
26
- ### Design Token Foundation (Tailwind v4 + OKLCH)
27
-
28
- ```css
29
- /* packages/ui/src/tokens.css */
30
- @import "tailwindcss";
31
-
32
- @theme {
33
- /* --- Color System (OKLCH for wide-gamut P3 displays) --- */
34
- /* Brand */
35
- --color-brand-50: oklch(97% 0.015 250);
36
- --color-brand-100: oklch(93% 0.04 250);
37
- --color-brand-500: oklch(55% 0.22 250);
38
- --color-brand-700: oklch(40% 0.18 250);
39
- --color-brand-900: oklch(20% 0.10 250);
40
-
41
- /* Semantic (maps to brand in light/dark automatically) */
42
- --color-primary: var(--color-brand-500);
43
- --color-primary-fg: oklch(100% 0 0); /* White */
44
- --color-surface: oklch(100% 0 0); /* White */
45
- --color-surface-2: oklch(97% 0.005 250);
46
- --color-border: oklch(90% 0.01 250);
47
- --color-text: oklch(15% 0.02 250);
48
- --color-text-muted: oklch(50% 0.015 250);
49
- --color-destructive: oklch(55% 0.22 25); /* Red */
50
-
51
- /* --- Fluid Typography (clamp) --- */
52
- --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
53
- --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
54
- --font-size-xs: clamp(0.7rem, 0.17vi + 0.66rem, 0.75rem);
55
- --font-size-sm: clamp(0.8rem, 0.17vi + 0.76rem, 0.875rem);
56
- --font-size-base: clamp(0.9rem, 0.17vi + 0.86rem, 1rem);
57
- --font-size-lg: clamp(1rem, 0.17vi + 0.96rem, 1.125rem);
58
- --font-size-xl: clamp(1.1rem, 0.34vi + 1.02rem, 1.25rem);
59
- --font-size-2xl: clamp(1.2rem, 0.69vi + 1.03rem, 1.5rem);
60
- --font-size-3xl: clamp(1.5rem, 0.86vi + 1.29rem, 1.875rem);
61
- --font-size-4xl: clamp(1.8rem, 1.03vi + 1.54rem, 2.25rem);
62
-
63
- /* --- Spacing & Radius --- */
64
- --radius-sm: 0.25rem;
65
- --radius-md: 0.5rem;
66
- --radius-lg: 0.75rem;
67
- --radius-xl: 1rem;
68
- --radius-full: 9999px;
69
-
70
- /* --- Animation --- */
71
- --animate-fade-in: fade-in 0.2s ease-out;
72
- --animate-slide-up: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
73
- --animate-scale-in: scale-in 0.2s ease-out;
74
- }
75
-
76
- /* Dark mode tokens */
77
- @variant dark {
78
- :root {
79
- --color-surface: oklch(10% 0.015 250);
80
- --color-surface-2: oklch(15% 0.015 250);
81
- --color-border: oklch(25% 0.02 250);
82
- --color-text: oklch(95% 0.005 250);
83
- --color-text-muted: oklch(60% 0.01 250);
84
- }
85
- }
86
- ```
87
-
88
- ### Component Architecture
89
-
90
- #### Headless + Styled Pattern (Base UI 1.x / Radix UI)
91
- Use headless primitives for accessibility, apply styles via Tailwind + CVA:
92
-
93
- ```typescript
94
- // packages/ui/src/button.tsx
95
- import * as React from 'react';
96
- import { cva, type VariantProps } from 'class-variance-authority';
97
- import { cn } from '@/lib/utils';
98
-
99
- const buttonVariants = cva(
100
- // Base styles
101
- 'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 select-none',
102
- {
103
- variants: {
104
- variant: {
105
- default: 'bg-primary text-primary-fg shadow-sm hover:brightness-110 active:brightness-90',
106
- secondary: 'bg-surface-2 text-text border border-border hover:bg-surface hover:border-brand-300',
107
- destructive: 'bg-destructive text-white hover:brightness-110',
108
- ghost: 'hover:bg-surface-2 text-text',
109
- link: 'text-primary underline-offset-4 hover:underline p-0 h-auto',
110
- },
111
- size: {
112
- sm: 'h-8 px-3 text-xs',
113
- md: 'h-9 px-4 text-sm',
114
- lg: 'h-11 px-6 text-base',
115
- icon: 'h-9 w-9',
116
- },
117
- },
118
- defaultVariants: { variant: 'default', size: 'md' },
119
- }
120
- );
121
-
122
- export interface ButtonProps
123
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
124
- VariantProps<typeof buttonVariants> {
125
- asChild?: boolean;
126
- }
127
-
128
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
129
- ({ className, variant, size, ...props }, ref) => (
130
- <button
131
- ref={ref}
132
- className={cn(buttonVariants({ variant, size }), className)}
133
- {...props}
134
- />
135
- )
136
- );
137
- Button.displayName = 'Button';
138
-
139
- export { Button, buttonVariants };
140
- ```
141
-
142
- ### Component Layout (Container Queries over Media Queries)
143
- Avoid `@media` queries for internal component styling. Use **CSS Container Queries (`@container`)** so components respond to their wrapper, not the viewport. This makes components truly reusable anywhere.
144
- ```tsx
145
- // Example of a container-aware component using Tailwind v4
146
- <div className="@container">
147
- <div className="flex flex-col @md:flex-row gap-4">
148
- <div className="p-4 bg-surface rounded-xl">Fluid Card</div>
149
- </div>
150
- </div>
151
- ```
152
-
153
- ### shadcn/ui Registry Distributable Components (2026)
154
-
155
- shadcn/ui v2 introduces a **registry** system — distribute your components as a shareable library that others can `npx shadcn add` into their projects:
156
-
157
- ```json
158
- // registry.json — defines your component library
159
- {
160
- "$schema": "https://ui.shadcn.com/schema/registry.json",
161
- "name": "my-ui",
162
- "homepage": "https://ui.myapp.com",
163
- "items": [
164
- {
165
- "name": "button",
166
- "type": "registry:ui",
167
- "title": "Button",
168
- "description": "Multi-variant button component with CVA",
169
- "files": [
170
- { "path": "registry/ui/button.tsx", "type": "registry:ui" }
171
- ],
172
- "tailwind": {
173
- "config": {
174
- "theme": {
175
- "extend": {
176
- "colors": { "primary": "hsl(var(--primary))" }
177
- }
178
- }
179
- }
180
- }
181
- }
182
- ]
183
- }
184
- ```
185
-
186
- ```bash
187
- # Users install your components directly
188
- npx shadcn add https://ui.myapp.com/registry.json button
189
- npx shadcn add https://ui.myapp.com/registry.json card dialog
190
- ```
191
-
192
- ### Base UI 1.x — Unstyled Accessibility Primitives
193
- Base UI (from MUI team) is the 2026 alternative to Radix UI with React 19 native support:
194
- ```typescript
195
- import { Dialog, Button, Select } from '@base-ui-components/react';
196
-
197
- // Fully unstyled apply any className/Tailwind styles
198
- <Dialog.Root>
199
- <Dialog.Trigger render={<Button />}>Open Dialog</Dialog.Trigger>
200
- <Dialog.Portal>
201
- <Dialog.Backdrop className="fixed inset-0 bg-black/50 animate-fade-in" />
202
- <Dialog.Popup className="fixed inset-0 m-auto h-fit max-w-md rounded-xl bg-surface p-6 shadow-xl animate-slide-up">
203
- <Dialog.Title className="text-lg font-semibold">Title</Dialog.Title>
204
- <Dialog.Close className="absolute right-4 top-4">✕</Dialog.Close>
205
- </Dialog.Popup>
206
- </Dialog.Portal>
207
- </Dialog.Root>
208
- ```
209
-
210
- ### WCAG 2.2 Accessibility Checklist
211
- - [ ] All interactive elements have visible focus indicators (`ring-2`).
212
- - [ ] Color contrast ≥ 4.5:1 (text), ≥ 3:1 (large text / UI components).
213
- - [ ] All images have `alt` text; decorative images have `alt=""`.
214
- - [ ] All form inputs have associated `<label>` elements.
215
- - [ ] Keyboard navigation works for all interactions (Tab, Enter, Space, Escape, Arrow keys).
216
- - [ ] `aria-label` or `aria-labelledby` on icon buttons.
217
- - [ ] Modals trap focus and restore it on close.
218
- - [ ] No content relies on color alone to convey information.
219
- - [ ] Touch targets 24×24px (WCAG 2.2 new requirement).
220
-
221
- ---
222
-
223
- <a name="bahasa-indonesia"></a>
224
- ## Bahasa Indonesia
225
-
226
- ### Deskripsi
227
- Panduan ahli untuk membangun dan memelihara design system UI yang skalabel. Mencakup design token dengan OKLCH dan `@theme` Tailwind v4, primitif komponen headless (Radix UI, **Base UI 1.x**), **registry shadcn/ui** untuk distribusi library komponen, CVA untuk varian type-safe, dan kepatuhan aksesibilitas WCAG 2.2.
228
-
229
- ### Kondisi Pemicu
230
- - Membangun library komponen UI bersama dari awal.
231
- - Menyiapkan design token (warna, tipografi, spacing) dengan Tailwind v4.
232
- - Menggunakan primitif headless (Radix UI, Base UI 1.x) dengan styling kustom.
233
- - Mendistribusikan komponen via format **registry shadcn/ui**.
234
- - Mengaudit library komponen untuk kepatuhan aksesibilitas WCAG 2.2.
235
-
236
- ### Fondasi Design Token (Tailwind v4 + OKLCH)
237
- Definisikan semua token di CSS menggunakan direktif `@theme`. Gunakan warna OKLCH untuk tampilan P3 wide-gamut. Definisikan token semantik (`--color-primary`, `--color-surface`, `--color-border`) yang secara otomatis beradaptasi antara mode terang/gelap melalui `@variant dark`.
238
-
239
- ### Arsitektur Komponen
240
- Gunakan pola Headless + Styled: primitif headless (Base UI/Radix) untuk aksesibilitas, gaya melalui Tailwind + CVA (class-variance-authority) untuk varian type-safe.
241
-
242
- **Container Queries (`@container`)**: DILARANG keras menggunakan `@media` query (misal `md:`, `lg:`) untuk layout di dalam sebuah komponen. Gunakan **Container Queries (`@md:`, `@lg:`)** agar komponen dapat menyesuaikan diri dengan lebar pembungkusnya, bukan lebar layar secara keseluruhan. Ini membuat komponen Anda 100% *reusable*.
243
-
244
- ### Registry shadcn/ui Komponen yang Dapat Didistribusikan (2026)
245
- shadcn/ui v2 memperkenalkan sistem registry — distribusikan komponen Anda sebagai library yang dapat dibagikan sehingga orang lain dapat menginstalnya dengan `npx shadcn add [url] [komponen]`.
246
-
247
- ### Base UI 1.x — Primitif Aksesibilitas Tanpa Gaya
248
- Base UI (dari tim MUI) adalah alternatif Radix UI untuk 2026 dengan dukungan native React 19. Sepenuhnya tanpa gaya — terapkan className/Tailwind apapun.
249
-
250
- ### Checklist Aksesibilitas WCAG 2.2
251
- - Semua elemen interaktif memiliki indikator fokus yang terlihat.
252
- - Kontras warna 4.5:1 (teks), 3:1 (komponen UI).
253
- - Semua input form memiliki elemen `<label>` terkait.
254
- - Navigasi keyboard berfungsi untuk semua interaksi.
255
- - Modal menjebak fokus dan memulihkannya saat ditutup.
256
- - Target sentuh 24×24px (persyaratan baru WCAG 2.2).
257
-
258
-
259
- ## Orchestration & Integration
1
+ ---
2
+ name: design-system-architect
3
+ description: "Expert guide for designing, building, and maintaining scalable UI design systems with design tokens, headless primitives, Material Design 3 (M3), Tailwind v4 @theme, and WCAG 2.2 accessibility."
4
+ author: "Roedy Rustam"
5
+ ---
6
+
7
+ # Design System Architect (2026 Edition — shadcn/ui Registry)
8
+
9
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
+
11
+ ---
12
+
13
+ <a name="english"></a>
14
+ ## English
15
+
16
+ ### Description
17
+ Expert guide for building and maintaining scalable UI design systems. Covers design tokens with OKLCH and Tailwind v4 `@theme`, **Material Design 3 (M3)** integration, headless component primitives (Radix UI, **Base UI 1.x**), **shadcn/ui registry** for distributable component libraries, CVA for type-safe variants, and WCAG 2.2 accessibility compliance.
18
+
19
+ ### Trigger Conditions
20
+ - Building a shared UI component library from scratch.
21
+ - Setting up design tokens (colors, typography, spacing) with Tailwind v4.
22
+ - Applying Material Design 3 (M3) principles (https://m3.material.io/).
23
+ - Using headless primitives (Radix UI, Base UI 1.x) with custom styling.
24
+ - Distributing components via the **shadcn/ui registry** format.
25
+ - Auditing a component library for WCAG 2.2 accessibility compliance.
26
+
27
+ ### Design Token Foundation (Tailwind v4 + OKLCH)
28
+
29
+ ```css
30
+ /* packages/ui/src/tokens.css */
31
+ @import "tailwindcss";
32
+
33
+ @theme {
34
+ /* --- Color System (OKLCH for wide-gamut P3 displays) --- */
35
+ /* Brand */
36
+ --color-brand-50: oklch(97% 0.015 250);
37
+ --color-brand-100: oklch(93% 0.04 250);
38
+ --color-brand-500: oklch(55% 0.22 250);
39
+ --color-brand-700: oklch(40% 0.18 250);
40
+ --color-brand-900: oklch(20% 0.10 250);
41
+
42
+ /* Semantic (maps to brand in light/dark automatically) */
43
+ --color-primary: var(--color-brand-500);
44
+ --color-primary-fg: oklch(100% 0 0); /* White */
45
+ --color-surface: oklch(100% 0 0); /* White */
46
+ --color-surface-2: oklch(97% 0.005 250);
47
+ --color-border: oklch(90% 0.01 250);
48
+ --color-text: oklch(15% 0.02 250);
49
+ --color-text-muted: oklch(50% 0.015 250);
50
+ --color-destructive: oklch(55% 0.22 25); /* Red */
51
+
52
+ /* --- Fluid Typography (clamp) --- */
53
+ --font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
54
+ --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
55
+ --font-size-xs: clamp(0.7rem, 0.17vi + 0.66rem, 0.75rem);
56
+ --font-size-sm: clamp(0.8rem, 0.17vi + 0.76rem, 0.875rem);
57
+ --font-size-base: clamp(0.9rem, 0.17vi + 0.86rem, 1rem);
58
+ --font-size-lg: clamp(1rem, 0.17vi + 0.96rem, 1.125rem);
59
+ --font-size-xl: clamp(1.1rem, 0.34vi + 1.02rem, 1.25rem);
60
+ --font-size-2xl: clamp(1.2rem, 0.69vi + 1.03rem, 1.5rem);
61
+ --font-size-3xl: clamp(1.5rem, 0.86vi + 1.29rem, 1.875rem);
62
+ --font-size-4xl: clamp(1.8rem, 1.03vi + 1.54rem, 2.25rem);
63
+
64
+ /* --- Spacing & Radius --- */
65
+ --radius-sm: 0.25rem;
66
+ --radius-md: 0.5rem;
67
+ --radius-lg: 0.75rem;
68
+ --radius-xl: 1rem;
69
+ --radius-full: 9999px;
70
+
71
+ /* --- Animation --- */
72
+ --animate-fade-in: fade-in 0.2s ease-out;
73
+ --animate-slide-up: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
74
+ --animate-scale-in: scale-in 0.2s ease-out;
75
+ }
76
+
77
+ /* Dark mode tokens */
78
+ @variant dark {
79
+ :root {
80
+ --color-surface: oklch(10% 0.015 250);
81
+ --color-surface-2: oklch(15% 0.015 250);
82
+ --color-border: oklch(25% 0.02 250);
83
+ --color-text: oklch(95% 0.005 250);
84
+ --color-text-muted: oklch(60% 0.01 250);
85
+ }
86
+ }
87
+ ```
88
+
89
+ ### Material Design 3 (M3) Integration
90
+ When requested to follow **Material Design 3 (https://m3.material.io/)**, implement the following M3 token principles in your design system:
91
+ 1. **Color Roles**: Map Tailwind colors to M3 roles (`Primary`, `Secondary`, `Tertiary`, `Error`, `Surface`, `Outline`). Implement `On-*` colors for text/icons on top of those roles, and `*-Container` / `On-*-Container` for lower emphasis. Support Dynamic Color if applicable.
92
+ 2. **Typography Scale**: Use M3 naming conventions: `Display`, `Headline`, `Title`, `Body`, `Label` (each with `Large`, `Medium`, `Small` sizes).
93
+ 3. **Elevation & Surface**: Use M3 Elevation levels (0 to 5) implemented via subtle shadows and surface tint colors, not just heavy drop shadows.
94
+ 4. **Shapes**: Map `--radius-*` to M3 shape families: `None`, `Extra Small`, `Small`, `Medium`, `Large`, `Extra Large`, `Full`.
95
+
96
+ ### Component Architecture
97
+
98
+ #### Headless + Styled Pattern (Base UI 1.x / Radix UI)
99
+ Use headless primitives for accessibility, apply styles via Tailwind + CVA:
100
+
101
+ ```typescript
102
+ // packages/ui/src/button.tsx
103
+ import * as React from 'react';
104
+ import { cva, type VariantProps } from 'class-variance-authority';
105
+ import { cn } from '@/lib/utils';
106
+
107
+ const buttonVariants = cva(
108
+ // Base styles
109
+ 'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 select-none',
110
+ {
111
+ variants: {
112
+ variant: {
113
+ default: 'bg-primary text-primary-fg shadow-sm hover:brightness-110 active:brightness-90',
114
+ secondary: 'bg-surface-2 text-text border border-border hover:bg-surface hover:border-brand-300',
115
+ destructive: 'bg-destructive text-white hover:brightness-110',
116
+ ghost: 'hover:bg-surface-2 text-text',
117
+ link: 'text-primary underline-offset-4 hover:underline p-0 h-auto',
118
+ },
119
+ size: {
120
+ sm: 'h-8 px-3 text-xs',
121
+ md: 'h-9 px-4 text-sm',
122
+ lg: 'h-11 px-6 text-base',
123
+ icon: 'h-9 w-9',
124
+ },
125
+ },
126
+ defaultVariants: { variant: 'default', size: 'md' },
127
+ }
128
+ );
129
+
130
+ export interface ButtonProps
131
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
132
+ VariantProps<typeof buttonVariants> {
133
+ asChild?: boolean;
134
+ }
135
+
136
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
137
+ ({ className, variant, size, ...props }, ref) => (
138
+ <button
139
+ ref={ref}
140
+ className={cn(buttonVariants({ variant, size }), className)}
141
+ {...props}
142
+ />
143
+ )
144
+ );
145
+ Button.displayName = 'Button';
146
+
147
+ export { Button, buttonVariants };
148
+ ```
149
+
150
+ ### Component Layout (Container Queries over Media Queries)
151
+ Avoid `@media` queries for internal component styling. Use **CSS Container Queries (`@container`)** so components respond to their wrapper, not the viewport. This makes components truly reusable anywhere.
152
+ ```tsx
153
+ // Example of a container-aware component using Tailwind v4
154
+ <div className="@container">
155
+ <div className="flex flex-col @md:flex-row gap-4">
156
+ <div className="p-4 bg-surface rounded-xl">Fluid Card</div>
157
+ </div>
158
+ </div>
159
+ ```
160
+
161
+ ### shadcn/ui Registry — Distributable Components (2026)
162
+
163
+ shadcn/ui v2 introduces a **registry** system — distribute your components as a shareable library that others can `npx shadcn add` into their projects:
164
+
165
+ ```json
166
+ // registry.json — defines your component library
167
+ {
168
+ "$schema": "https://ui.shadcn.com/schema/registry.json",
169
+ "name": "my-ui",
170
+ "homepage": "https://ui.myapp.com",
171
+ "items": [
172
+ {
173
+ "name": "button",
174
+ "type": "registry:ui",
175
+ "title": "Button",
176
+ "description": "Multi-variant button component with CVA",
177
+ "files": [
178
+ { "path": "registry/ui/button.tsx", "type": "registry:ui" }
179
+ ],
180
+ "tailwind": {
181
+ "config": {
182
+ "theme": {
183
+ "extend": {
184
+ "colors": { "primary": "hsl(var(--primary))" }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ ]
191
+ }
192
+ ```
193
+
194
+ ```bash
195
+ # Users install your components directly
196
+ npx shadcn add https://ui.myapp.com/registry.json button
197
+ npx shadcn add https://ui.myapp.com/registry.json card dialog
198
+ ```
199
+
200
+ ### Base UI 1.x — Unstyled Accessibility Primitives
201
+ Base UI (from MUI team) is the 2026 alternative to Radix UI with React 19 native support:
202
+ ```typescript
203
+ import { Dialog, Button, Select } from '@base-ui-components/react';
204
+
205
+ // Fully unstyled — apply any className/Tailwind styles
206
+ <Dialog.Root>
207
+ <Dialog.Trigger render={<Button />}>Open Dialog</Dialog.Trigger>
208
+ <Dialog.Portal>
209
+ <Dialog.Backdrop className="fixed inset-0 bg-black/50 animate-fade-in" />
210
+ <Dialog.Popup className="fixed inset-0 m-auto h-fit max-w-md rounded-xl bg-surface p-6 shadow-xl animate-slide-up">
211
+ <Dialog.Title className="text-lg font-semibold">Title</Dialog.Title>
212
+ <Dialog.Close className="absolute right-4 top-4">✕</Dialog.Close>
213
+ </Dialog.Popup>
214
+ </Dialog.Portal>
215
+ </Dialog.Root>
216
+ ```
217
+
218
+ ### WCAG 2.2 Accessibility Checklist
219
+ - [ ] All interactive elements have visible focus indicators (`ring-2`).
220
+ - [ ] Color contrast ≥ 4.5:1 (text), ≥ 3:1 (large text / UI components).
221
+ - [ ] All images have `alt` text; decorative images have `alt=""`.
222
+ - [ ] All form inputs have associated `<label>` elements.
223
+ - [ ] Keyboard navigation works for all interactions (Tab, Enter, Space, Escape, Arrow keys).
224
+ - [ ] `aria-label` or `aria-labelledby` on icon buttons.
225
+ - [ ] Modals trap focus and restore it on close.
226
+ - [ ] No content relies on color alone to convey information.
227
+ - [ ] Touch targets 24×24px (WCAG 2.2 new requirement).
228
+
229
+ ---
230
+
231
+ <a name="bahasa-indonesia"></a>
232
+ ## Bahasa Indonesia
233
+
234
+ ### Integrasi Orkestrasi
235
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
236
+
237
+ ### Deskripsi
238
+ Panduan ahli untuk membangun dan memelihara design system UI yang skalabel. Mencakup design token dengan OKLCH dan `@theme` Tailwind v4, primitif komponen headless (Radix UI, **Base UI 1.x**), **registry shadcn/ui** untuk distribusi library komponen, CVA untuk varian type-safe, dan kepatuhan aksesibilitas WCAG 2.2.
239
+
240
+ ### Kondisi Pemicu
241
+ - Membangun library komponen UI bersama dari awal.
242
+ - Menyiapkan design token (warna, tipografi, spacing) dengan Tailwind v4.
243
+ - Menerapkan prinsip Material Design 3 (M3) (https://m3.material.io/).
244
+ - Menggunakan primitif headless (Radix UI, Base UI 1.x) dengan styling kustom.
245
+ - Mendistribusikan komponen via format **registry shadcn/ui**.
246
+ - Mengaudit library komponen untuk kepatuhan aksesibilitas WCAG 2.2.
247
+
248
+ ### Fondasi Design Token (Tailwind v4 + OKLCH)
249
+ Definisikan semua token di CSS menggunakan direktif `@theme`. Gunakan warna OKLCH untuk tampilan P3 wide-gamut. Definisikan token semantik (`--color-primary`, `--color-surface`, `--color-border`) yang secara otomatis beradaptasi antara mode terang/gelap melalui `@variant dark`.
250
+
251
+ ### Integrasi Material Design 3 (M3)
252
+ Jika diminta mengikuti **Material Design 3 (https://m3.material.io/)**, terapkan prinsip token M3 berikut:
253
+ 1. **Peran Warna (Color Roles)**: Petakan warna ke peran M3 (`Primary`, `Secondary`, `Tertiary`, `Error`, `Surface`, `Outline`). Gunakan warna `On-*` untuk teks di atasnya, dan `*-Container` / `On-*-Container` untuk penekanan lebih rendah.
254
+ 2. **Skala Tipografi**: Gunakan penamaan M3: `Display`, `Headline`, `Title`, `Body`, `Label` (dengan ukuran `Large`, `Medium`, `Small`).
255
+ 3. **Elevasi & Permukaan**: Gunakan tingkat Elevasi M3 (0 hingga 5) melalui bayangan halus dan warna tint permukaan (surface tint).
256
+ 4. **Bentuk (Shapes)**: Petakan `--radius-*` ke keluarga bentuk M3: `None`, `Extra Small`, `Small`, `Medium`, `Large`, `Extra Large`, `Full`.
257
+
258
+ ### Arsitektur Komponen
259
+ Gunakan pola Headless + Styled: primitif headless (Base UI/Radix) untuk aksesibilitas, gaya melalui Tailwind + CVA (class-variance-authority) untuk varian type-safe.
260
+
261
+ **Container Queries (`@container`)**: DILARANG keras menggunakan `@media` query (misal `md:`, `lg:`) untuk layout di dalam sebuah komponen. Gunakan **Container Queries (`@md:`, `@lg:`)** agar komponen dapat menyesuaikan diri dengan lebar pembungkusnya, bukan lebar layar secara keseluruhan. Ini membuat komponen Anda 100% *reusable*.
262
+
263
+ ### Registry shadcn/ui — Komponen yang Dapat Didistribusikan (2026)
264
+ shadcn/ui v2 memperkenalkan sistem registry — distribusikan komponen Anda sebagai library yang dapat dibagikan sehingga orang lain dapat menginstalnya dengan `npx shadcn add [url] [komponen]`.
265
+
266
+ ### Base UI 1.x — Primitif Aksesibilitas Tanpa Gaya
267
+ Base UI (dari tim MUI) adalah alternatif Radix UI untuk 2026 dengan dukungan native React 19. Sepenuhnya tanpa gaya — terapkan className/Tailwind apapun.
268
+
269
+ ### Checklist Aksesibilitas WCAG 2.2
270
+ - Semua elemen interaktif memiliki indikator fokus yang terlihat.
271
+ - Kontras warna ≥ 4.5:1 (teks), ≥ 3:1 (komponen UI).
272
+ - Semua input form memiliki elemen `<label>` terkait.
273
+ - Navigasi keyboard berfungsi untuk semua interaksi.
274
+ - Modal menjebak fokus dan memulihkannya saat ditutup.
275
+ - Target sentuh ≥ 24×24px (persyaratan baru WCAG 2.2).
276
+
277
+
278
+ ## Orchestration & Integration
260
279
  - Integrates with frontend orchestrators, Tailwind v4, Base UI, and shadcn/ui.