xonecas.io
556
Bn

bees-nest / commit 8a04ff7

chore: update ui formatting and opencode docs

xonecas2026-01-27 8a04ff760d0cb2fe4005ae22d3b44e67f8d76644 parent 22255f9

83 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

.opencode/commands/commit.md+21−0
@@ -0,0 +1,21 @@
1+---
2+description: Format, lint, and commit all changes with a generated message
3+---
4+
5+Run the following steps to clean and commit the code:
6+
7+1. **Verify Code Quality**:
8+ - Check `package.json` to identify the correct format and lint scripts (e.g., `bun run format`, `bun run lint`).
9+ - Run them to ensure the code style is consistent and free of errors.
10+ - If any command fails, stop immediately and report the issues.
11+
12+2. **Stage Changes**:
13+ - Run `git add .` to stage all modified and untracked files.
14+
15+3. **Generate Commit**:
16+ - Analyze the staged changes (using `git diff --cached` if necessary to understand the context).
17+ - Draft a concise, descriptive commit message following the **Conventional Commits** specification (e.g., `feat: add search`, `fix: handle null url`).
18+ - Create the commit using `git commit -m "..."`.
19+
20+4. **Report**:
21+ - Output the result of the commit operation.
.opencode/skills/nextjs-app-router-patterns/SKILL.md+543−0
@@ -0,0 +1,543 @@
1+---
2+name: nextjs-app-router-patterns
3+description: Master Next.js 14+ App Router with Server Components, streaming, parallel routes, and advanced data fetching. Use when building Next.js applications, implementing SSR/SSG, or optimizing React Server Components.
4+---
5+
6+# Next.js App Router Patterns
7+
8+Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.
9+
10+## When to Use This Skill
11+
12+- Building new Next.js applications with App Router
13+- Migrating from Pages Router to App Router
14+- Implementing Server Components and streaming
15+- Setting up parallel and intercepting routes
16+- Optimizing data fetching and caching
17+- Building full-stack features with Server Actions
18+
19+## Core Concepts
20+
21+### 1. Rendering Modes
22+
23+| Mode | Where | When to Use |
24+| --------------------- | ------------ | ----------------------------------------- |
25+| **Server Components** | Server only | Data fetching, heavy computation, secrets |
26+| **Client Components** | Browser | Interactivity, hooks, browser APIs |
27+| **Static** | Build time | Content that rarely changes |
28+| **Dynamic** | Request time | Personalized or real-time data |
29+| **Streaming** | Progressive | Large pages, slow data sources |
30+
31+### 2. File Conventions
32+
33+```
34+app/
35+├── layout.tsx # Shared UI wrapper
36+├── page.tsx # Route UI
37+├── loading.tsx # Loading UI (Suspense)
38+├── error.tsx # Error boundary
39+├── not-found.tsx # 404 UI
40+├── route.ts # API endpoint
41+├── template.tsx # Re-mounted layout
42+├── default.tsx # Parallel route fallback
43+└── opengraph-image.tsx # OG image generation
44+```
45+
46+## Quick Start
47+
48+```typescript
49+// app/layout.tsx
50+import { Inter } from 'next/font/google'
51+import { Providers } from './providers'
52+
53+const inter = Inter({ subsets: ['latin'] })
54+
55+export const metadata = {
56+ title: { default: 'My App', template: '%s | My App' },
57+ description: 'Built with Next.js App Router',
58+}
59+
60+export default function RootLayout({
61+ children,
62+}: {
63+ children: React.ReactNode
64+}) {
65+ return (
66+ <html lang="en" suppressHydrationWarning>
67+ <body className={inter.className}>
68+ <Providers>{children}</Providers>
69+ </body>
70+ </html>
71+ )
72+}
73+
74+// app/page.tsx - Server Component by default
75+async function getProducts() {
76+ const res = await fetch('https://api.example.com/products', {
77+ next: { revalidate: 3600 }, // ISR: revalidate every hour
78+ })
79+ return res.json()
80+}
81+
82+export default async function HomePage() {
83+ const products = await getProducts()
84+
85+ return (
86+ <main>
87+ <h1>Products</h1>
88+ <ProductGrid products={products} />
89+ </main>
90+ )
91+}
92+```
93+
94+## Patterns
95+
96+### Pattern 1: Server Components with Data Fetching
97+
98+```typescript
99+// app/products/page.tsx
100+import { Suspense } from 'react'
101+import { ProductList, ProductListSkeleton } from '@/components/products'
102+import { FilterSidebar } from '@/components/filters'
103+
104+interface SearchParams {
105+ category?: string
106+ sort?: 'price' | 'name' | 'date'
107+ page?: string
108+}
109+
110+export default async function ProductsPage({
111+ searchParams,
112+}: {
113+ searchParams: Promise<SearchParams>
114+}) {
115+ const params = await searchParams
116+
117+ return (
118+ <div className="flex gap-8">
119+ <FilterSidebar />
120+ <Suspense
121+ key={JSON.stringify(params)}
122+ fallback={<ProductListSkeleton />}
123+ >
124+ <ProductList
125+ category={params.category}
126+ sort={params.sort}
127+ page={Number(params.page) || 1}
128+ />
129+ </Suspense>
130+ </div>
131+ )
132+}
133+
134+// components/products/ProductList.tsx - Server Component
135+async function getProducts(filters: ProductFilters) {
136+ const res = await fetch(
137+ `${process.env.API_URL}/products?${new URLSearchParams(filters)}`,
138+ { next: { tags: ['products'] } }
139+ )
140+ if (!res.ok) throw new Error('Failed to fetch products')
141+ return res.json()
142+}
143+
144+export async function ProductList({ category, sort, page }: ProductFilters) {
145+ const { products, totalPages } = await getProducts({ category, sort, page })
146+
147+ return (
148+ <div>
149+ <div className="grid grid-cols-3 gap-4">
150+ {products.map((product) => (
151+ <ProductCard key={product.id} product={product} />
152+ ))}
153+ </div>
154+ <Pagination currentPage={page} totalPages={totalPages} />
155+ </div>
156+ )
157+}
158+```
159+
160+### Pattern 2: Client Components with 'use client'
161+
162+```typescript
163+// components/products/AddToCartButton.tsx
164+'use client'
165+
166+import { useState, useTransition } from 'react'
167+import { addToCart } from '@/app/actions/cart'
168+
169+export function AddToCartButton({ productId }: { productId: string }) {
170+ const [isPending, startTransition] = useTransition()
171+ const [error, setError] = useState<string | null>(null)
172+
173+ const handleClick = () => {
174+ setError(null)
175+ startTransition(async () => {
176+ const result = await addToCart(productId)
177+ if (result.error) {
178+ setError(result.error)
179+ }
180+ })
181+ }
182+
183+ return (
184+ <div>
185+ <button
186+ onClick={handleClick}
187+ disabled={isPending}
188+ className="btn-primary"
189+ >
190+ {isPending ? 'Adding...' : 'Add to Cart'}
191+ </button>
192+ {error && <p className="text-red-500 text-sm">{error}</p>}
193+ </div>
194+ )
195+}
196+```
197+
198+### Pattern 3: Server Actions
199+
200+```typescript
201+// app/actions/cart.ts
202+"use server";
203+
204+import { revalidateTag } from "next/cache";
205+import { cookies } from "next/headers";
206+import { redirect } from "next/navigation";
207+
208+export async function addToCart(productId: string) {
209+ const cookieStore = await cookies();
210+ const sessionId = cookieStore.get("session")?.value;
211+
212+ if (!sessionId) {
213+ redirect("/login");
214+ }
215+
216+ try {
217+ await db.cart.upsert({
218+ where: { sessionId_productId: { sessionId, productId } },
219+ update: { quantity: { increment: 1 } },
220+ create: { sessionId, productId, quantity: 1 },
221+ });
222+
223+ revalidateTag("cart");
224+ return { success: true };
225+ } catch (error) {
226+ return { error: "Failed to add item to cart" };
227+ }
228+}
229+
230+export async function checkout(formData: FormData) {
231+ const address = formData.get("address") as string;
232+ const payment = formData.get("payment") as string;
233+
234+ // Validate
235+ if (!address || !payment) {
236+ return { error: "Missing required fields" };
237+ }
238+
239+ // Process order
240+ const order = await processOrder({ address, payment });
241+
242+ // Redirect to confirmation
243+ redirect(`/orders/${order.id}/confirmation`);
244+}
245+```
246+
247+### Pattern 4: Parallel Routes
248+
249+```typescript
250+// app/dashboard/layout.tsx
251+export default function DashboardLayout({
252+ children,
253+ analytics,
254+ team,
255+}: {
256+ children: React.ReactNode
257+ analytics: React.ReactNode
258+ team: React.ReactNode
259+}) {
260+ return (
261+ <div className="dashboard-grid">
262+ <main>{children}</main>
263+ <aside className="analytics-panel">{analytics}</aside>
264+ <aside className="team-panel">{team}</aside>
265+ </div>
266+ )
267+}
268+
269+// app/dashboard/@analytics/page.tsx
270+export default async function AnalyticsSlot() {
271+ const stats = await getAnalytics()
272+ return <AnalyticsChart data={stats} />
273+}
274+
275+// app/dashboard/@analytics/loading.tsx
276+export default function AnalyticsLoading() {
277+ return <ChartSkeleton />
278+}
279+
280+// app/dashboard/@team/page.tsx
281+export default async function TeamSlot() {
282+ const members = await getTeamMembers()
283+ return <TeamList members={members} />
284+}
285+```
286+
287+### Pattern 5: Intercepting Routes (Modal Pattern)
288+
289+```typescript
290+// File structure for photo modal
291+// app/
292+// ├── @modal/
293+// │ ├── (.)photos/[id]/page.tsx # Intercept
294+// │ └── default.tsx
295+// ├── photos/
296+// │ └── [id]/page.tsx # Full page
297+// └── layout.tsx
298+
299+// app/@modal/(.)photos/[id]/page.tsx
300+import { Modal } from '@/components/Modal'
301+import { PhotoDetail } from '@/components/PhotoDetail'
302+
303+export default async function PhotoModal({
304+ params,
305+}: {
306+ params: Promise<{ id: string }>
307+}) {
308+ const { id } = await params
309+ const photo = await getPhoto(id)
310+
311+ return (
312+ <Modal>
313+ <PhotoDetail photo={photo} />
314+ </Modal>
315+ )
316+}
317+
318+// app/photos/[id]/page.tsx - Full page version
319+export default async function PhotoPage({
320+ params,
321+}: {
322+ params: Promise<{ id: string }>
323+}) {
324+ const { id } = await params
325+ const photo = await getPhoto(id)
326+
327+ return (
328+ <div className="photo-page">
329+ <PhotoDetail photo={photo} />
330+ <RelatedPhotos photoId={id} />
331+ </div>
332+ )
333+}
334+
335+// app/layout.tsx
336+export default function RootLayout({
337+ children,
338+ modal,
339+}: {
340+ children: React.ReactNode
341+ modal: React.ReactNode
342+}) {
343+ return (
344+ <html>
345+ <body>
346+ {children}
347+ {modal}
348+ </body>
349+ </html>
350+ )
351+}
352+```
353+
354+### Pattern 6: Streaming with Suspense
355+
356+```typescript
357+// app/product/[id]/page.tsx
358+import { Suspense } from 'react'
359+
360+export default async function ProductPage({
361+ params,
362+}: {
363+ params: Promise<{ id: string }>
364+}) {
365+ const { id } = await params
366+
367+ // This data loads first (blocking)
368+ const product = await getProduct(id)
369+
370+ return (
371+ <div>
372+ {/* Immediate render */}
373+ <ProductHeader product={product} />
374+
375+ {/* Stream in reviews */}
376+ <Suspense fallback={<ReviewsSkeleton />}>
377+ <Reviews productId={id} />
378+ </Suspense>
379+
380+ {/* Stream in recommendations */}
381+ <Suspense fallback={<RecommendationsSkeleton />}>
382+ <Recommendations productId={id} />
383+ </Suspense>
384+ </div>
385+ )
386+}
387+
388+// These components fetch their own data
389+async function Reviews({ productId }: { productId: string }) {
390+ const reviews = await getReviews(productId) // Slow API
391+ return <ReviewList reviews={reviews} />
392+}
393+
394+async function Recommendations({ productId }: { productId: string }) {
395+ const products = await getRecommendations(productId) // ML-based, slow
396+ return <ProductCarousel products={products} />
397+}
398+```
399+
400+### Pattern 7: Route Handlers (API Routes)
401+
402+```typescript
403+// app/api/products/route.ts
404+import { NextRequest, NextResponse } from "next/server";
405+
406+export async function GET(request: NextRequest) {
407+ const searchParams = request.nextUrl.searchParams;
408+ const category = searchParams.get("category");
409+
410+ const products = await db.product.findMany({
411+ where: category ? { category } : undefined,
412+ take: 20,
413+ });
414+
415+ return NextResponse.json(products);
416+}
417+
418+export async function POST(request: NextRequest) {
419+ const body = await request.json();
420+
421+ const product = await db.product.create({
422+ data: body,
423+ });
424+
425+ return NextResponse.json(product, { status: 201 });
426+}
427+
428+// app/api/products/[id]/route.ts
429+export async function GET(
430+ request: NextRequest,
431+ { params }: { params: Promise<{ id: string }> },
432+) {
433+ const { id } = await params;
434+ const product = await db.product.findUnique({ where: { id } });
435+
436+ if (!product) {
437+ return NextResponse.json({ error: "Product not found" }, { status: 404 });
438+ }
439+
440+ return NextResponse.json(product);
441+}
442+```
443+
444+### Pattern 8: Metadata and SEO
445+
446+```typescript
447+// app/products/[slug]/page.tsx
448+import { Metadata } from 'next'
449+import { notFound } from 'next/navigation'
450+
451+type Props = {
452+ params: Promise<{ slug: string }>
453+}
454+
455+export async function generateMetadata({ params }: Props): Promise<Metadata> {
456+ const { slug } = await params
457+ const product = await getProduct(slug)
458+
459+ if (!product) return {}
460+
461+ return {
462+ title: product.name,
463+ description: product.description,
464+ openGraph: {
465+ title: product.name,
466+ description: product.description,
467+ images: [{ url: product.image, width: 1200, height: 630 }],
468+ },
469+ twitter: {
470+ card: 'summary_large_image',
471+ title: product.name,
472+ description: product.description,
473+ images: [product.image],
474+ },
475+ }
476+}
477+
478+export async function generateStaticParams() {
479+ const products = await db.product.findMany({ select: { slug: true } })
480+ return products.map((p) => ({ slug: p.slug }))
481+}
482+
483+export default async function ProductPage({ params }: Props) {
484+ const { slug } = await params
485+ const product = await getProduct(slug)
486+
487+ if (!product) notFound()
488+
489+ return <ProductDetail product={product} />
490+}
491+```
492+
493+## Caching Strategies
494+
495+### Data Cache
496+
497+```typescript
498+// No cache (always fresh)
499+fetch(url, { cache: "no-store" });
500+
501+// Cache forever (static)
502+fetch(url, { cache: "force-cache" });
503+
504+// ISR - revalidate after 60 seconds
505+fetch(url, { next: { revalidate: 60 } });
506+
507+// Tag-based invalidation
508+fetch(url, { next: { tags: ["products"] } });
509+
510+// Invalidate via Server Action
511+("use server");
512+import { revalidateTag, revalidatePath } from "next/cache";
513+
514+export async function updateProduct(id: string, data: ProductData) {
515+ await db.product.update({ where: { id }, data });
516+ revalidateTag("products");
517+ revalidatePath("/products");
518+}
519+```
520+
521+## Best Practices
522+
523+### Do's
524+
525+- **Start with Server Components** - Add 'use client' only when needed
526+- **Colocate data fetching** - Fetch data where it's used
527+- **Use Suspense boundaries** - Enable streaming for slow data
528+- **Leverage parallel routes** - Independent loading states
529+- **Use Server Actions** - For mutations with progressive enhancement
530+
531+### Don'ts
532+
533+- **Don't pass serializable data** - Server → Client boundary limitations
534+- **Don't use hooks in Server Components** - No useState, useEffect
535+- **Don't fetch in Client Components** - Use Server Components or React Query
536+- **Don't over-nest layouts** - Each layout adds to the component tree
537+- **Don't ignore loading states** - Always provide loading.tsx or Suspense
538+
539+## Resources
540+
541+- [Next.js App Router Documentation](https://nextjs.org/docs/app)
542+- [Server Components RFC](https://github.com/reactjs/rfcs/blob/main/text/0188-server-components.md)
543+- [Vercel Templates](https://vercel.com/templates/next.js)
.opencode/skills/shadcn-ui/SKILL.md+1616−0
@@ -0,0 +1,1616 @@
1+---
2+name: shadcn-ui
3+description: Complete shadcn/ui component library guide including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind CSS, or implementing UI patterns like buttons, dialogs, dropdowns, tables, and complex form layouts.
4+language: typescript,tsx
5+framework: react,nextjs,tailwindcss
6+license: MIT
7+allowed-tools: Read, Write, Bash, Edit, Glob
8+---
9+
10+# shadcn/ui Component Patterns
11+
12+Expert guide for building accessible, customizable UI components with shadcn/ui, Radix UI, and Tailwind CSS.
13+
14+## Table of Contents
15+
16+- [When to Use](#when-to-use)
17+- [Quick Start](#quick-start)
18+- [Installation & Setup](#installation--setup)
19+- [Project Configuration](#project-configuration)
20+- [Core Components](#core-components)
21+ - [Button](#button-component)
22+ - [Input & Form Fields](#input--form-fields)
23+ - [Forms with Validation](#forms-with-validation)
24+ - [Card](#card-component)
25+ - [Dialog (Modal)](#dialog-modal-component)
26+ - [Select (Dropdown)](#select-dropdown-component)
27+ - [Sheet (Slide-over)](#sheet-slide-over-component)
28+ - [Menubar & Navigation](#menubar--navigation)
29+ - [Table](#table-component)
30+ - [Toast Notifications](#toast-notifications)
31+- [Advanced Patterns](#advanced-patterns)
32+- [Customization](#customization)
33+- [Next.js Integration](#nextjs-integration)
34+- [Best Practices](#best-practices)
35+- [Common Component Combinations](#common-component-combinations)
36+
37+## When to Use
38+
39+- Setting up a new project with shadcn/ui
40+- Installing or configuring individual components
41+- Building forms with React Hook Form and Zod validation
42+- Creating accessible UI components (buttons, dialogs, dropdowns, sheets)
43+- Customizing component styling with Tailwind CSS
44+- Implementing design systems with shadcn/ui
45+- Building Next.js applications with TypeScript
46+- Creating complex layouts and data displays
47+
48+## Quick Start
49+
50+For new projects, use the automated setup:
51+
52+```bash
53+# Create Next.js project with shadcn/ui
54+npx create-next-app@latest my-app --typescript --tailwind --eslint --app
55+cd my-app
56+npx shadcn@latest init
57+
58+# Install essential components
59+npx shadcn@latest add button input form card dialog select
60+```
61+
62+For existing projects:
63+
64+```bash
65+# Install dependencies
66+npm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
67+
68+# Initialize shadcn/ui
69+npx shadcn@latest init
70+```
71+
72+## What is shadcn/ui?
73+
74+shadcn/ui is **not** a traditional component library or npm package. Instead:
75+
76+- It's a **collection of reusable components** that you can copy into your project
77+- Components are **yours to customize** - you own the code
78+- Built with **Radix UI** primitives for accessibility
79+- Styled with **Tailwind CSS** utilities
80+- Includes CLI tool for easy component installation
81+
82+## Installation & Setup
83+
84+### Initial Setup
85+
86+```bash
87+# Initialize shadcn/ui in your project
88+npx shadcn@latest init
89+```
90+
91+During setup, you'll configure:
92+- TypeScript or JavaScript
93+- Style (Default, New York, etc.)
94+- Base color theme
95+- CSS variables or Tailwind CSS classes
96+- Component installation path
97+
98+### Installing Individual Components
99+
100+```bash
101+# Install a single component
102+npx shadcn@latest add button
103+
104+# Install multiple components
105+npx shadcn@latest add button input form
106+
107+# Install all components
108+npx shadcn@latest add --all
109+```
110+
111+### Manual Installation
112+
113+If you prefer manual setup:
114+
115+```bash
116+# Install dependencies for a specific component
117+npm install @radix-ui/react-slot
118+
119+# Copy component code from ui.shadcn.com
120+# Place in src/components/ui/
121+```
122+
123+## Project Configuration
124+
125+### Required Dependencies
126+
127+```json
128+{
129+ "dependencies": {
130+ "@radix-ui/react-accordion": "^1.1.2",
131+ "@radix-ui/react-alert-dialog": "^1.0.5",
132+ "@radix-ui/react-dialog": "^1.0.5",
133+ "@radix-ui/react-dropdown-menu": "^2.0.6",
134+ "@radix-ui/react-label": "^2.0.2",
135+ "@radix-ui/react-select": "^2.0.0",
136+ "@radix-ui/react-separator": "^1.0.3",
137+ "@radix-ui/react-slot": "^1.0.2",
138+ "@radix-ui/react-toast": "^1.1.5",
139+ "class-variance-authority": "^0.7.0",
140+ "clsx": "^2.0.0",
141+ "lucide-react": "^0.294.0",
142+ "tailwind-merge": "^2.0.0",
143+ "tailwindcss-animate": "^1.0.7"
144+ }
145+}
146+```
147+
148+### TSConfig Configuration
149+
150+```json
151+{
152+ "compilerOptions": {
153+ "target": "es5",
154+ "lib": ["dom", "dom.iterable", "es6"],
155+ "allowJs": true,
156+ "skipLibCheck": true,
157+ "strict": true,
158+ "forceConsistentCasingInFileNames": true,
159+ "noEmit": true,
160+ "esModuleInterop": true,
161+ "module": "esnext",
162+ "moduleResolution": "node",
163+ "resolveJsonModule": true,
164+ "isolatedModules": true,
165+ "jsx": "preserve",
166+ "incremental": true,
167+ "plugins": [
168+ {
169+ "name": "next"
170+ }
171+ ],
172+ "baseUrl": ".",
173+ "paths": {
174+ "@/components/*": ["./src/components/*"],
175+ "@/lib/*": ["./src/lib/*"]
176+ }
177+ },
178+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
179+ "exclude": ["node_modules"]
180+}
181+```
182+
183+### Tailwind Configuration
184+
185+```js
186+// tailwind.config.js
187+/** @type {import('tailwindcss').Config} */
188+module.exports = {
189+ darkMode: ["class"],
190+ content: [
191+ './pages/**/*.{ts,tsx}',
192+ './components/**/*.{ts,tsx}',
193+ './app/**/*.{ts,tsx}',
194+ './src/**/*.{ts,tsx}',
195+ ],
196+ prefix: "",
197+ theme: {
198+ container: {
199+ center: true,
200+ padding: "2rem",
201+ screens: {
202+ "2xl": "1400px",
203+ },
204+ },
205+ extend: {
206+ colors: {
207+ border: "hsl(var(--border))",
208+ input: "hsl(var(--input))",
209+ ring: "hsl(var(--ring))",
210+ background: "hsl(var(--background))",
211+ foreground: "hsl(var(--foreground))",
212+ primary: {
213+ DEFAULT: "hsl(var(--primary))",
214+ foreground: "hsl(var(--primary-foreground))",
215+ },
216+ secondary: {
217+ DEFAULT: "hsl(var(--secondary))",
218+ foreground: "hsl(var(--secondary-foreground))",
219+ },
220+ destructive: {
221+ DEFAULT: "hsl(var(--destructive))",
222+ foreground: "hsl(var(--destructive-foreground))",
223+ },
224+ muted: {
225+ DEFAULT: "hsl(var(--muted))",
226+ foreground: "hsl(var(--muted-foreground))",
227+ },
228+ accent: {
229+ DEFAULT: "hsl(var(--accent))",
230+ foreground: "hsl(var(--accent-foreground))",
231+ },
232+ popover: {
233+ DEFAULT: "hsl(var(--popover))",
234+ foreground: "hsl(var(--popover-foreground))",
235+ },
236+ card: {
237+ DEFAULT: "hsl(var(--card))",
238+ foreground: "hsl(var(--card-foreground))",
239+ },
240+ },
241+ borderRadius: {
242+ lg: "var(--radius)",
243+ md: "calc(var(--radius) - 2px)",
244+ sm: "calc(var(--radius) - 4px)",
245+ },
246+ keyframes: {
247+ "accordion-down": {
248+ from: { height: "0" },
249+ to: { height: "var(--radix-accordion-content-height)" },
250+ },
251+ "accordion-up": {
252+ from: { height: "var(--radix-accordion-content-height)" },
253+ to: { height: "0" },
254+ },
255+ },
256+ animation: {
257+ "accordion-down": "accordion-down 0.2s ease-out",
258+ "accordion-up": "accordion-up 0.2s ease-out",
259+ },
260+ },
261+ },
262+ plugins: [require("tailwindcss-animate")],
263+}
264+```
265+
266+### CSS Variables (globals.css)
267+
268+```css
269+@tailwind base;
270+@tailwind components;
271+@tailwind utilities;
272+
273+@layer base {
274+ :root {
275+ --background: 0 0% 100%;
276+ --foreground: 222.2 84% 4.9%;
277+ --card: 0 0% 100%;
278+ --card-foreground: 222.2 84% 4.9%;
279+ --popover: 0 0% 100%;
280+ --popover-foreground: 222.2 84% 4.9%;
281+ --primary: 222.2 47.4% 11.2%;
282+ --primary-foreground: 210 40% 98%;
283+ --secondary: 210 40% 96.1%;
284+ --secondary-foreground: 222.2 47.4% 11.2%;
285+ --muted: 210 40% 96.1%;
286+ --muted-foreground: 215.4 16.3% 46.9%;
287+ --accent: 210 40% 96.1%;
288+ --accent-foreground: 222.2 47.4% 11.2%;
289+ --destructive: 0 84.2% 60.2%;
290+ --destructive-foreground: 210 40% 98%;
291+ --border: 214.3 31.8% 91.4%;
292+ --input: 214.3 31.8% 91.4%;
293+ --ring: 222.2 84% 4.9%;
294+ --radius: 0.5rem;
295+ }
296+
297+ .dark {
298+ --background: 222.2 84% 4.9%;
299+ --foreground: 210 40% 98%;
300+ --card: 222.2 84% 4.9%;
301+ --card-foreground: 210 40% 98%;
302+ --popover: 222.2 84% 4.9%;
303+ --popover-foreground: 210 40% 98%;
304+ --primary: 210 40% 98%;
305+ --primary-foreground: 222.2 47.4% 11.2%;
306+ --secondary: 217.2 32.6% 17.5%;
307+ --secondary-foreground: 210 40% 98%;
308+ --muted: 217.2 32.6% 17.5%;
309+ --muted-foreground: 215 20.2% 65.1%;
310+ --accent: 217.2 32.6% 17.5%;
311+ --accent-foreground: 210 40% 98%;
312+ --destructive: 0 62.8% 30.6%;
313+ --destructive-foreground: 210 40% 98%;
314+ --border: 217.2 32.6% 17.5%;
315+ --input: 217.2 32.6% 17.5%;
316+ --ring: 212.7 26.8% 83.9%;
317+ }
318+}
319+
320+@layer base {
321+ * {
322+ @apply border-border;
323+ }
324+ body {
325+ @apply bg-background text-foreground;
326+ }
327+}
328+```
329+
330+## Core Components
331+
332+### Button Component
333+
334+Installation:
335+
336+```bash
337+npx shadcn@latest add button
338+```
339+
340+Basic usage:
341+
342+```tsx
343+import { Button } from "@/components/ui/button";
344+
345+export function ButtonDemo() {
346+ return <Button>Click me</Button>;
347+}
348+```
349+
350+Button variants:
351+
352+```tsx
353+import { Button } from "@/components/ui/button";
354+
355+export function ButtonVariants() {
356+ return (
357+ <div className="flex gap-4">
358+ <Button variant="default">Default</Button>
359+ <Button variant="destructive">Destructive</Button>
360+ <Button variant="outline">Outline</Button>
361+ <Button variant="secondary">Secondary</Button>
362+ <Button variant="ghost">Ghost</Button>
363+ <Button variant="link">Link</Button>
364+ </div>
365+ );
366+}
367+```
368+
369+Button sizes:
370+
371+```tsx
372+<div className="flex gap-4 items-center">
373+ <Button size="default">Default</Button>
374+ <Button size="sm">Small</Button>
375+ <Button size="lg">Large</Button>
376+ <Button size="icon">
377+ <Icon className="h-4 w-4" />
378+ </Button>
379+</div>
380+```
381+
382+With loading state:
383+
384+```tsx
385+import { Button } from "@/components/ui/button";
386+import { Loader2 } from "lucide-react";
387+
388+export function ButtonLoading() {
389+ return (
390+ <Button disabled>
391+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />
392+ Please wait
393+ </Button>
394+ );
395+}
396+```
397+
398+### Input & Form Fields
399+
400+#### Input Component
401+
402+Installation:
403+
404+```bash
405+npx shadcn@latest add input
406+```
407+
408+Basic input:
409+
410+```tsx
411+import { Input } from "@/components/ui/input";
412+
413+export function InputDemo() {
414+ return <Input type="email" placeholder="Email" />;
415+}
416+```
417+
418+Input with label:
419+
420+```tsx
421+import { Input } from "@/components/ui/input";
422+import { Label } from "@/components/ui/label";
423+
424+export function InputWithLabel() {
425+ return (
426+ <div className="grid w-full max-w-sm items-center gap-1.5">
427+ <Label htmlFor="email">Email</Label>
428+ <Input type="email" id="email" placeholder="Email" />
429+ </div>
430+ );
431+}
432+```
433+
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/shadcn-ui/learn.md+145−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/shadcn-ui/official-ui-reference.md+1725−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/shadcn-ui/reference.md+586−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/shadcn-ui/ui-reference.md+1578−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/typescript-advanced-types/SKILL.md+724−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/AGENTS.md+2934−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/SKILL.md+136−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md+55−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/advanced-init-once.md+42−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/advanced-use-latest.md+39−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/async-api-routes.md+38−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/async-defer-await.md+80−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/async-dependencies.md+51−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/async-parallel.md+28−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md+99−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md+59−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/bundle-conditional.md+31−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md+49−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md+35−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/bundle-preload.md+50−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/client-event-listeners.md+74−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/client-localstorage-schema.md+71−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md+48−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/client-swr-dedup.md+56−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-batch-dom-css.md+107−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-cache-function-results.md+80−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-cache-property-access.md+28−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-cache-storage.md+70−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-combine-iterations.md+32−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-early-exit.md+50−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-hoist-regexp.md+45−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-index-maps.md+37−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-length-check-first.md+49−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-min-max-loop.md+82−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-set-map-lookups.md+24−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md+57−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-activity.md+26−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md+47−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-conditional-render.md+40−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-content-visibility.md+38−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md+46−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md+82−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md+30−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-svg-precision.md+28−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md+75−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-defer-reads.md+39−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-dependencies.md+45−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md+40−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-derived-state.md+29−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md+74−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md+58−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md+38−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-memo.md+44−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md+45−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md+35−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-transitions.md+40−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md+73−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-after-nonblocking.md+73−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-auth-actions.md+96−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-cache-lru.md+41−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-cache-react.md+76−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-dedup-props.md+65−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-parallel-fetching.md+83−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/vercel-react-best-practices/rules/server-serialization.md+38−0
Cut short: this commit's diff is over 1000 lines.
.opencode/skills/web-design-guidelines/SKILL.md+39−0
Cut short: this commit's diff is over 1000 lines.
biome.json+1−8
Cut short: this commit's diff is over 1000 lines.
src/components/crawl-interface.tsx+0−1
Cut short: this commit's diff is over 1000 lines.
src/components/ui/alert-dialog.tsx+41−27
Cut short: this commit's diff is over 1000 lines.
src/components/ui/badge.tsx+17−13
Cut short: this commit's diff is over 1000 lines.
src/components/ui/button.tsx+20−15
Cut short: this commit's diff is over 1000 lines.
src/components/ui/card.tsx+20−14
Cut short: this commit's diff is over 1000 lines.
src/components/ui/combobox.tsx+71−47
Cut short: this commit's diff is over 1000 lines.
src/components/ui/dropdown-menu.tsx+49−40
Cut short: this commit's diff is over 1000 lines.
src/components/ui/field.tsx+63−54
Cut short: this commit's diff is over 1000 lines.
src/components/ui/input-group.tsx+32−33
Cut short: this commit's diff is over 1000 lines.
src/components/ui/input.tsx+5−5
Cut short: this commit's diff is over 1000 lines.
src/components/ui/label.tsx+7−7
Cut short: this commit's diff is over 1000 lines.
src/components/ui/select.tsx+53−32
Cut short: this commit's diff is over 1000 lines.
src/components/ui/separator.tsx+7−7
Cut short: this commit's diff is over 1000 lines.
src/components/ui/textarea.tsx+5−5
Cut short: this commit's diff is over 1000 lines.