vibes-plug 2.5.0 → 2.14.1

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 (187) 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 +319 -217
  6. package/CHANGELOG.md +170 -1
  7. package/CLAUDE.md +70 -0
  8. package/LICENSE +1 -1
  9. package/README.md +611 -415
  10. package/index.js +19 -0
  11. package/package.json +44 -8
  12. package/plugin.json +24 -7
  13. package/scripts/check-anti-slop.js +53 -0
  14. package/scripts/generate_swarm_gif.py +295 -0
  15. package/scripts/install.js +201 -0
  16. package/skills/accessibility-testing-expert/SKILL.md +116 -0
  17. package/skills/ai-llm-integration-expert/SKILL.md +192 -178
  18. package/skills/ai-media-generation-expert/SKILL.md +172 -0
  19. package/skills/ai-prompt-engineering-expert/SKILL.md +134 -0
  20. package/skills/angular-expert/SKILL.md +148 -0
  21. package/skills/anti-slop/SKILL.md +133 -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/astro-framework-expert/SKILL.md +200 -0
  27. package/skills/async-queue-temporal-expert/SKILL.md +189 -26
  28. package/skills/authentication-identity-expert/SKILL.md +78 -181
  29. package/skills/autonomous-red-teamer/SKILL.md +172 -28
  30. package/skills/autonomous-tdd-debugger/SKILL.md +70 -64
  31. package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
  32. package/skills/blockchain-web3-expert/SKILL.md +115 -0
  33. package/skills/bootstrap-to-modern/SKILL.md +9 -6
  34. package/skills/brainstorming/SKILL.md +60 -52
  35. package/skills/browser-automation-expert/SKILL.md +197 -21
  36. package/skills/bun-runtime-expert/SKILL.md +7 -1
  37. package/skills/chatbot-messaging-expert/SKILL.md +114 -0
  38. package/skills/ci-cd-devops-architect/SKILL.md +45 -36
  39. package/skills/cloud-hosting-expert/SKILL.md +7 -1
  40. package/skills/coderabbit/SKILL.md +7 -1
  41. package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
  42. package/skills/cron-scheduler-expert/SKILL.md +303 -297
  43. package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
  44. package/skills/data-telemetry-expert/SKILL.md +7 -1
  45. package/skills/data-visualization-expert/SKILL.md +154 -0
  46. package/skills/database-orm-expert/SKILL.md +165 -294
  47. package/skills/deep-research-analyst/SKILL.md +136 -0
  48. package/skills/dependency-upgrade-migrator/SKILL.md +300 -294
  49. package/skills/design-system-architect/SKILL.md +309 -260
  50. package/skills/desktop-electron-expert/SKILL.md +128 -0
  51. package/skills/documentation-site-expert/SKILL.md +59 -0
  52. package/skills/doku-mcp-server/SKILL.md +7 -1
  53. package/skills/doku-payment-gateway/SKILL.md +7 -1
  54. package/skills/domain-driven-design-expert/SKILL.md +82 -0
  55. package/skills/e2e-testing-expert/SKILL.md +7 -1
  56. package/skills/ecommerce-expert/SKILL.md +87 -0
  57. package/skills/email-notification-expert/SKILL.md +393 -360
  58. package/skills/error-resilience-expert/SKILL.md +506 -479
  59. package/skills/event-driven-architect/SKILL.md +7 -1
  60. package/skills/feature-flag-analytics-expert/SKILL.md +65 -45
  61. package/skills/file-upload-media-expert/SKILL.md +436 -430
  62. package/skills/firebase-security-expert/SKILL.md +7 -1
  63. package/skills/form-validation-expert/SKILL.md +406 -400
  64. package/skills/fullstack-expert/SKILL.md +184 -202
  65. package/skills/gemini-agent-booster/SKILL.md +173 -135
  66. package/skills/geospatial-maps-expert/SKILL.md +80 -0
  67. package/skills/global-a11y-i18n-expert/SKILL.md +7 -1
  68. package/skills/glsl-shader-expert/SKILL.md +158 -69
  69. package/skills/go-programming-expert/SKILL.md +21 -15
  70. package/skills/graph-rag-knowledge-expert/SKILL.md +200 -0
  71. package/skills/graphql-apollo-expert/SKILL.md +113 -107
  72. package/skills/headless-cms-expert/SKILL.md +181 -0
  73. package/skills/hig/SKILL.md +7 -1
  74. package/skills/js-backend-expert/SKILL.md +218 -216
  75. package/skills/legacy-code-translator/SKILL.md +70 -64
  76. package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
  77. package/skills/logging-error-tracking-expert/SKILL.md +343 -337
  78. package/skills/mcp-server-architect/SKILL.md +308 -194
  79. package/skills/micro-frontend-architect/SKILL.md +111 -105
  80. package/skills/mobile-expo-expert/SKILL.md +8 -2
  81. package/skills/modern-css-native-expert/SKILL.md +189 -0
  82. package/skills/monorepo-architect/SKILL.md +7 -1
  83. package/skills/mpa-orchestrator/SKILL.md +20 -1
  84. package/skills/multi-agent-orchestration/SKILL.md +254 -234
  85. package/skills/multiple-entry-points/SKILL.md +37 -1
  86. package/skills/mvc-expert/SKILL.md +7 -1
  87. package/skills/n8n-automation-expert/SKILL.md +89 -0
  88. package/skills/nextjs-app-router-expert/SKILL.md +148 -0
  89. package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
  90. package/skills/payment-gateway-expert/SKILL.md +85 -1
  91. package/skills/pdf-document-generation-expert/SKILL.md +91 -0
  92. package/skills/performance-web-vitals/SKILL.md +7 -1
  93. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -57
  94. package/skills/prd-architect/SKILL.md +182 -201
  95. package/skills/proactive-background-watcher/SKILL.md +67 -61
  96. package/skills/production-ready-hardener/SKILL.md +459 -456
  97. package/skills/pwa-offline-first-expert/SKILL.md +226 -0
  98. package/skills/pydantic-ai-expert/SKILL.md +161 -0
  99. package/skills/python-programming-expert/SKILL.md +407 -401
  100. package/skills/rate-limit-abuse-prevention/SKILL.md +376 -370
  101. package/skills/realtime-collaboration-expert/SKILL.md +55 -1
  102. package/skills/rich-text-editor-expert/SKILL.md +177 -0
  103. package/skills/rust-programming-expert/SKILL.md +7 -1
  104. package/skills/saas-architect/SKILL.md +154 -0
  105. package/skills/saas-billing/SKILL.md +7 -1
  106. package/skills/saas-multi-tenant/SKILL.md +7 -1
  107. package/skills/scalability-clean-code/SKILL.md +7 -1
  108. package/skills/search-engine-expert/SKILL.md +89 -0
  109. package/skills/secure-fuzz-testing/SKILL.md +7 -1
  110. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -57
  111. package/skills/senior-frontend/SKILL.md +139 -161
  112. package/skills/senior-frontend/scripts/frontend_scaffolder.py +1 -1
  113. package/skills/seo/SKILL.md +41 -17
  114. package/skills/session-memory-manager/SKILL.md +128 -0
  115. package/skills/solidjs-expert/SKILL.md +80 -0
  116. package/skills/spa-orchestrator/SKILL.md +20 -1
  117. package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
  118. package/skills/state-management-expert/SKILL.md +7 -1
  119. package/skills/supabase-security-expert/SKILL.md +7 -1
  120. package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
  121. package/skills/svg-animation-motion-expert/SKILL.md +115 -0
  122. package/skills/synthetic-data-finetuning-expert/SKILL.md +155 -0
  123. package/skills/tailwind-expert/SKILL.md +88 -136
  124. package/skills/tanstack-query-expert/SKILL.md +7 -1
  125. package/skills/tauri-expert/SKILL.md +7 -1
  126. package/skills/typescript-expert/SKILL.md +12 -6
  127. package/skills/ui-ux-pro-max/SKILL.md +25 -3
  128. package/skills/vector-db-rag-expert/SKILL.md +175 -19
  129. package/skills/vercel-ai-sdk-expert/SKILL.md +181 -0
  130. package/skills/visual-qa-vision-agent/SKILL.md +70 -64
  131. package/skills/voice-ai-realtime-agent/SKILL.md +242 -0
  132. package/skills/vue-frontend-expert/SKILL.md +131 -125
  133. package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
  134. package/skills/web-3d-graphics-expert/SKILL.md +262 -80
  135. package/skills/web-game-engine-expert/SKILL.md +281 -48
  136. package/skills/web-scraper/SKILL.md +157 -207
  137. package/skills/website-design-cloner/SKILL.md +179 -173
  138. package/skills/webxr-ar-vr-expert/SKILL.md +108 -63
  139. package/skills/wordpress-headless-expert/SKILL.md +144 -0
  140. package/skills/zero-to-prod-orchestrator/SKILL.md +65 -38
  141. package/skills/zero-trust-secret-vault/SKILL.md +87 -39
  142. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  143. package/.github/workflows/publish.yml +0 -20
  144. package/CONTRIBUTING.md +0 -199
  145. package/SECURITY.md +0 -21
  146. package/banner.png +0 -0
  147. package/skills/ai-cost-token-optimizer/SKILL.md +0 -52
  148. package/skills/asisten_ramah/SKILL.md +0 -41
  149. package/skills/auto-doc-updater/SKILL.md +0 -214
  150. package/skills/autonomous-chaos-monkey/SKILL.md +0 -63
  151. package/skills/autonomous-swarm-director/SKILL.md +0 -69
  152. package/skills/edge-serverless-db-expert/SKILL.md +0 -43
  153. package/skills/hyper-context-synthesizer/SKILL.md +0 -55
  154. package/skills/llm-cost-arbitrage-router/SKILL.md +0 -59
  155. package/skills/mcp-client-orchestrator/SKILL.md +0 -70
  156. package/skills/mobile-push-notification-expert/SKILL.md +0 -51
  157. package/skills/monday-design-aesthetic/SKILL.md +0 -67
  158. package/skills/project-context-mapper/SKILL.md +0 -79
  159. package/skills/saas-mvp-launcher/SKILL.md +0 -241
  160. package/skills/saas-transformer/SKILL.md +0 -489
  161. package/skills/saas-transformer/references/billing_integration_guide.md +0 -401
  162. package/skills/self-evolving-memory-graph/SKILL.md +0 -75
  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/session-context-loader/SKILL.md +0 -77
  173. package/skills/session-handoff-resume/SKILL.md +0 -158
  174. package/skills/skill_baru/SKILL.md +0 -172
  175. package/skills/supabase-migration/SKILL.md +0 -45
  176. package/skills/token-saver/SKILL.md +0 -119
  177. package/skills/ui-components-expert/SKILL.md +0 -280
  178. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  179. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  180. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  181. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  182. package/skills/ui_ux_expert/SKILL.md +0 -125
  183. package/skills/vibe-code-gardener/SKILL.md +0 -181
  184. package/vibes-swarm-demo.gif +0 -0
  185. /package/skills/{saas-transformer → saas-architect}/references/feature_gating_patterns.md +0 -0
  186. /package/skills/{saas-transformer → saas-architect}/references/saas_transformation_checklist.md +0 -0
  187. /package/skills/{saas-transformer → saas-architect}/scripts/saas_transformation_scanner.py +0 -0
@@ -1,260 +1,309 @@
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
260
- - Integrates with frontend orchestrators, Tailwind v4, Base UI, and shadcn/ui.
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
+ ### The 4 Pillars of UI Components Catalog
219
+
220
+ #### 1. Input Controls (Buttons, Inputs, Selects)
221
+ - **Visual States**: Explicitly define `default`, `hover`, `active`, `focus`, `disabled`, and `error`.
222
+ - **Validation**: Display inline validation on blur using `aria-invalid` and `aria-describedby` (React Hook Form + Zod).
223
+ - **Touch Targets**: Minimum 44×44px (WCAG 2.5.8), M3 recommends 48×48px.
224
+ - **M3 Integration**: Use M3 button tiers (Filled, Tonal, Elevated, Outlined, Text) and FABs for primary actions.
225
+
226
+ #### 2. Navigation (Navbars, Tabs, Command Palettes)
227
+ - **Command Palette**: Add `⌘K` command menu via `cmdk`.
228
+ - **Responsive Layout**: Bottom nav (<768px), collapsible rail (tablet), full sidebar (desktop).
229
+ - **Smooth Page Transitions**: In Next.js 15, leverage `<Link viewTransition>` for layout morphing.
230
+ - **Active State**: Clear high-contrast indicator with `role="navigation"` and `aria-current="page"`.
231
+
232
+ #### 3. Information & Feedback (Toasts, Skeletons, Empty States)
233
+ - **Toasts**: Use **Sonner**; cap at max 3 concurrent visible toasts. Auto-dismiss success, keep errors persistent.
234
+ - **Loading UX**: Use layout-matching Skeletons over spinners to eliminate Cumulative Layout Shift (CLS).
235
+ - **Empty States**: Clear illustration, contextual message, and primary CTA.
236
+
237
+ #### 4. Containers & Layout (Cards, Modals, Sheets)
238
+ - **Modals & Dialogs**: Radix UI / Base UI Dialog with automatic focus trapping and background scroll lock.
239
+ - **Sheets / Drawers**: Bottom sheet for mobile secondary actions; side sheet on desktop.
240
+ - **Cards**: Flat border or subtle shadow (`shadow-sm`); avoid heavy drop shadows in light mode.
241
+
242
+ ### WCAG 2.2 Accessibility Checklist
243
+ - [ ] All interactive elements have visible focus indicators (`ring-2`).
244
+ - [ ] Color contrast ≥ 4.5:1 (text), ≥ 3:1 (large text / UI components).
245
+ - [ ] All images have `alt` text; decorative images have `alt=""`.
246
+ - [ ] All form inputs have associated `<label>` elements.
247
+ - [ ] Keyboard navigation works for all interactions (Tab, Enter, Space, Escape, Arrow keys).
248
+ - [ ] `aria-label` or `aria-labelledby` on icon buttons.
249
+ - [ ] Modals trap focus and restore it on close.
250
+ - [ ] No content relies on color alone to convey information.
251
+ - [ ] Touch targets ≥ 24×24px (WCAG 2.2 new requirement).
252
+
253
+ ---
254
+
255
+ <a name="bahasa-indonesia"></a>
256
+ ## Bahasa Indonesia
257
+
258
+ ### Integrasi Orkestrasi
259
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `zero-to-prod-orchestrator`, dan `project-context-mapper` untuk memastikan eksekusi yang kohesif.
260
+
261
+ ### Deskripsi
262
+ 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.
263
+
264
+ ### Kondisi Pemicu
265
+ - Membangun library komponen UI bersama dari awal.
266
+ - Menyiapkan design token (warna, tipografi, spacing) dengan Tailwind v4.
267
+ - Menerapkan prinsip Material Design 3 (M3) (https://m3.material.io/).
268
+ - Menggunakan primitif headless (Radix UI, Base UI 1.x) dengan styling kustom.
269
+ - Mendistribusikan komponen via format **registry shadcn/ui**.
270
+ - Mengaudit library komponen untuk kepatuhan aksesibilitas WCAG 2.2.
271
+
272
+ ### Fondasi Design Token (Tailwind v4 + OKLCH)
273
+ 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`.
274
+
275
+ ### Integrasi Material Design 3 (M3)
276
+ Jika diminta mengikuti **Material Design 3 (https://m3.material.io/)**, terapkan prinsip token M3 berikut:
277
+ 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.
278
+ 2. **Skala Tipografi**: Gunakan penamaan M3: `Display`, `Headline`, `Title`, `Body`, `Label` (dengan ukuran `Large`, `Medium`, `Small`).
279
+ 3. **Elevasi & Permukaan**: Gunakan tingkat Elevasi M3 (0 hingga 5) melalui bayangan halus dan warna tint permukaan (surface tint).
280
+ 4. **Bentuk (Shapes)**: Petakan `--radius-*` ke keluarga bentuk M3: `None`, `Extra Small`, `Small`, `Medium`, `Large`, `Extra Large`, `Full`.
281
+
282
+ ### Arsitektur Komponen
283
+ Gunakan pola Headless + Styled: primitif headless (Base UI/Radix) untuk aksesibilitas, gaya melalui Tailwind + CVA (class-variance-authority) untuk varian type-safe.
284
+
285
+ **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*.
286
+
287
+ ### Registry shadcn/ui — Komponen yang Dapat Didistribusikan (2026)
288
+ 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]`.
289
+
290
+ ### Base UI 1.x — Primitif Aksesibilitas Tanpa Gaya
291
+ Base UI (dari tim MUI) adalah alternatif Radix UI untuk 2026 dengan dukungan native React 19. Sepenuhnya tanpa gaya — terapkan className/Tailwind apapun.
292
+
293
+ ### Katalog 4 Pilar Komponen UI
294
+ 1. **Input Controls (Tombol, Input, Select)**: Definisikan status visual (`default`, `hover`, `active`, `focus`, `disabled`, `error`). Tampilkan validasi inline on-blur (`aria-invalid`, `aria-describedby` via React Hook Form + Zod). Target sentuh minimal 44x44px.
295
+ 2. **Navigasi (Navbar, Tab, Command Palette)**: Sediakan menu perintah `⌘K` dengan `cmdk`. Layout responsif (navigasi bawah di mobile, rail di tablet, sidebar penuh di desktop). Transisi halaman halus via `<Link viewTransition>` di Next.js 15.
296
+ 3. **Informasi & Feedback (Toast, Skeleton, Empty State)**: Gunakan **Sonner** untuk toast (maksimal 3 bersamaan). Gunakan Skeleton sesuai tata letak untuk mencegah CLS dibanding spinner.
297
+ 4. **Wadah & Layout (Card, Modal, Sheet)**: Dialog/Modal dengan penguncian scroll dan focus trapping otomatis (Base UI/Radix). Gunakan bottom sheet di mobile dan side sheet di desktop.
298
+
299
+ ### Checklist Aksesibilitas WCAG 2.2
300
+ - Semua elemen interaktif memiliki indikator fokus yang terlihat.
301
+ - Kontras warna ≥ 4.5:1 (teks), ≥ 3:1 (komponen UI).
302
+ - Semua input form memiliki elemen `<label>` terkait.
303
+ - Navigasi keyboard berfungsi untuk semua interaksi.
304
+ - Modal menjebak fokus dan memulihkannya saat ditutup.
305
+ - Target sentuh ≥ 24×24px (persyaratan baru WCAG 2.2).
306
+
307
+
308
+ ## Orchestration & Integration
309
+ - Integrates with frontend orchestrators, Tailwind v4, Base UI, and shadcn/ui.