@0xsown/vibe-code-fe 1.0.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 (189) hide show
  1. package/bin/index.js +181 -0
  2. package/package.json +32 -0
  3. package/skills/claude-md-improver/SKILL.md +179 -0
  4. package/skills/claude-md-improver/references/quality-criteria.md +109 -0
  5. package/skills/claude-md-improver/references/templates.md +253 -0
  6. package/skills/claude-md-improver/references/update-guidelines.md +150 -0
  7. package/skills/find-skills/SKILL.md +133 -0
  8. package/skills/frontend-design/LICENSE.txt +177 -0
  9. package/skills/frontend-design/SKILL.md +42 -0
  10. package/skills/next-best-practices/SKILL.md +153 -0
  11. package/skills/next-best-practices/async-patterns.md +87 -0
  12. package/skills/next-best-practices/bundling.md +180 -0
  13. package/skills/next-best-practices/data-patterns.md +297 -0
  14. package/skills/next-best-practices/debug-tricks.md +105 -0
  15. package/skills/next-best-practices/directives.md +73 -0
  16. package/skills/next-best-practices/error-handling.md +227 -0
  17. package/skills/next-best-practices/file-conventions.md +140 -0
  18. package/skills/next-best-practices/font.md +245 -0
  19. package/skills/next-best-practices/functions.md +108 -0
  20. package/skills/next-best-practices/hydration-error.md +91 -0
  21. package/skills/next-best-practices/image.md +173 -0
  22. package/skills/next-best-practices/metadata.md +301 -0
  23. package/skills/next-best-practices/parallel-routes.md +287 -0
  24. package/skills/next-best-practices/route-handlers.md +146 -0
  25. package/skills/next-best-practices/rsc-boundaries.md +159 -0
  26. package/skills/next-best-practices/runtime-selection.md +39 -0
  27. package/skills/next-best-practices/scripts.md +141 -0
  28. package/skills/next-best-practices/self-hosting.md +371 -0
  29. package/skills/next-best-practices/suspense-boundaries.md +67 -0
  30. package/skills/next-cache-components/SKILL.md +411 -0
  31. package/skills/shadcn-ui/README.md +248 -0
  32. package/skills/shadcn-ui/SKILL.md +326 -0
  33. package/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
  34. package/skills/shadcn-ui/examples/data-table.tsx +313 -0
  35. package/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
  36. package/skills/shadcn-ui/resources/component-catalog.md +481 -0
  37. package/skills/shadcn-ui/resources/customization-guide.md +516 -0
  38. package/skills/shadcn-ui/resources/migration-guide.md +463 -0
  39. package/skills/shadcn-ui/resources/setup-guide.md +412 -0
  40. package/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
  41. package/skills/supabase-postgres-best-practices/AGENTS.md +68 -0
  42. package/skills/supabase-postgres-best-practices/CLAUDE.md +68 -0
  43. package/skills/supabase-postgres-best-practices/README.md +116 -0
  44. package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  45. package/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  46. package/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  47. package/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  48. package/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  49. package/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  50. package/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  51. package/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  52. package/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  53. package/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  54. package/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  55. package/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  56. package/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  57. package/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  58. package/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  59. package/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  60. package/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  61. package/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  62. package/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  63. package/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  64. package/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  65. package/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  66. package/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  67. package/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  68. package/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  69. package/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  70. package/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  71. package/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  72. package/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  73. package/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  74. package/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  75. package/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
  76. package/skills/tailwind-design-system/SKILL.md +874 -0
  77. package/skills/vercel-composition-patterns/AGENTS.md +946 -0
  78. package/skills/vercel-composition-patterns/README.md +60 -0
  79. package/skills/vercel-composition-patterns/SKILL.md +89 -0
  80. package/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
  81. package/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
  82. package/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
  83. package/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
  84. package/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
  85. package/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
  86. package/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
  87. package/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
  88. package/skills/vercel-react-best-practices/AGENTS.md +2934 -0
  89. package/skills/vercel-react-best-practices/README.md +123 -0
  90. package/skills/vercel-react-best-practices/SKILL.md +136 -0
  91. package/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  92. package/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
  93. package/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
  94. package/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
  95. package/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
  96. package/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
  97. package/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
  98. package/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
  99. package/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
  100. package/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
  101. package/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
  102. package/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  103. package/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
  104. package/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
  105. package/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
  106. package/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
  107. package/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
  108. package/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
  109. package/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
  110. package/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
  111. package/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
  112. package/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
  113. package/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
  114. package/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
  115. package/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
  116. package/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
  117. package/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
  118. package/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
  119. package/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
  120. package/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
  121. package/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  122. package/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
  123. package/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
  124. package/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  125. package/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  126. package/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
  127. package/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
  128. package/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  129. package/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
  130. package/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
  131. package/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  132. package/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
  133. package/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
  134. package/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  135. package/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
  136. package/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
  137. package/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  138. package/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  139. package/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
  140. package/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  141. package/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
  142. package/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
  143. package/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
  144. package/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
  145. package/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
  146. package/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
  147. package/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
  148. package/skills/vercel-react-native-skills/AGENTS.md +2897 -0
  149. package/skills/vercel-react-native-skills/README.md +165 -0
  150. package/skills/vercel-react-native-skills/SKILL.md +121 -0
  151. package/skills/vercel-react-native-skills/rules/animation-derived-value.md +53 -0
  152. package/skills/vercel-react-native-skills/rules/animation-gesture-detector-press.md +95 -0
  153. package/skills/vercel-react-native-skills/rules/animation-gpu-properties.md +65 -0
  154. package/skills/vercel-react-native-skills/rules/design-system-compound-components.md +66 -0
  155. package/skills/vercel-react-native-skills/rules/fonts-config-plugin.md +71 -0
  156. package/skills/vercel-react-native-skills/rules/imports-design-system-folder.md +68 -0
  157. package/skills/vercel-react-native-skills/rules/js-hoist-intl.md +61 -0
  158. package/skills/vercel-react-native-skills/rules/list-performance-callbacks.md +44 -0
  159. package/skills/vercel-react-native-skills/rules/list-performance-function-references.md +132 -0
  160. package/skills/vercel-react-native-skills/rules/list-performance-images.md +53 -0
  161. package/skills/vercel-react-native-skills/rules/list-performance-inline-objects.md +97 -0
  162. package/skills/vercel-react-native-skills/rules/list-performance-item-expensive.md +94 -0
  163. package/skills/vercel-react-native-skills/rules/list-performance-item-memo.md +82 -0
  164. package/skills/vercel-react-native-skills/rules/list-performance-item-types.md +104 -0
  165. package/skills/vercel-react-native-skills/rules/list-performance-virtualize.md +67 -0
  166. package/skills/vercel-react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
  167. package/skills/vercel-react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
  168. package/skills/vercel-react-native-skills/rules/navigation-native-navigators.md +188 -0
  169. package/skills/vercel-react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
  170. package/skills/vercel-react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
  171. package/skills/vercel-react-native-skills/rules/react-state-dispatcher.md +91 -0
  172. package/skills/vercel-react-native-skills/rules/react-state-fallback.md +56 -0
  173. package/skills/vercel-react-native-skills/rules/react-state-minimize.md +65 -0
  174. package/skills/vercel-react-native-skills/rules/rendering-no-falsy-and.md +74 -0
  175. package/skills/vercel-react-native-skills/rules/rendering-text-in-text-component.md +36 -0
  176. package/skills/vercel-react-native-skills/rules/scroll-position-no-state.md +82 -0
  177. package/skills/vercel-react-native-skills/rules/state-ground-truth.md +80 -0
  178. package/skills/vercel-react-native-skills/rules/ui-expo-image.md +66 -0
  179. package/skills/vercel-react-native-skills/rules/ui-image-gallery.md +104 -0
  180. package/skills/vercel-react-native-skills/rules/ui-measure-views.md +78 -0
  181. package/skills/vercel-react-native-skills/rules/ui-menus.md +174 -0
  182. package/skills/vercel-react-native-skills/rules/ui-native-modals.md +77 -0
  183. package/skills/vercel-react-native-skills/rules/ui-pressable.md +61 -0
  184. package/skills/vercel-react-native-skills/rules/ui-safe-area-scroll.md +65 -0
  185. package/skills/vercel-react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
  186. package/skills/vercel-react-native-skills/rules/ui-styling.md +87 -0
  187. package/skills/web-design-guidelines/SKILL.md +39 -0
  188. package/templates/AGENTS.md +31 -0
  189. package/templates/CLAUDE.md +31 -0
@@ -0,0 +1,412 @@
1
+ # shadcn/ui Setup Guide
2
+
3
+ This guide walks you through setting up shadcn/ui in both new and existing projects.
4
+
5
+ ## Prerequisites
6
+
7
+ Before you begin, ensure you have:
8
+ - **Node.js 18+** installed
9
+ - **React 18+** in your project
10
+ - **Tailwind CSS 3.0+** configured
11
+ - A package manager: npm, yarn, pnpm, or bun
12
+
13
+ ## Quick Start (New Project)
14
+
15
+ ### Option 1: npx shadcn create (Recommended)
16
+
17
+ The easiest way to start a new project with shadcn/ui is using the `create` command, which allows you to customize everything (framework, library, style, font, etc.).
18
+
19
+ ```bash
20
+ npx shadcn@latest create
21
+ ```
22
+
23
+ This interactive command will guide you through:
24
+ 1. **Project Name**: Directory for your app.
25
+ 2. **Visual Style**: Choose from Vega, Nova, Maia, Lyra, Mira, or Classic.
26
+ 3. **Base Color**: Select your primary theme color.
27
+ 4. **Framework**: Next.js, Vite, Laravel, etc.
28
+ 5. **Component Library**: Choose **Radix UI** or **Base UI**.
29
+ 6. **RTL Support**: Enable Right-to-Left support if needed.
30
+
31
+ ### Option 2: Classic Manual Setup (Next.js)
32
+
33
+ ```bash
34
+ # Create a new Next.js project
35
+ npx create-next-app@latest my-app
36
+ cd my-app
37
+
38
+ # Initialize shadcn/ui
39
+ npx shadcn@latest init
40
+
41
+ # Add your first component
42
+ npx shadcn@latest add button
43
+ ```
44
+
45
+ ### Option 3: Classic Manual Setup (Vite + React)
46
+
47
+ ```bash
48
+ # Create a new Vite project
49
+ npm create vite@latest my-app -- --template react-ts
50
+ cd my-app
51
+ npm install
52
+
53
+ # Install Tailwind CSS
54
+ npm install -D tailwindcss postcss autoprefixer
55
+ npx tailwindcss init -p
56
+
57
+ # Initialize shadcn/ui
58
+ npx shadcn@latest init
59
+
60
+ # Add your first component
61
+ npx shadcn@latest add button
62
+ ```
63
+
64
+ ## Existing Project Setup
65
+
66
+ ### Step 1: Ensure Tailwind CSS is Installed
67
+
68
+ If Tailwind is not installed:
69
+
70
+ ```bash
71
+ npm install -D tailwindcss postcss autoprefixer
72
+ npx tailwindcss init -p
73
+ ```
74
+
75
+ Configure `tailwind.config.js`:
76
+
77
+ ```javascript
78
+ /** @type {import('tailwindcss').Config} */
79
+ export default {
80
+ content: [
81
+ "./index.html",
82
+ "./src/**/*.{js,ts,jsx,tsx}",
83
+ ],
84
+ theme: {
85
+ extend: {},
86
+ },
87
+ plugins: [],
88
+ }
89
+ ```
90
+
91
+ ### Step 2: Initialize shadcn/ui
92
+
93
+ Run the initialization command:
94
+
95
+ ```bash
96
+ npx shadcn@latest init
97
+ ```
98
+
99
+ You'll be asked to configure:
100
+
101
+ 1. **Style**: Choose between `default`, `new-york`, or one of the new styles (Vega, Nova, etc.)
102
+ - `default`: Clean and minimal design
103
+ - `new-york`: More refined with subtle details
104
+
105
+ 2. **Base Color**: Choose your primary color palette
106
+ - slate, gray, zinc, neutral, or stone
107
+
108
+ 3. **CSS Variables**: Recommend `yes` for easier theming
109
+
110
+ 4. **TypeScript**: Recommend `yes` for type safety
111
+
112
+ 5. **Import Alias**: Default is `@/components` (recommended)
113
+
114
+ 6. **React Server Components**: Choose based on your framework
115
+ - `yes` for Next.js 13+ with app directory
116
+ - `no` for Vite, CRA, or Next.js pages directory
117
+
118
+ 7. **RTL Support**: Answer `yes` if you need Right-to-Left layout support (this will use logical properties like `ms-4` instead of `ml-4`).
119
+
120
+ ## Advanced Features
121
+
122
+ ### Visual Styles
123
+ shadcn/ui now offers multiple visual styles beyond the defaults:
124
+ - **Vega**: The classic shadcn/ui look.
125
+ - **Nova**: Reduced padding/margins, compact.
126
+ - **Maia**: Soft, rounded, generous spacing.
127
+ - **Lyra**: Boxy, sharp, mono font friendly.
128
+ - **Mira**: Dense, compact.
129
+
130
+ ### Base UI Support
131
+ You can now choose between **Radix UI** and **Base UI** as the underlying primitive library. They share the same component API/abstraction, so your usage remains consistent.
132
+
133
+
134
+ ### Step 3: Verify Configuration
135
+
136
+ The init command creates/updates several files:
137
+
138
+ **components.json** (root of project):
139
+ ```json
140
+ {
141
+ "$schema": "https://ui.shadcn.com/schema.json",
142
+ "style": "default",
143
+ "rsc": false,
144
+ "tsx": true,
145
+ "tailwind": {
146
+ "config": "tailwind.config.js",
147
+ "css": "src/index.css",
148
+ "baseColor": "slate",
149
+ "cssVariables": true
150
+ },
151
+ "aliases": {
152
+ "components": "@/components",
153
+ "utils": "@/lib"
154
+ }
155
+ }
156
+ ```
157
+
158
+ **src/lib/utils.ts**:
159
+ ```typescript
160
+ import { clsx, type ClassValue } from "clsx"
161
+ import { twMerge } from "tailwind-merge"
162
+
163
+ export function cn(...inputs: ClassValue[]) {
164
+ return twMerge(clsx(inputs))
165
+ }
166
+ ```
167
+
168
+ **Updated tailwind.config.js**:
169
+ ```javascript
170
+ /** @type {import('tailwindcss').Config} */
171
+ module.exports = {
172
+ darkMode: ["class"],
173
+ content: [
174
+ './pages/**/*.{ts,tsx}',
175
+ './components/**/*.{ts,tsx}',
176
+ './app/**/*.{ts,tsx}',
177
+ './src/**/*.{ts,tsx}',
178
+ ],
179
+ theme: {
180
+ container: {
181
+ center: true,
182
+ padding: "2rem",
183
+ screens: {
184
+ "2xl": "1400px",
185
+ },
186
+ },
187
+ extend: {
188
+ colors: {
189
+ border: "hsl(var(--border))",
190
+ input: "hsl(var(--input))",
191
+ ring: "hsl(var(--ring))",
192
+ background: "hsl(var(--background))",
193
+ foreground: "hsl(var(--foreground))",
194
+ primary: {
195
+ DEFAULT: "hsl(var(--primary))",
196
+ foreground: "hsl(var(--primary-foreground))",
197
+ },
198
+ // ... more colors
199
+ },
200
+ borderRadius: {
201
+ lg: "var(--radius)",
202
+ md: "calc(var(--radius) - 2px)",
203
+ sm: "calc(var(--radius) - 4px)",
204
+ },
205
+ keyframes: {
206
+ "accordion-down": {
207
+ from: { height: 0 },
208
+ to: { height: "var(--radix-accordion-content-height)" },
209
+ },
210
+ "accordion-up": {
211
+ from: { height: "var(--radix-accordion-content-height)" },
212
+ to: { height: 0 },
213
+ },
214
+ },
215
+ animation: {
216
+ "accordion-down": "accordion-down 0.2s ease-out",
217
+ "accordion-up": "accordion-up 0.2s ease-out",
218
+ },
219
+ },
220
+ },
221
+ plugins: [require("tailwindcss-animate")],
222
+ }
223
+ ```
224
+
225
+ **Updated globals.css** (or equivalent):
226
+ ```css
227
+ @tailwind base;
228
+ @tailwind components;
229
+ @tailwind utilities;
230
+
231
+ @layer base {
232
+ :root {
233
+ --background: 0 0% 100%;
234
+ --foreground: 222.2 84% 4.9%;
235
+ --card: 0 0% 100%;
236
+ --card-foreground: 222.2 84% 4.9%;
237
+ --popover: 0 0% 100%;
238
+ --popover-foreground: 222.2 84% 4.9%;
239
+ --primary: 221.2 83.2% 53.3%;
240
+ --primary-foreground: 210 40% 98%;
241
+ --secondary: 210 40% 96.1%;
242
+ --secondary-foreground: 222.2 47.4% 11.2%;
243
+ --muted: 210 40% 96.1%;
244
+ --muted-foreground: 215.4 16.3% 46.9%;
245
+ --accent: 210 40% 96.1%;
246
+ --accent-foreground: 222.2 47.4% 11.2%;
247
+ --destructive: 0 84.2% 60.2%;
248
+ --destructive-foreground: 210 40% 98%;
249
+ --border: 214.3 31.8% 91.4%;
250
+ --input: 214.3 31.8% 91.4%;
251
+ --ring: 221.2 83.2% 53.3%;
252
+ --radius: 0.5rem;
253
+ }
254
+
255
+ .dark {
256
+ --background: 222.2 84% 4.9%;
257
+ --foreground: 210 40% 98%;
258
+ /* ... dark mode variables */
259
+ }
260
+ }
261
+
262
+ @layer base {
263
+ * {
264
+ @apply border-border;
265
+ }
266
+ body {
267
+ @apply bg-background text-foreground;
268
+ }
269
+ }
270
+ ```
271
+
272
+ ### Step 4: Configure Path Aliases
273
+
274
+ Ensure your `tsconfig.json` includes path aliases:
275
+
276
+ ```json
277
+ {
278
+ "compilerOptions": {
279
+ "baseUrl": ".",
280
+ "paths": {
281
+ "@/*": ["./src/*"]
282
+ }
283
+ }
284
+ }
285
+ ```
286
+
287
+ For Vite, also update `vite.config.ts`:
288
+
289
+ ```typescript
290
+ import path from "path"
291
+ import { defineConfig } from "vite"
292
+ import react from "@vitejs/plugin-react"
293
+
294
+ export default defineConfig({
295
+ plugins: [react()],
296
+ resolve: {
297
+ alias: {
298
+ "@": path.resolve(__dirname, "./src"),
299
+ },
300
+ },
301
+ })
302
+ ```
303
+
304
+ ### Step 5: Add Components
305
+
306
+ Now you can add components:
307
+
308
+ ```bash
309
+ # Add individual components
310
+ npx shadcn@latest add button
311
+ npx shadcn@latest add card
312
+ npx shadcn@latest add dialog
313
+
314
+ # Add multiple components at once
315
+ npx shadcn@latest add button card dialog input label
316
+ ```
317
+
318
+ Components will be added to `src/components/ui/` by default.
319
+
320
+ ## Framework-Specific Considerations
321
+
322
+ ### Next.js App Router
323
+
324
+ - Set `rsc: true` in `components.json`
325
+ - Add `"use client"` to stateful components
326
+ - Import components work from server components by default
327
+
328
+ ### Next.js Pages Router
329
+
330
+ - Set `rsc: false` in `components.json`
331
+ - All components are client-side by default
332
+
333
+ ### Vite
334
+
335
+ - Ensure path aliases are configured in `vite.config.ts`
336
+ - Import `globals.css` in your main entry point (`main.tsx`)
337
+
338
+ ### Create React App
339
+
340
+ - Use `craco` or `react-app-rewired` for path alias support
341
+ - Or use relative imports instead of aliases
342
+
343
+ ## Verification Steps
344
+
345
+ 1. **Check file structure**:
346
+ ```
347
+ src/
348
+ ├── components/
349
+ │ └── ui/
350
+ ├── lib/
351
+ │ └── utils.ts
352
+ └── index.css (or globals.css)
353
+ ```
354
+
355
+ 2. **Test a simple component**:
356
+ ```tsx
357
+ import { Button } from "@/components/ui/button"
358
+
359
+ export default function App() {
360
+ return <Button>Click me</Button>
361
+ }
362
+ ```
363
+
364
+ 3. **Verify Tailwind is working**:
365
+ - Component should render with proper styling
366
+ - Check browser dev tools for applied classes
367
+
368
+ 4. **Test dark mode** (if using CSS variables):
369
+ ```tsx
370
+ <html className="dark">
371
+ ```
372
+
373
+ ## Troubleshooting
374
+
375
+ ### "Cannot find module '@/components/ui/button'"
376
+
377
+ **Solution**: Check path alias configuration in `tsconfig.json` and framework config.
378
+
379
+ ### Styles not applying
380
+
381
+ **Solution**:
382
+ - Ensure `globals.css` is imported in your app entry point
383
+ - Verify Tailwind config `content` paths include your files
384
+ - Check CSS variables are defined in `globals.css`
385
+
386
+ ### TypeScript errors in components
387
+
388
+ **Solution**:
389
+ - Run `npm install` to ensure all dependencies are installed
390
+ - Check that `@types/react` is installed
391
+ - Restart TypeScript server in your editor
392
+
393
+ ### Components look broken
394
+
395
+ **Solution**:
396
+ - Verify `tailwindcss-animate` is installed: `npm install tailwindcss-animate`
397
+ - Check that CSS variables are properly defined
398
+ - Ensure you're not overriding component styles globally
399
+
400
+ ## Next Steps
401
+
402
+ 1. Browse the [component catalog](./component-catalog.md)
403
+ 2. Read the [customization guide](./customization-guide.md)
404
+ 3. Check out example implementations in `/examples`
405
+ 4. Join the [shadcn/ui Discord](https://discord.com/invite/vNvTqVaWm6)
406
+
407
+ ## Additional Resources
408
+
409
+ - [Official Documentation](https://ui.shadcn.com)
410
+ - [Component Examples](https://ui.shadcn.com/examples)
411
+ - [GitHub Repository](https://github.com/shadcn-ui/ui)
412
+ - [Tailwind CSS Docs](https://tailwindcss.com/docs)
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env bash
2
+ # shadcn/ui Setup Verification Script
3
+ # Validates that a project is correctly configured for shadcn/ui
4
+
5
+ set -e
6
+
7
+ GREEN='\033[0;32m'
8
+ RED='\033[0;31m'
9
+ YELLOW='\033[1;33m'
10
+ NC='\033[0m' # No Color
11
+
12
+ echo "🔍 Verifying shadcn/ui setup..."
13
+ echo ""
14
+
15
+ # Check if components.json exists
16
+ if [ -f "components.json" ]; then
17
+ echo -e "${GREEN}✓${NC} components.json found"
18
+ else
19
+ echo -e "${RED}✗${NC} components.json not found"
20
+ echo -e " ${YELLOW}Run:${NC} npx shadcn@latest init"
21
+ exit 1
22
+ fi
23
+
24
+ # Check if tailwind.config exists
25
+ if [ -f "tailwind.config.js" ] || [ -f "tailwind.config.ts" ]; then
26
+ echo -e "${GREEN}✓${NC} Tailwind config found"
27
+ else
28
+ echo -e "${RED}✗${NC} tailwind.config.js not found"
29
+ echo -e " ${YELLOW}Install Tailwind:${NC} npm install -D tailwindcss postcss autoprefixer"
30
+ exit 1
31
+ fi
32
+
33
+ # Check if tsconfig.json has path aliases
34
+ if [ -f "tsconfig.json" ]; then
35
+ if grep -q '"@/\*"' tsconfig.json; then
36
+ echo -e "${GREEN}✓${NC} Path aliases configured in tsconfig.json"
37
+ else
38
+ echo -e "${YELLOW}⚠${NC} Path aliases not found in tsconfig.json"
39
+ echo " Add to compilerOptions.paths:"
40
+ echo ' "@/*": ["./src/*"]'
41
+ fi
42
+ else
43
+ echo -e "${YELLOW}⚠${NC} tsconfig.json not found (TypeScript not configured)"
44
+ fi
45
+
46
+ # Check if globals.css or equivalent exists
47
+ if [ -f "src/index.css" ] || [ -f "src/globals.css" ] || [ -f "app/globals.css" ]; then
48
+ echo -e "${GREEN}✓${NC} Global CSS file found"
49
+
50
+ # Check for Tailwind directives
51
+ CSS_FILE=$(find . -name "globals.css" -o -name "index.css" | head -n 1)
52
+ if grep -q "@tailwind base" "$CSS_FILE"; then
53
+ echo -e "${GREEN}✓${NC} Tailwind directives present"
54
+ else
55
+ echo -e "${RED}✗${NC} Tailwind directives missing"
56
+ echo " Add to your CSS file:"
57
+ echo " @tailwind base;"
58
+ echo " @tailwind components;"
59
+ echo " @tailwind utilities;"
60
+ fi
61
+
62
+ # Check for CSS variables
63
+ if grep -q "^:root" "$CSS_FILE" || grep -q "@layer base" "$CSS_FILE"; then
64
+ echo -e "${GREEN}✓${NC} CSS variables defined"
65
+ else
66
+ echo -e "${YELLOW}⚠${NC} CSS variables not found"
67
+ echo " shadcn/ui requires CSS variables for theming"
68
+ fi
69
+ else
70
+ echo -e "${RED}✗${NC} Global CSS file not found"
71
+ fi
72
+
73
+ # Check if components/ui directory exists
74
+ if [ -d "src/components/ui" ] || [ -d "components/ui" ]; then
75
+ echo -e "${GREEN}✓${NC} components/ui directory exists"
76
+
77
+ # Count components
78
+ COMPONENT_COUNT=$(find . -path "*/components/ui/*.tsx" -o -path "*/components/ui/*.jsx" | wc -l)
79
+ echo -e " ${COMPONENT_COUNT} components installed"
80
+ else
81
+ echo -e "${YELLOW}⚠${NC} components/ui directory not found"
82
+ echo " Add your first component: npx shadcn@latest add button"
83
+ fi
84
+
85
+ # Check if lib/utils exists
86
+ if [ -f "src/lib/utils.ts" ] || [ -f "lib/utils.ts" ]; then
87
+ echo -e "${GREEN}✓${NC} lib/utils.ts exists"
88
+
89
+ # Check for cn function
90
+ UTILS_FILE=$(find . -name "utils.ts" | grep "lib" | head -n 1)
91
+ if grep -q "export function cn" "$UTILS_FILE"; then
92
+ echo -e "${GREEN}✓${NC} cn() utility function present"
93
+ else
94
+ echo -e "${RED}✗${NC} cn() utility function missing"
95
+ fi
96
+ else
97
+ echo -e "${RED}✗${NC} lib/utils.ts not found"
98
+ fi
99
+
100
+ # Check package.json dependencies
101
+ if [ -f "package.json" ]; then
102
+ echo ""
103
+ echo "📦 Checking dependencies..."
104
+
105
+ # Required dependencies
106
+ REQUIRED_DEPS=("react" "tailwindcss")
107
+ RECOMMENDED_DEPS=("class-variance-authority" "clsx" "tailwind-merge" "tailwindcss-animate")
108
+
109
+ for dep in "${REQUIRED_DEPS[@]}"; do
110
+ if grep -q "\"$dep\"" package.json; then
111
+ echo -e "${GREEN}✓${NC} $dep installed"
112
+ else
113
+ echo -e "${RED}✗${NC} $dep not installed"
114
+ fi
115
+ done
116
+
117
+ echo ""
118
+ echo "Recommended dependencies:"
119
+ for dep in "${RECOMMENDED_DEPS[@]}"; do
120
+ if grep -q "\"$dep\"" package.json; then
121
+ echo -e "${GREEN}✓${NC} $dep installed"
122
+ else
123
+ echo -e "${YELLOW}⚠${NC} $dep not installed (recommended)"
124
+ fi
125
+ done
126
+ fi
127
+
128
+ echo ""
129
+ echo -e "${GREEN}✓${NC} Setup verification complete!"
130
+ echo ""
131
+ echo "Next steps:"
132
+ echo " 1. Add components: npx shadcn@latest add [component]"
133
+ echo " 2. View catalog: npx shadcn@latest add --help"
134
+ echo " 3. Browse docs: https://ui.shadcn.com"
@@ -0,0 +1,68 @@
1
+ # Supabase Postgres Best Practices
2
+
3
+ ## Structure
4
+
5
+ ```
6
+ supabase-postgres-best-practices/
7
+ SKILL.md # Main skill file - read this first
8
+ AGENTS.md # This navigation guide
9
+ CLAUDE.md # Symlink to AGENTS.md
10
+ references/ # Detailed reference files
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ 1. Read `SKILL.md` for the main skill instructions
16
+ 2. Browse `references/` for detailed documentation on specific topics
17
+ 3. Reference files are loaded on-demand - read only what you need
18
+
19
+ Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.
20
+
21
+ ## When to Apply
22
+
23
+ Reference these guidelines when:
24
+ - Writing SQL queries or designing schemas
25
+ - Implementing indexes or query optimization
26
+ - Reviewing database performance issues
27
+ - Configuring connection pooling or scaling
28
+ - Optimizing for Postgres-specific features
29
+ - Working with Row-Level Security (RLS)
30
+
31
+ ## Rule Categories by Priority
32
+
33
+ | Priority | Category | Impact | Prefix |
34
+ |----------|----------|--------|--------|
35
+ | 1 | Query Performance | CRITICAL | `query-` |
36
+ | 2 | Connection Management | CRITICAL | `conn-` |
37
+ | 3 | Security & RLS | CRITICAL | `security-` |
38
+ | 4 | Schema Design | HIGH | `schema-` |
39
+ | 5 | Concurrency & Locking | MEDIUM-HIGH | `lock-` |
40
+ | 6 | Data Access Patterns | MEDIUM | `data-` |
41
+ | 7 | Monitoring & Diagnostics | LOW-MEDIUM | `monitor-` |
42
+ | 8 | Advanced Features | LOW | `advanced-` |
43
+
44
+ ## How to Use
45
+
46
+ Read individual rule files for detailed explanations and SQL examples:
47
+
48
+ ```
49
+ references/query-missing-indexes.md
50
+ references/schema-partial-indexes.md
51
+ references/_sections.md
52
+ ```
53
+
54
+ Each rule file contains:
55
+ - Brief explanation of why it matters
56
+ - Incorrect SQL example with explanation
57
+ - Correct SQL example with explanation
58
+ - Optional EXPLAIN output or metrics
59
+ - Additional context and references
60
+ - Supabase-specific notes (when applicable)
61
+
62
+ ## References
63
+
64
+ - https://www.postgresql.org/docs/current/
65
+ - https://supabase.com/docs
66
+ - https://wiki.postgresql.org/wiki/Performance_Optimization
67
+ - https://supabase.com/docs/guides/database/overview
68
+ - https://supabase.com/docs/guides/auth/row-level-security
@@ -0,0 +1,68 @@
1
+ # Supabase Postgres Best Practices
2
+
3
+ ## Structure
4
+
5
+ ```
6
+ supabase-postgres-best-practices/
7
+ SKILL.md # Main skill file - read this first
8
+ AGENTS.md # This navigation guide
9
+ CLAUDE.md # Symlink to AGENTS.md
10
+ references/ # Detailed reference files
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ 1. Read `SKILL.md` for the main skill instructions
16
+ 2. Browse `references/` for detailed documentation on specific topics
17
+ 3. Reference files are loaded on-demand - read only what you need
18
+
19
+ Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.
20
+
21
+ ## When to Apply
22
+
23
+ Reference these guidelines when:
24
+ - Writing SQL queries or designing schemas
25
+ - Implementing indexes or query optimization
26
+ - Reviewing database performance issues
27
+ - Configuring connection pooling or scaling
28
+ - Optimizing for Postgres-specific features
29
+ - Working with Row-Level Security (RLS)
30
+
31
+ ## Rule Categories by Priority
32
+
33
+ | Priority | Category | Impact | Prefix |
34
+ |----------|----------|--------|--------|
35
+ | 1 | Query Performance | CRITICAL | `query-` |
36
+ | 2 | Connection Management | CRITICAL | `conn-` |
37
+ | 3 | Security & RLS | CRITICAL | `security-` |
38
+ | 4 | Schema Design | HIGH | `schema-` |
39
+ | 5 | Concurrency & Locking | MEDIUM-HIGH | `lock-` |
40
+ | 6 | Data Access Patterns | MEDIUM | `data-` |
41
+ | 7 | Monitoring & Diagnostics | LOW-MEDIUM | `monitor-` |
42
+ | 8 | Advanced Features | LOW | `advanced-` |
43
+
44
+ ## How to Use
45
+
46
+ Read individual rule files for detailed explanations and SQL examples:
47
+
48
+ ```
49
+ references/query-missing-indexes.md
50
+ references/schema-partial-indexes.md
51
+ references/_sections.md
52
+ ```
53
+
54
+ Each rule file contains:
55
+ - Brief explanation of why it matters
56
+ - Incorrect SQL example with explanation
57
+ - Correct SQL example with explanation
58
+ - Optional EXPLAIN output or metrics
59
+ - Additional context and references
60
+ - Supabase-specific notes (when applicable)
61
+
62
+ ## References
63
+
64
+ - https://www.postgresql.org/docs/current/
65
+ - https://supabase.com/docs
66
+ - https://wiki.postgresql.org/wiki/Performance_Optimization
67
+ - https://supabase.com/docs/guides/database/overview
68
+ - https://supabase.com/docs/guides/auth/row-level-security