vibes-plug 1.0.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 (183) 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 +96 -0
  5. package/BLUEPRINT.md +309 -125
  6. package/CHANGELOG.md +183 -1
  7. package/CLAUDE.md +70 -0
  8. package/LICENSE +1 -1
  9. package/README.md +641 -263
  10. package/index.js +19 -0
  11. package/package.json +61 -25
  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 -0
  17. package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
  18. package/skills/ai-llm-integration-expert/SKILL.md +147 -122
  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 +316 -309
  23. package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
  24. package/skills/app-analyzer-optimizer/SKILL.md +195 -188
  25. package/skills/apple-ecosystem-expert/SKILL.md +145 -0
  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 +240 -0
  29. package/skills/authentication-identity-expert/SKILL.md +279 -45
  30. package/skills/auto-doc-updater/SKILL.md +219 -203
  31. package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
  32. package/skills/autonomous-red-teamer/SKILL.md +203 -0
  33. package/skills/autonomous-tdd-debugger/SKILL.md +71 -0
  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 +93 -86
  38. package/skills/brainstorming/SKILL.md +381 -353
  39. package/skills/browser-automation-expert/SKILL.md +222 -0
  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 +81 -45
  43. package/skills/cloud-hosting-expert/SKILL.md +249 -243
  44. package/skills/coderabbit/SKILL.md +197 -191
  45. package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
  46. package/skills/cron-scheduler-expert/SKILL.md +304 -0
  47. package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
  48. package/skills/data-telemetry-expert/SKILL.md +218 -212
  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 +303 -293
  52. package/skills/dependency-upgrade-migrator/SKILL.md +301 -0
  53. package/skills/design-system-architect/SKILL.md +278 -242
  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 +257 -0
  57. package/skills/doku-payment-gateway/SKILL.md +233 -0
  58. package/skills/domain-driven-design-expert/SKILL.md +82 -0
  59. package/skills/e2e-testing-expert/SKILL.md +320 -314
  60. package/skills/ecommerce-expert/SKILL.md +87 -0
  61. package/skills/edge-serverless-db-expert/SKILL.md +99 -0
  62. package/skills/email-notification-expert/SKILL.md +368 -0
  63. package/skills/error-resilience-expert/SKILL.md +486 -0
  64. package/skills/event-driven-architect/SKILL.md +86 -80
  65. package/skills/feature-flag-analytics-expert/SKILL.md +66 -0
  66. package/skills/file-upload-media-expert/SKILL.md +437 -0
  67. package/skills/firebase-security-expert/SKILL.md +7 -1
  68. package/skills/form-validation-expert/SKILL.md +407 -0
  69. package/skills/fullstack-expert/SKILL.md +260 -201
  70. package/skills/fullstack-expert/references/api_design_guide.md +466 -466
  71. package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
  72. package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
  73. package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
  74. package/skills/gemini-agent-booster/SKILL.md +142 -104
  75. package/skills/geospatial-maps-expert/SKILL.md +80 -0
  76. package/skills/global-a11y-i18n-expert/SKILL.md +86 -80
  77. package/skills/glsl-shader-expert/SKILL.md +107 -0
  78. package/skills/go-programming-expert/SKILL.md +300 -294
  79. package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
  80. package/skills/graphql-apollo-expert/SKILL.md +114 -0
  81. package/skills/headless-cms-expert/SKILL.md +181 -0
  82. package/skills/hig/SKILL.md +193 -187
  83. package/skills/js-backend-expert/SKILL.md +218 -191
  84. package/skills/legacy-code-translator/SKILL.md +71 -0
  85. package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
  86. package/skills/logging-error-tracking-expert/SKILL.md +344 -0
  87. package/skills/mcp-client-orchestrator/SKILL.md +76 -0
  88. package/skills/mcp-server-architect/SKILL.md +226 -126
  89. package/skills/micro-frontend-architect/SKILL.md +112 -0
  90. package/skills/mobile-expo-expert/SKILL.md +191 -185
  91. package/skills/mobile-push-notification-expert/SKILL.md +71 -0
  92. package/skills/modern-css-native-expert/SKILL.md +189 -0
  93. package/skills/monday-design-aesthetic/SKILL.md +72 -66
  94. package/skills/monorepo-architect/SKILL.md +232 -226
  95. package/skills/mpa-orchestrator/SKILL.md +120 -101
  96. package/skills/multi-agent-orchestration/SKILL.md +173 -153
  97. package/skills/multiple-entry-points/SKILL.md +91 -55
  98. package/skills/mvc-expert/SKILL.md +237 -231
  99. package/skills/n8n-automation-expert/SKILL.md +89 -0
  100. package/skills/nextjs-app-router-expert/SKILL.md +148 -0
  101. package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
  102. package/skills/payment-gateway-expert/SKILL.md +129 -45
  103. package/skills/pdf-document-generation-expert/SKILL.md +91 -0
  104. package/skills/performance-web-vitals/SKILL.md +337 -331
  105. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
  106. package/skills/prd-architect/SKILL.md +206 -190
  107. package/skills/proactive-background-watcher/SKILL.md +68 -0
  108. package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
  109. package/skills/production-ready-hardener/SKILL.md +461 -468
  110. package/skills/production-ready-hardener/references/production_checklist.md +161 -161
  111. package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
  112. package/skills/project-context-mapper/SKILL.md +85 -0
  113. package/skills/pwa-offline-first-expert/SKILL.md +185 -0
  114. package/skills/python-programming-expert/SKILL.md +407 -270
  115. package/skills/rate-limit-abuse-prevention/SKILL.md +377 -0
  116. package/skills/realtime-collaboration-expert/SKILL.md +99 -45
  117. package/skills/rich-text-editor-expert/SKILL.md +177 -0
  118. package/skills/rust-programming-expert/SKILL.md +240 -234
  119. package/skills/saas-billing/SKILL.md +382 -376
  120. package/skills/saas-multi-tenant/SKILL.md +256 -236
  121. package/skills/saas-mvp-launcher/SKILL.md +30 -1
  122. package/skills/saas-transformer/SKILL.md +499 -445
  123. package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
  124. package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
  125. package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
  126. package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
  127. package/skills/scalability-clean-code/SKILL.md +234 -228
  128. package/skills/search-engine-expert/SKILL.md +89 -0
  129. package/skills/secure-fuzz-testing/SKILL.md +7 -1
  130. package/skills/self-evolving-memory-graph/SKILL.md +91 -0
  131. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
  132. package/skills/senior-frontend/SKILL.md +85 -105
  133. package/skills/seo/SKILL.md +258 -224
  134. package/skills/session-context-loader/SKILL.md +83 -0
  135. package/skills/session-handoff-resume/SKILL.md +163 -157
  136. package/skills/{skill_baru → skill-baru}/SKILL.md +177 -146
  137. package/skills/solidjs-expert/SKILL.md +80 -0
  138. package/skills/spa-orchestrator/SKILL.md +306 -287
  139. package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
  140. package/skills/state-management-expert/SKILL.md +277 -271
  141. package/skills/supabase-migration/SKILL.md +47 -1
  142. package/skills/supabase-security-expert/SKILL.md +248 -242
  143. package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
  144. package/skills/svg-animation-motion-expert/SKILL.md +115 -0
  145. package/skills/tailwind-expert/SKILL.md +139 -187
  146. package/skills/tanstack-query-expert/SKILL.md +204 -198
  147. package/skills/tauri-expert/SKILL.md +7 -1
  148. package/skills/token-saver/SKILL.md +118 -110
  149. package/skills/typescript-expert/SKILL.md +329 -278
  150. package/skills/ui-components-expert/SKILL.md +166 -63
  151. package/skills/ui-ux-pro-max/SKILL.md +221 -200
  152. package/skills/vector-db-rag-expert/SKILL.md +208 -0
  153. package/skills/vibe-code-gardener/SKILL.md +180 -172
  154. package/skills/visual-qa-vision-agent/SKILL.md +71 -0
  155. package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
  156. package/skills/vue-frontend-expert/SKILL.md +132 -0
  157. package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
  158. package/skills/web-3d-graphics-expert/SKILL.md +137 -0
  159. package/skills/web-game-engine-expert/SKILL.md +102 -0
  160. package/skills/web-scraper/SKILL.md +98 -146
  161. package/skills/website-design-cloner/SKILL.md +180 -0
  162. package/skills/webxr-ar-vr-expert/SKILL.md +123 -0
  163. package/skills/wordpress-headless-expert/SKILL.md +144 -0
  164. package/skills/zero-to-prod-orchestrator/SKILL.md +231 -180
  165. package/skills/zero-trust-secret-vault/SKILL.md +88 -0
  166. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  167. package/CONTRIBUTING.md +0 -199
  168. package/SECURITY.md +0 -21
  169. package/banner.png +0 -0
  170. package/skills/senior-fullstack/SKILL.md +0 -167
  171. package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
  172. package/skills/senior-fullstack/references/development_workflows.md +0 -222
  173. package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
  174. package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
  175. package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
  176. package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
  177. package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
  178. package/skills/seo-geo/SKILL.md +0 -188
  179. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  180. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  181. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  182. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  183. package/skills/ui_ux_expert/SKILL.md +0 -114
@@ -1,243 +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."
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
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`, 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
- /* --- Typography --- */
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: 0.75rem;
55
- --font-size-sm: 0.875rem;
56
- --font-size-base: 1rem;
57
- --font-size-lg: 1.125rem;
58
- --font-size-xl: 1.25rem;
59
- --font-size-2xl: 1.5rem;
60
- --font-size-3xl: 1.875rem;
61
- --font-size-4xl: 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
- ### shadcn/ui Registry — Distributable Components (2026)
143
-
144
- shadcn/ui v2 introduces a **registry** system — distribute your components as a shareable library that others can `npx shadcn add` into their projects:
145
-
146
- ```json
147
- // registry.json defines your component library
148
- {
149
- "$schema": "https://ui.shadcn.com/schema/registry.json",
150
- "name": "my-ui",
151
- "homepage": "https://ui.myapp.com",
152
- "items": [
153
- {
154
- "name": "button",
155
- "type": "registry:ui",
156
- "title": "Button",
157
- "description": "Multi-variant button component with CVA",
158
- "files": [
159
- { "path": "registry/ui/button.tsx", "type": "registry:ui" }
160
- ],
161
- "tailwind": {
162
- "config": {
163
- "theme": {
164
- "extend": {
165
- "colors": { "primary": "hsl(var(--primary))" }
166
- }
167
- }
168
- }
169
- }
170
- }
171
- ]
172
- }
173
- ```
174
-
175
- ```bash
176
- # Users install your components directly
177
- npx shadcn add https://ui.myapp.com/registry.json button
178
- npx shadcn add https://ui.myapp.com/registry.json card dialog
179
- ```
180
-
181
- ### Base UI 1.x — Unstyled Accessibility Primitives
182
- Base UI (from MUI team) is the 2026 alternative to Radix UI with React 19 native support:
183
- ```typescript
184
- import { Dialog, Button, Select } from '@base-ui-components/react';
185
-
186
- // Fully unstyled — apply any className/Tailwind styles
187
- <Dialog.Root>
188
- <Dialog.Trigger render={<Button />}>Open Dialog</Dialog.Trigger>
189
- <Dialog.Portal>
190
- <Dialog.Backdrop className="fixed inset-0 bg-black/50 animate-fade-in" />
191
- <Dialog.Popup className="fixed inset-0 m-auto h-fit max-w-md rounded-xl bg-surface p-6 shadow-xl animate-slide-up">
192
- <Dialog.Title className="text-lg font-semibold">Title</Dialog.Title>
193
- <Dialog.Close className="absolute right-4 top-4">✕</Dialog.Close>
194
- </Dialog.Popup>
195
- </Dialog.Portal>
196
- </Dialog.Root>
197
- ```
198
-
199
- ### WCAG 2.2 Accessibility Checklist
200
- - [ ] All interactive elements have visible focus indicators (`ring-2`).
201
- - [ ] Color contrast 4.5:1 (text), 3:1 (large text / UI components).
202
- - [ ] All images have `alt` text; decorative images have `alt=""`.
203
- - [ ] All form inputs have associated `<label>` elements.
204
- - [ ] Keyboard navigation works for all interactions (Tab, Enter, Space, Escape, Arrow keys).
205
- - [ ] `aria-label` or `aria-labelledby` on icon buttons.
206
- - [ ] Modals trap focus and restore it on close.
207
- - [ ] No content relies on color alone to convey information.
208
- - [ ] Touch targets ≥ 24×24px (WCAG 2.2 new requirement).
209
-
210
- ---
211
-
212
- <a name="bahasa-indonesia"></a>
213
- ## Bahasa Indonesia
214
-
215
- ### Deskripsi
216
- 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.
217
-
218
- ### Kondisi Pemicu
219
- - Membangun library komponen UI bersama dari awal.
220
- - Menyiapkan design token (warna, tipografi, spacing) dengan Tailwind v4.
221
- - Menggunakan primitif headless (Radix UI, Base UI 1.x) dengan styling kustom.
222
- - Mendistribusikan komponen via format **registry shadcn/ui**.
223
- - Mengaudit library komponen untuk kepatuhan aksesibilitas WCAG 2.2.
224
-
225
- ### Fondasi Design Token (Tailwind v4 + OKLCH)
226
- 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`.
227
-
228
- ### Arsitektur Komponen
229
- Gunakan pola Headless + Styled: primitif headless (Base UI/Radix) untuk aksesibilitas, gaya melalui Tailwind + CVA (class-variance-authority) untuk varian type-safe.
230
-
231
- ### Registry shadcn/ui — Komponen yang Dapat Didistribusikan (2026)
232
- 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]`.
233
-
234
- ### Base UI 1.x — Primitif Aksesibilitas Tanpa Gaya
235
- Base UI (dari tim MUI) adalah alternatif Radix UI untuk 2026 dengan dukungan native React 19. Sepenuhnya tanpa gaya — terapkan className/Tailwind apapun.
236
-
237
- ### Checklist Aksesibilitas WCAG 2.2
238
- - Semua elemen interaktif memiliki indikator fokus yang terlihat.
239
- - Kontras warna ≥ 4.5:1 (teks), ≥ 3:1 (komponen UI).
240
- - Semua input form memiliki elemen `<label>` terkait.
241
- - Navigasi keyboard berfungsi untuk semua interaksi.
242
- - Modal menjebak fokus dan memulihkannya saat ditutup.
243
- - Target sentuh 24×24px (persyaratan baru WCAG 2.2).
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
279
+ - Integrates with frontend orchestrators, Tailwind v4, Base UI, and shadcn/ui.