Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat: Add Phase 3 commands and Priority 3 user-invocable skills

Jezacc88445ccd5
diff --git a/skills/better-auth/commands/setup.md b/skills/better-auth/commands/setup.md
new file mode 100644
index 00000000..ac421ec2
--- /dev/null
+++ b/skills/better-auth/commands/setup.md
@@ -0,0 +1,239 @@
+# Setup better-auth
+
+Add self-hosted authentication to a Cloudflare Workers + D1 project using better-auth.
+
+---
+
+## Your Task
+
+Follow these steps to configure better-auth with Drizzle ORM and D1.
+
+### 1. Check Prerequisites
+
+Verify the project has:
+- Cloudflare Workers with D1 binding
+- Drizzle ORM configured (run `/drizzle-orm-d1/init` first if not)
+- TypeScript
+
+### 2. Install Dependencies
+
+```bash
+npm install better-auth
+npm install -D @better-auth/cli
+```
+
+### 3. Create Auth Configuration
+
+Create `src/lib/auth/index.ts`:
+
+```typescript
+import { betterAuth } from 'better-auth';
+import { drizzleAdapter } from 'better-auth/adapters/drizzle';
+import type { DrizzleD1Database } from 'drizzle-orm/d1';
+import * as schema from '@/db/schema';
+
+export function createAuth(db: DrizzleD1Database<typeof schema>, env: Env) {
+ return betterAuth({
+ database: drizzleAdapter(db, {
+ provider: 'sqlite',
+ schema: {
+ user: schema.users,
+ session: schema.sessions,
+ account: schema.accounts,
+ verification: schema.verifications,
+ },
+ }),
+ secret: env.BETTER_AUTH_SECRET,
+ baseURL: env.BETTER_AUTH_URL,
+ emailAndPassword: {
+ enabled: true,
+ },
+ socialProviders: {
+ // Add providers as needed
+ // google: {
+ // clientId: env.GOOGLE_CLIENT_ID,
+ // clientSecret: env.GOOGLE_CLIENT_SECRET,
+ // },
+ },
+ });
+}
+```
+
+### 4. Generate Auth Schema
+
+Create `src/lib/auth/cli.ts` for schema generation:
+
+```typescript
+import { betterAuth } from 'better-auth';
+import { drizzleAdapter } from 'better-auth/adapters/drizzle';
+import { drizzle } from 'drizzle-orm/better-sqlite3';
+import Database from 'better-sqlite3';
+
+const sqlite = new Database(':memory:');
+const db = drizzle(sqlite);
+
+export const auth = betterAuth({
+ database: drizzleAdapter(db, { provider: 'sqlite' }),
+ emailAndPassword: { enabled: true },
+});
+```
+
+Run schema generation:
+```bash
+npx @better-auth/cli generate --config ./src/lib/auth/cli.ts
+```
+
+### 5. Add Auth Tables to Schema
+
+Update `src/db/schema.ts` with generated tables:
+
+```typescript
+import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
+
+// Your existing tables...
+
+// Auth tables (from better-auth generate)
+export const users = sqliteTable('users', {
+ id: text('id').primaryKey(),
+ email: text('email').notNull().unique(),
+ emailVerified: integer('email_verified', { mode: 'boolean' }).default(false),
+ name: text('name'),
+ image: text('image'),
+ createdAt: integer('created_at', { mode: 'timestamp' }).$defaultFn(() => new Date()),
+ updatedAt: integer('updated_at', { mode: 'timestamp' }).$defaultFn(() => new Date()),
+});
+
+export const sessions = sqliteTable('sessions', {
+ id: text('id').primaryKey(),
+ userId: text('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
+ token: text('token').notNull().unique(),
+ expiresAt: integer('expires_at', { mode: 'timestamp' }).notNull(),
+ ipAddress: text('ip_address'),
+ userAgent: text('user_agent'),
+ createdAt: integer('created_at', { mode: 'timestamp' }).$defaultFn(() => new Date()),
+});
+
+export const accounts = sqliteTable('accounts', {
+ id: text('id').primaryKey(),
+ userId: text('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
+ providerId: text('provider_id').notNull(),
+ providerAccountId: text('provider_account_id').notNull(),
+ accessToken: text('access_token'),
+ refreshToken: text('refresh_token'),
+ expiresAt: integer('expires_at', { mode: 'timestamp' }),
+});
+
+export const verifications = sqliteTable('verifications', {
+ id: text('id').primaryKey(),
+ identifier: text('identifier').notNull(),
+ value: text('value').notNull(),
+ expiresAt: integer('expires_at', { mode: 'timestamp' }).notNull(),
+});
+```
+
+### 6. Create Auth Routes
+
+Add to your Hono app (`src/index.ts`):
+
+```typescript
+import { Hono } from 'hono';
+import { cors } from 'hono/cors';
+import { createAuth } from './lib/auth';
+import { createDb } from './db';
+
+const app = new Hono<{ Bindings: Env }>();
+
+// CORS for credentials
+app.use('/api/auth/*', cors({
+ origin: (origin) => origin,
+ credentials: true,
+}));
+
+// Auth routes
+app.all('/api/auth/*', async (c) => {
+ const db = createDb(c.env.DB);
+ const auth = createAuth(db, c.env);
+ return auth.handler(c.req.raw);
+});
+```
+
+### 7. Configure Environment
+
+Add to `wrangler.jsonc`:
+```jsonc
+{
+ "vars": {
+ "BETTER_AUTH_URL": "http://localhost:8787"
+ }
+}
+```
+
+Create `.dev.vars`:
+```bash
+BETTER_AUTH_SECRET=your-secret-at-least-32-characters-here
+```
+
+Set production secret:
+```bash
+echo "your-production-secret" | npx wrangler secret put BETTER_AUTH_SECRET
+```
+
+### 8. Generate and Apply Migrations
+
+```bash
+npm run db:generate
+npm run db:migrate:local
+npm run db:migrate:remote
+```
+
+### 9. Create Auth Client
+
+Create `src/client/lib/auth.ts`:
+
+```typescript
+import { createAuthClient } from 'better-auth/react';
+
+export const authClient = createAuthClient({
+ baseURL: import.meta.env.VITE_API_URL || window.location.origin,
+});
+
+export const { useSession, signIn, signUp, signOut } = authClient;
+```
+
+### 10. Provide Next Steps
+
+```
+✅ better-auth configured with D1!
+
+📁 Added:
+ - src/lib/auth/index.ts (Auth configuration)
+ - Auth tables in schema (users, sessions, accounts, verifications)
+ - /api/auth/* routes (Auth endpoints)
+
+🔐 Client Usage:
+ import { useSession, signIn, signUp, signOut } from '@/lib/auth';
+
+ const { data: session } = useSession();
+ await signIn.email({ email, password });
+ await signUp.email({ email, password, name });
+ await signOut();
+
+⚡ Plugins Available:
+ - 2FA (twoFactor)
+ - Passkeys (passkey)
+ - Organizations (organization)
+ - RBAC (admin)
+
+📚 Skill loaded: better-auth
+ - D1 via Drizzle adapter
+ - Session caching patterns
+ - Rate limiting included
+```
+
+---
+
+## Critical Notes
+
+1. **D1 requires Drizzle**: better-auth has no direct D1 adapter
+2. **ESM only**: better-auth v1.4+ is 100% ESM
+3. **nodejs_compat**: Required in wrangler.jsonc compatibility_flags
diff --git a/skills/claude-agent-sdk/SKILL.md b/skills/claude-agent-sdk/SKILL.md
index 62cf5ed2..3b55ad40 100644
--- a/skills/claude-agent-sdk/SKILL.md
+++ b/skills/claude-agent-sdk/SKILL.md
@@ -4,6 +4,7 @@ description: |
Build autonomous AI agents with Claude Agent SDK. Structured outputs guarantee JSON schema validation, with plugins system and hooks for event-driven workflows. Prevents 12 documented errors.
Use when: building coding agents, SRE systems, security auditors, or troubleshooting CLI not found, structured output validation, session forking errors.
+user-invocable: true
---
# Claude Agent SDK - Structured Outputs & Error Prevention Guide
diff --git a/skills/claude-api/SKILL.md b/skills/claude-api/SKILL.md
index f36a5098..a05d9955 100644
--- a/skills/claude-api/SKILL.md
+++ b/skills/claude-api/SKILL.md
@@ -4,6 +4,7 @@ description: |
Build with Claude Messages API using structured outputs for guaranteed JSON schema validation. Covers prompt caching (90% savings), streaming SSE, tool use, and model deprecations. Prevents 12 documented errors.
Use when: building chatbots/agents, troubleshooting rate_limit_error, prompt caching issues, or streaming SSE parsing errors.
+user-invocable: true
---
# Claude API - Structured Outputs & Error Prevention Guide
diff --git a/skills/clerk-auth/commands/setup.md b/skills/clerk-auth/commands/setup.md
new file mode 100644
index 00000000..08917f27
--- /dev/null
+++ b/skills/clerk-auth/commands/setup.md
@@ -0,0 +1,206 @@
+# Setup Clerk Auth
+
+Add Clerk authentication to an existing React or Next.js project.
+
+---
+
+## Your Task
+
+Follow these steps to configure Clerk authentication.
+
+### 1. Check Prerequisites
+
+Verify the project has:
+- React 18+ or Next.js 14+
+- A Clerk account (clerk.com)
+
+### 2. Install Clerk
+
+**For React + Vite:**
+```bash
+npm install @clerk/clerk-react
+```
+
+**For Next.js:**
+```bash
+npm install @clerk/nextjs
+```
+
+### 3. Get Clerk Keys
+
+From Clerk Dashboard (dashboard.clerk.com):
+1. Select or create application
+2. Go to API Keys
+3. Copy `CLERK_PUBLISHABLE_KEY` and `CLERK_SECRET_KEY`
+
+### 4. Configure Environment Variables
+
+**For React (`.env.local`):**
+```bash
+VITE_CLERK_PUBLISHABLE_KEY=pk_test_...
+```
+
+**For Next.js (`.env.local`):**
+```bash
+NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
+CLERK_SECRET_KEY=sk_test_...
+```
+
+### 5. Add Clerk Provider
+
+**For React (`src/main.tsx`):**
+
+```typescript
+import { ClerkProvider } from '@clerk/clerk-react';
+
+const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;
+
+if (!PUBLISHABLE_KEY) {
+ throw new Error('Missing Clerk Publishable Key');
+}
+
+ReactDOM.createRoot(document.getElementById('root')!).render(
+ <React.StrictMode>
+ <ClerkProvider publishableKey={PUBLISHABLE_KEY}>
+ <App />
+ </ClerkProvider>
+ </React.StrictMode>
+);
+```
+
+**For Next.js (`src/app/layout.tsx`):**
+
+```typescript
+import { ClerkProvider } from '@clerk/nextjs';
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <ClerkProvider>
+ <html lang="en">
+ <body>{children}</body>
+ </html>
+ </ClerkProvider>
+ );
+}
+```
+
+### 6. Add Middleware (Next.js only)
+
+Create `src/middleware.ts` (Next.js 15) or `src/proxy.ts` (Next.js 16):
+
+```typescript
+import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
+
+const isPublicRoute = createRouteMatcher([
+ '/',
+ '/sign-in(.*)',
+ '/sign-up(.*)',
+ '/api/public(.*)',
+]);
+
+export default clerkMiddleware(async (auth, request) => {
+ if (!isPublicRoute(request)) {
+ await auth.protect();
+ }
+});
+
+export const config = {
+ matcher: ['/((?!.*\\..*|_next).*)', '/', '/(api|trpc)(.*)'],
+};
+```
+
+### 7. Create Auth Pages
+
+**For React (using Clerk components):**
+
+```typescript
+// src/pages/sign-in.tsx
+import { SignIn } from '@clerk/clerk-react';
+
+export default function SignInPage() {
+ return <SignIn routing="path" path="/sign-in" />;
+}
+
+// src/pages/sign-up.tsx
+import { SignUp } from '@clerk/clerk-react';
+
+export default function SignUpPage() {
+ return <SignUp routing="path" path="/sign-up" />;
+}
+```
+
+**For Next.js:**
+```bash
+# Creates src/app/sign-in/[[...sign-in]]/page.tsx
+# Creates src/app/sign-up/[[...sign-up]]/page.tsx
+```
+
+### 8. Add User Button
+
+```typescript
+import { UserButton, SignedIn, SignedOut, SignInButton } from '@clerk/clerk-react';
+
+function Header() {
+ return (
+ <header>
+ <SignedIn>
+ <UserButton afterSignOutUrl="/" />
+ </SignedIn>
+ <SignedOut>
+ <SignInButton mode="modal" />
+ </SignedOut>
+ </header>
+ );
+}
+```
+
+### 9. Configure Clerk Dashboard
+
+1. Set Redirect URLs:
+ - Sign-in: `/sign-in`
+ - Sign-up: `/sign-up`
+ - After sign-in: `/dashboard`
+ - After sign-up: `/dashboard`
+
+2. Enable desired auth methods (Email, Google, GitHub, etc.)
+
+### 10. Provide Next Steps
+
+```
+✅ Clerk authentication configured!
+
+📁 Added:
+ - ClerkProvider in app entry
+ - Middleware for protected routes (Next.js)
+ - Environment variables
+
+🔐 Auth Components:
+ <SignIn /> - Full sign-in page
+ <SignUp /> - Full sign-up page
+ <UserButton /> - User avatar + menu
+ <SignInButton /> - Sign-in trigger
+ <SignedIn /> - Render when authenticated
+ <SignedOut /> - Render when not authenticated
+
+🪝 Hooks:
+ useUser() - Get current user
+ useAuth() - Get auth state
+ useClerk() - Full Clerk instance
+
+📚 Skill loaded: clerk-auth
+ - API version 2025-04-10 (v2 tokens)
+ - JWT template configuration
+ - Custom claims support
+```
+
+---
+
+## API Version Note
+
+Clerk deprecated JWT v1 tokens on April 14, 2025. Ensure you're using:
+- `@clerk/[email protected]` or `@clerk/[email protected]`
+- API version `2025-04-10` or later
diff --git a/skills/cloudflare-mcp-server/commands/init.md b/skills/cloudflare-mcp-server/commands/init.md
new file mode 100644
index 00000000..53810c54
--- /dev/null
+++ b/skills/cloudflare-mcp-server/commands/init.md
@@ -0,0 +1,210 @@
+# Init MCP Server
+
+Scaffold a new MCP server on Cloudflare Workers with TypeScript, OAuth support, and Durable Objects.
+
+---
+
+## Your Task
+
+Follow these steps to create a new MCP server project.
+
+### 1. Gather Project Details
+
+Ask the user for:
+- **Project name** (used for directory and worker name)
+- **Authentication type**: OAuth (Claude.ai compatible) or API Key (simpler)
+- **Features needed**: Tools only, or Tools + Resources + Prompts
+
+Defaults if not specified:
+- Name: "my-mcp-server"
+- Auth: OAuth (recommended for Claude.ai)
+- Features: Tools only
+
+### 2. Scaffold Project
+
+```bash
+npm create cloudflare@latest <project-name> -- --type hello-world --ts --git --deploy false
+cd <project-name>
+```
+
+### 3. Install Dependencies
+
+```bash
+npm install @modelcontextprotocol/sdk hono zod
+npm install -D @cloudflare/workers-types wrangler typescript
+```
+
+**If OAuth selected:**
+```bash
+npm install @cloudflare/workers-oauth-provider
+```
+
+### 4. Create Directory Structure
+
+```
+src/
+├── index.ts # Main worker entry
+├── mcp/
+│ ├── server.ts # MCP server setup
+│ └── tools/
+│ └── index.ts # Tool definitions
+├── auth/ # If OAuth
+│ └── oauth.ts
+└── types.ts # TypeScript types
+```
+
+### 5. Create MCP Server
+
+Create `src/mcp/server.ts`:
+
+```typescript
+import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
+import { registerTools } from './tools';
+
+export function createMcpServer() {
+ const server = new McpServer({
+ name: '<project-name>',
+ version: '1.0.0',
+ });
+
+ registerTools(server);
+
+ return server;
+}
+```
+
+### 6. Create Example Tool
+
+Create `src/mcp/tools/index.ts`:
+
+```typescript
+import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
+import { z } from 'zod';
+
+export function registerTools(server: McpServer) {
+ server.registerTool(
+ 'hello',
+ {
+ description: 'Say hello to someone',
+ inputSchema: z.object({
+ name: z.string().describe('Name to greet'),
+ }),
+ },
+ async ({ name }) => ({
+ content: [{ type: 'text', text: `Hello, ${name}!` }],
+ })
+ );
+
+ // Add more tools here
+}
+```
+
+### 7. Create Main Entry
+
+Create `src/index.ts`:
+
+```typescript
+import { Hono } from 'hono';
+import { cors } from 'hono/cors';
+import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
+import { createMcpServer } from './mcp/server';
+
+type Bindings = {
+ // Add your bindings here
+};
+
+const app = new Hono<{ Bindings: Bindings }>();
+
+app.use('/mcp/*', cors());
+
+app.post('/mcp', async (c) => {
+ const server = createMcpServer();
+ const transport = new StreamableHTTPServerTransport({
+ sessionIdGenerator: undefined,
+ enableJsonResponse: true,
+ });
+
+ await server.connect(transport);
+ return transport.handleRequest(c.req.raw);
+});
+
+app.get('/', (c) => c.json({
+ name: '<project-name>',
+ endpoints: { mcp: '/mcp' }
+}));
+
+export default app;
+```
+
+### 8. Configure wrangler.jsonc
+
+```jsonc
+{
+ "name": "<project-name>",
+ "main": "src/index.ts",
+ "compatibility_date": "2025-11-11",
+ "compatibility_flags": ["nodejs_compat"]
+}
+```
+
+**If OAuth selected, add Durable Objects:**
+```jsonc
+{
+ "durable_objects": {
+ "bindings": [
+ { "name": "OAUTH_PROVIDER", "class_name": "OAuthProvider" }
+ ]
+ },
+ "migrations": [
+ { "tag": "v1", "new_sqlite_classes": ["OAuthProvider"] }
+ ]
+}
+```
+
+### 9. Create TypeScript Config
+
+Ensure `tsconfig.json` has:
+```json
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ES2022",
+ "moduleResolution": "bundler",
+ "strict": true,
+ "types": ["@cloudflare/workers-types"]
+ }
+}
+```
+
+### 10. Provide Next Steps
+
+```
+✅ MCP Server "<project-name>" created!
+
+📁 Structure:
+ - src/index.ts (Worker entry)
+ - src/mcp/server.ts (MCP server setup)
+ - src/mcp/tools/index.ts (Tool definitions)
+
+🚀 Next steps:
+ 1. cd <project-name>
+ 2. Add your tools in src/mcp/tools/index.ts
+ 3. npm run dev (Start local dev)
+ 4. npx wrangler deploy (Deploy to Cloudflare)
+
+🔗 Connect to Claude.ai:
+ Settings → MCP Servers → Add → https://<worker>.workers.dev/mcp
+
+📚 Skill loaded: cloudflare-mcp-server
+ - 22 common issues auto-prevented
+ - OAuth ready for Claude.ai integration
+```
+
+---
+
+## Critical Patterns Applied
+
+1. **StreamableHTTPServerTransport**: Required for remote MCP servers
+2. **CORS middleware**: Required for browser-based clients
+3. **nodejs_compat**: Required for MCP SDK
+4. **Durable Objects**: Required for OAuth state management
diff --git a/skills/cloudflare-vectorize/SKILL.md b/skills/cloudflare-vectorize/SKILL.md
index 714d93bc..97776a24 100644
--- a/skills/cloudflare-vectorize/SKILL.md
+++ b/skills/cloudflare-vectorize/SKILL.md
@@ -4,6 +4,7 @@ description: |
Build semantic search with Cloudflare Vectorize V2. Covers async mutations, 5M vectors/index, 31ms latency, returnMetadata enum changes, and V1 deprecation. Prevents 8 errors including dimension mismatches.
Use when: building RAG or semantic search, troubleshooting returnMetadata, V2 timing, metadata index, or dimension errors.
+user-invocable: true
---
# Cloudflare Vectorize
diff --git a/skills/cloudflare-workers-ai/SKILL.md b/skills/cloudflare-workers-ai/SKILL.md
index dc706432..d44185b4 100644
--- a/skills/cloudflare-workers-ai/SKILL.md
+++ b/skills/cloudflare-workers-ai/SKILL.md
@@ -4,6 +4,7 @@ description: |
Run LLMs and AI models on Cloudflare's GPU network with Workers AI. Includes Llama 4, Gemma 3, Mistral 3.1, Flux images, BGE embeddings, streaming, and AI Gateway. Handles 2025 breaking changes.
Use when: implementing LLM inference, images, RAG, or troubleshooting AI_ERROR, rate limits, max_tokens, BGE pooling.
+user-invocable: true
---
# Cloudflare Workers AI
diff --git a/skills/drizzle-orm-d1/commands/init.md b/skills/drizzle-orm-d1/commands/init.md
new file mode 100644
index 00000000..a2af4455
--- /dev/null
+++ b/skills/drizzle-orm-d1/commands/init.md
@@ -0,0 +1,163 @@
+# Init Drizzle + D1
+
+Set up Drizzle ORM with Cloudflare D1 database. Creates schema, migrations directory, and Drizzle config.
+
+---
+
+## Your Task
+
+Follow these steps to add Drizzle ORM to an existing Cloudflare Workers project.
+
+### 1. Check Prerequisites
+
+Verify the project has:
+- `wrangler.jsonc` with a D1 binding configured
+- TypeScript configured (`tsconfig.json`)
+
+If no D1 binding exists, inform user:
+```
+Run: npx wrangler d1 create <database-name>
+Then add the binding to wrangler.jsonc
+```
+
+### 2. Install Dependencies
+
+```bash
+npm install drizzle-orm
+npm install -D drizzle-kit better-sqlite3 @types/better-sqlite3
+```
+
+### 3. Create Directory Structure
+
+```
+src/
+└── db/
+ └── schema.ts
+drizzle.config.ts
+migrations/
+```
+
+### 4. Create Schema File
+
+Create `src/db/schema.ts`:
+
+```typescript
+import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
+
+// Example users table - customize for your needs
+export const users = sqliteTable('users', {
+ id: integer('id').primaryKey({ autoIncrement: true }),
+ email: text('email').notNull().unique(),
+ name: text('name'),
+ createdAt: integer('created_at', { mode: 'timestamp' }).$defaultFn(() => new Date()),
+ updatedAt: integer('updated_at', { mode: 'timestamp' }).$defaultFn(() => new Date()),
+});
+
+// Add more tables as needed
+```
+
+### 5. Create Drizzle Config
+
+Create `drizzle.config.ts`:
+
+```typescript
+import { defineConfig } from 'drizzle-kit';
+
+export default defineConfig({
+ schema: './src/db/schema.ts',
+ out: './migrations',
+ dialect: 'sqlite',
+ driver: 'd1-http',
+ dbCredentials: {
+ accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
+ databaseId: process.env.CLOUDFLARE_DATABASE_ID!,
+ token: process.env.CLOUDFLARE_D1_TOKEN!,
+ },
+});
+```
+
+### 6. Update wrangler.jsonc
+
+Ensure D1 binding and migrations directory are configured:
+
+```jsonc
+{
+ "d1_databases": [{
+ "binding": "DB",
+ "database_name": "<database-name>",
+ "database_id": "<your-database-id>",
+ "migrations_dir": "./migrations"
+ }]
+}
+```
+
+### 7. Create Database Helper
+
+Create `src/db/index.ts`:
+
+```typescript
+import { drizzle } from 'drizzle-orm/d1';
+import * as schema from './schema';
+
+export function createDb(d1: D1Database) {
+ return drizzle(d1, { schema });
+}
+
+export type Database = ReturnType<typeof createDb>;
+export * from './schema';
+```
+
+### 8. Add Scripts to package.json
+
+```json
+{
+ "scripts": {
+ "db:generate": "drizzle-kit generate",
+ "db:migrate:local": "wrangler d1 migrations apply <database-name> --local",
+ "db:migrate:remote": "wrangler d1 migrations apply <database-name> --remote",
+ "db:studio": "drizzle-kit studio"
+ }
+}
+```
+
+### 9. Generate Initial Migration
+
+```bash
+npm run db:generate
+```
+
+### 10. Provide Next Steps
+
+```
+✅ Drizzle ORM configured for D1!
+
+📁 Structure:
+ - src/db/schema.ts (Define your tables)
+ - src/db/index.ts (Database helper)
+ - drizzle.config.ts (Drizzle Kit config)
+ - migrations/ (SQL migrations)
+
+🚀 Next steps:
+ 1. Edit src/db/schema.ts to define your tables
+ 2. npm run db:generate (Generate migrations)
+ 3. npm run db:migrate:local (Apply to local)
+ 4. npm run db:migrate:remote (Apply to production)
+
+💡 Usage in Worker:
+ import { createDb } from './db';
+ const db = createDb(env.DB);
+ const users = await db.select().from(schema.users);
+
+📚 Skill loaded: drizzle-orm-d1
+ - 12 common issues auto-prevented
+ - Use db.batch([]) for transactions (D1 doesn't support BEGIN)
+```
+
+---
+
+## Critical Patterns Applied
+
+1. **Timestamp mode**: Uses `mode: 'timestamp'` with `$defaultFn()` for dates
+2. **Batch API**: D1 doesn't support SQL transactions - use `db.batch([])`
+3. **Migrations directory**: Points to `./migrations` in wrangler.jsonc
+4. **Local-first**: Always test migrations locally before remote
diff --git a/skills/google-gemini-api/SKILL.md b/skills/google-gemini-api/SKILL.md
index cba4119c..31f05f62 100644
--- a/skills/google-gemini-api/SKILL.md
+++ b/skills/google-gemini-api/SKILL.md
@@ -4,6 +4,7 @@ description: |
Integrate Gemini API with @google/genai SDK (NOT deprecated @google/generative-ai). Text generation, multimodal (images/video/audio/PDFs), function calling, thinking mode, streaming. 1M input tokens.
Use when: Gemini integration, multimodal AI, reasoning with thinking mode. Troubleshoot: SDK deprecation, model not found, context window, function calling errors.
+user-invocable: true
---
# Google Gemini API - Complete Guide
diff --git a/skills/google-gemini-embeddings/SKILL.md b/skills/google-gemini-embeddings/SKILL.md
index ab181e3a..9b50f819 100644
--- a/skills/google-gemini-embeddings/SKILL.md
+++ b/skills/google-gemini-embeddings/SKILL.md
@@ -4,6 +4,7 @@ description: |
Build RAG systems and semantic search with Gemini embeddings (gemini-embedding-001). 768-3072 dimension vectors, 8 task types, Cloudflare Vectorize integration.
Use when: vector search, RAG systems, semantic search, document clustering. Troubleshoot: dimension mismatch, wrong task type, rate limits (100 RPM), text truncation (2048 tokens).
+user-invocable: true
---
# Google Gemini Embeddings
diff --git a/skills/nextjs/commands/init.md b/skills/nextjs/commands/init.md
new file mode 100644
index 00000000..c98f2bd9
--- /dev/null
+++ b/skills/nextjs/commands/init.md
@@ -0,0 +1,190 @@
+# Init Next.js Project
+
+Scaffold a new Next.js 16 project with App Router, TypeScript, and Tailwind CSS.
+
+---
+
+## Your Task
+
+Follow these steps to create a new Next.js project.
+
+### 1. Gather Project Details
+
+Ask the user for:
+- **Project name**
+- **Features**: Tailwind CSS, shadcn/ui, authentication
+- **Deployment target**: Vercel, Cloudflare, self-hosted
+
+Defaults:
+- Name: "my-nextjs-app"
+- Features: Tailwind CSS + shadcn/ui
+- Deployment: Vercel
+
+### 2. Create Project
+
+```bash
+npx create-next-app@latest <project-name> \
+ --typescript \
+ --tailwind \
+ --eslint \
+ --app \
+ --src-dir \
+ --import-alias "@/*"
+
+cd <project-name>
+```
+
+### 3. Install Additional Dependencies
+
+```bash
+# shadcn/ui (if selected)
+npx shadcn@latest init
+
+# Recommended utilities
+npm install clsx tailwind-merge
+```
+
+### 4. Create Utility Functions
+
+Create `src/lib/utils.ts`:
+
+```typescript
+import { clsx, type ClassValue } from 'clsx';
+import { twMerge } from 'tailwind-merge';
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs));
+}
+```
+
+### 5. Configure for App Router
+
+Ensure `src/app/layout.tsx` has:
+
+```typescript
+import type { Metadata } from 'next';
+import { Inter } from 'next/font/google';
+import './globals.css';
+
+const inter = Inter({ subsets: ['latin'] });
+
+export const metadata: Metadata = {
+ title: '<Project Name>',
+ description: 'Built with Next.js 16',
+};
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+ <html lang="en">
+ <body className={inter.className}>{children}</body>
+ </html>
+ );
+}
+```
+
+### 6. Create Example Page
+
+Update `src/app/page.tsx`:
+
+```typescript
+export default function Home() {
+ return (
+ <main className="flex min-h-screen flex-col items-center justify-center p-24">
+ <h1 className="text-4xl font-bold">Welcome to <Project Name></h1>
+ <p className="mt-4 text-muted-foreground">
+ Built with Next.js 16 + App Router
+ </p>
+ </main>
+ );
+}
+```
+
+### 7. Configure for Deployment Target
+
+**For Vercel** (default - no changes needed):
+```bash
+# Deploy
+npx vercel
+```
+
+**For Cloudflare Pages:**
+```bash
+npm install @cloudflare/next-on-pages
+```
+
+Add to `next.config.ts`:
+```typescript
+import type { NextConfig } from 'next';
+
+const nextConfig: NextConfig = {
+ // For Cloudflare Pages
+ experimental: {
+ runtime: 'edge',
+ },
+};
+
+export default nextConfig;
+```
+
+### 8. Set Up Environment Variables
+
+Create `.env.local`:
+```bash
+# Add your environment variables here
+NEXT_PUBLIC_APP_URL=http://localhost:3000
+```
+
+Create `.env.example`:
+```bash
+NEXT_PUBLIC_APP_URL=
+```
+
+### 9. Update .gitignore
+
+Ensure these are ignored:
+```
+.env*.local
+.vercel
+.next
+node_modules
+```
+
+### 10. Provide Next Steps
+
+```
+✅ Next.js 16 project "<project-name>" created!
+
+📁 Structure:
+ - src/app/ (App Router pages)
+ - src/components/ (UI components)
+ - src/lib/ (Utilities)
+
+🚀 Next steps:
+ 1. npm run dev (Start development)
+ 2. Add pages in src/app/
+ 3. Add components with: npx shadcn@latest add <component>
+
+📦 Key Features:
+ - App Router with async params (Next.js 16)
+ - React 19.2 with Server Components
+ - Tailwind CSS v4 (if configured)
+ - TypeScript strict mode
+
+📚 Skill loaded: nextjs
+ - Async route params pattern
+ - "use cache" directive support
+ - Server Actions ready
+```
+
+---
+
+## Next.js 16 Key Patterns
+
+1. **Async route params**: `params` and `searchParams` are now Promises
+2. **Cache Components**: Use `"use cache"` directive for caching
+3. **proxy.ts**: New Clerk middleware filename (from middleware.ts)
+4. **React 19.2**: useActionState, use() hook, Server Components
diff --git a/skills/openai-api/SKILL.md b/skills/openai-api/SKILL.md
index f048538f..3fab92b1 100644
--- a/skills/openai-api/SKILL.md
+++ b/skills/openai-api/SKILL.md
@@ -4,6 +4,7 @@ description: |
Build with OpenAI stateless APIs - Chat Completions (GPT-5.2, o3), Realtime voice, Batch API (50% savings), Embeddings, DALL-E 3, Whisper, and TTS.
Use when: implementing GPT-5 chat, streaming, function calling, embeddings for RAG, or troubleshooting rate limits (429), API errors.
+user-invocable: true
---
# OpenAI API - Complete Guide
diff --git a/skills/tailwind-v4-shadcn/commands/setup.md b/skills/tailwind-v4-shadcn/commands/setup.md
new file mode 100644
index 00000000..d317bc56
--- /dev/null
+++ b/skills/tailwind-v4-shadcn/commands/setup.md
@@ -0,0 +1,200 @@
+# Setup Tailwind v4 + shadcn/ui
+
+Add Tailwind CSS v4 and shadcn/ui to an existing React/Vite project.
+
+---
+
+## Your Task
+
+Follow these steps to configure Tailwind v4 and shadcn/ui.
+
+### 1. Check Prerequisites
+
+Verify the project has:
+- Vite + React configured
+- TypeScript (recommended)
+
+If not a Vite project, inform user of requirements.
+
+### 2. Install Tailwind v4
+
+```bash
+npm install tailwindcss @tailwindcss/vite
+```
+
+### 3. Configure Vite
+
+Update `vite.config.ts`:
+
+```typescript
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+import tailwindcss from '@tailwindcss/vite';
+
+export default defineConfig({
+ plugins: [react(), tailwindcss()],
+});
+```
+
+**Important**: Use `@tailwindcss/vite` plugin, NOT PostCSS.
+
+### 4. Create CSS Entry
+
+Create or update `src/index.css`:
+
+```css
+@import "tailwindcss";
+```
+
+### 5. Initialize shadcn/ui
+
+```bash
+npx shadcn@latest init
+```
+
+When prompted:
+- Style: Default
+- Base color: Neutral (or user preference)
+- CSS variables: Yes
+- Tailwind config: Leave empty for v4
+- Components path: `src/components`
+- Utils path: `src/lib/utils`
+
+### 6. Configure components.json
+
+Ensure `components.json` has:
+
+```json
+{
+ "tailwind": {
+ "config": ""
+ }
+}
+```
+
+**Important**: Empty string for `config` is required for Tailwind v4.
+
+### 7. Add Theme Provider
+
+Create `src/components/theme-provider.tsx`:
+
+```typescript
+import { createContext, useContext, useEffect, useState } from 'react';
+
+type Theme = 'dark' | 'light' | 'system';
+
+type ThemeProviderProps = {
+ children: React.ReactNode;
+ defaultTheme?: Theme;
+ storageKey?: string;
+};
+
+type ThemeProviderState = {
+ theme: Theme;
+ setTheme: (theme: Theme) => void;
+};
+
+const ThemeProviderContext = createContext<ThemeProviderState | undefined>(undefined);
+
+export function ThemeProvider({
+ children,
+ defaultTheme = 'system',
+ storageKey = 'ui-theme',
+}: ThemeProviderProps) {
+ const [theme, setTheme] = useState<Theme>(
+ () => (localStorage.getItem(storageKey) as Theme) || defaultTheme
+ );
+
+ useEffect(() => {
+ const root = window.document.documentElement;
+ root.classList.remove('light', 'dark');
+
+ if (theme === 'system') {
+ const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
+ ? 'dark'
+ : 'light';
+ root.classList.add(systemTheme);
+ } else {
+ root.classList.add(theme);
+ }
+ }, [theme]);
+
+ return (
+ <ThemeProviderContext.Provider
+ value={{
+ theme,
+ setTheme: (theme: Theme) => {
+ localStorage.setItem(storageKey, theme);
+ setTheme(theme);
+ },
+ }}
+ >
+ {children}
+ </ThemeProviderContext.Provider>
+ );
+}
+
+export const useTheme = () => {
+ const context = useContext(ThemeProviderContext);
+ if (!context) throw new Error('useTheme must be used within ThemeProvider');
+ return context;
+};
+```
+
+### 8. Wrap App with Theme Provider
+
+Update main entry (e.g., `src/main.tsx`):
+
+```typescript
+import { ThemeProvider } from '@/components/theme-provider';
+
+ReactDOM.createRoot(document.getElementById('root')!).render(
+ <React.StrictMode>
+ <ThemeProvider defaultTheme="system">
+ <App />
+ </ThemeProvider>
+ </React.StrictMode>
+);
+```
+
+### 9. Add First Components
+
+```bash
+npx shadcn@latest add button
+npx shadcn@latest add card
+```
+
+### 10. Provide Next Steps
+
+```
+✅ Tailwind v4 + shadcn/ui configured!
+
+📁 Added:
+ - @tailwindcss/vite plugin
+ - src/components/ui/ (shadcn components)
+ - src/lib/utils.ts (cn utility)
+ - Theme provider (dark/light/system)
+
+🎨 Add components:
+ npx shadcn@latest add <component>
+ npx shadcn@latest add button card input
+
+⚠️ Critical Rules:
+ - Use semantic colors: bg-primary, text-foreground
+ - Never use raw Tailwind colors: bg-blue-500
+
+📚 Skill loaded: tailwind-v4-shadcn
+ - v3→v4 syntax corrections
+ - Semantic color system
+ - Theme provider included
+```
+
+---
+
+## Tailwind v4 Key Differences
+
+| v3 Pattern | v4 Pattern |
+|------------|------------|
+| `tailwind.config.js` | CSS-based config in `@theme` |
+| PostCSS plugin | Vite plugin (`@tailwindcss/vite`) |
+| `@apply` everywhere | Prefer utility classes |
diff --git a/skills/typescript-mcp/commands/init.md b/skills/typescript-mcp/commands/init.md
new file mode 100644
index 00000000..2d5ef24e
--- /dev/null
+++ b/skills/typescript-mcp/commands/init.md
@@ -0,0 +1,219 @@
+# Init TypeScript MCP Server
+
+Scaffold a TypeScript MCP server for Cloudflare Workers with tools, resources, and prompts.
+
+---
+
+## Your Task
+
+Follow these steps to create a new TypeScript MCP server.
+
+### 1. Gather Project Details
+
+Ask the user for:
+- **Project name**
+- **MCP capabilities**: Tools, Resources, Prompts, or all
+- **Transport**: Streamable HTTP (remote) or stdio (local)
+- **Platform**: Cloudflare Workers or Node.js
+
+Defaults:
+- Name: "my-mcp"
+- Capabilities: Tools only
+- Transport: Streamable HTTP
+- Platform: Cloudflare Workers
+
+### 2. Scaffold Project
+
+**For Cloudflare Workers:**
+```bash
+npm create cloudflare@latest <project-name> -- --type hello-world --ts --git --deploy false
+cd <project-name>
+npm install @modelcontextprotocol/sdk hono zod
+npm install -D @cloudflare/workers-types
+```
+
+**For Node.js:**
+```bash
+mkdir <project-name> && cd <project-name>
+npm init -y
+npm install @modelcontextprotocol/sdk zod
+npm install -D typescript @types/node tsx
+```
+
+### 3. Create Server Structure
+
+```
+src/
+├── index.ts # Entry point
+├── server.ts # MCP server configuration
+├── tools/
+│ └── index.ts # Tool definitions
+├── resources/ # If resources enabled
+│ └── index.ts
+└── prompts/ # If prompts enabled
+ └── index.ts
+```
+
+### 4. Create MCP Server
+
+Create `src/server.ts`:
+
+```typescript
+import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
+import { z } from 'zod';
+
+export function createServer() {
+ const server = new McpServer({
+ name: '<project-name>',
+ version: '1.0.0',
+ });
+
+ // Register a sample tool
+ server.registerTool(
+ 'echo',
+ {
+ description: 'Echo back the input text',
+ inputSchema: z.object({
+ text: z.string().describe('Text to echo'),
+ }),
+ },
+ async ({ text }) => ({
+ content: [{ type: 'text', text: `Echo: ${text}` }],
+ })
+ );
+
+ return server;
+}
+```
+
+### 5. Create Entry Point
+
+**For Cloudflare Workers** (`src/index.ts`):
+
+```typescript
+import { Hono } from 'hono';
+import { cors } from 'hono/cors';
+import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
+import { createServer } from './server';
+
+const app = new Hono();
+
+app.use('/mcp/*', cors());
+
+app.post('/mcp', async (c) => {
+ const server = createServer();
+ const transport = new StreamableHTTPServerTransport({
+ sessionIdGenerator: undefined,
+ enableJsonResponse: true,
+ });
+ await server.connect(transport);
+ return transport.handleRequest(c.req.raw);
+});
+
+app.get('/', (c) => c.json({ name: '<project-name>', mcp: '/mcp' }));
+
+export default app;
+```
+
+**For Node.js stdio** (`src/index.ts`):
+
+```typescript
+import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
+import { createServer } from './server';
+
+async function main() {
+ const server = createServer();
+ const transport = new StdioServerTransport();
+ await server.connect(transport);
+ console.error('MCP server running on stdio');
+}
+
+main().catch(console.error);
+```
+
+### 6. Configure TypeScript
+
+Create/update `tsconfig.json`:
+
+```json
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ES2022",
+ "moduleResolution": "bundler",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "outDir": "dist"
+ },
+ "include": ["src"]
+}
+```
+
+### 7. Configure Platform
+
+**For Cloudflare Workers** (`wrangler.jsonc`):
+```jsonc
+{
+ "name": "<project-name>",
+ "main": "src/index.ts",
+ "compatibility_date": "2025-11-11",
+ "compatibility_flags": ["nodejs_compat"]
+}
+```
+
+**For Node.js** (update `package.json`):
+```json
+{
+ "type": "module",
+ "scripts": {
+ "dev": "tsx src/index.ts",
+ "build": "tsc",
+ "start": "node dist/index.js"
+ }
+}
+```
+
+### 8. Add to Claude Desktop (if stdio)
+
+Add to `claude_desktop_config.json`:
+```json
+{
+ "mcpServers": {
+ "<project-name>": {
+ "command": "node",
+ "args": ["path/to/<project-name>/dist/index.js"]
+ }
+ }
+}
+```
+
+### 9. Provide Next Steps
+
+```
+✅ TypeScript MCP Server "<project-name>" created!
+
+📁 Structure:
+ - src/server.ts (MCP server + tools)
+ - src/index.ts (Entry point)
+
+🚀 Next steps:
+ 1. Add tools in src/server.ts
+ 2. npm run dev (Start development)
+ 3. Deploy or connect to Claude
+
+📚 Skill loaded: typescript-mcp
+ - Streamable HTTP for remote servers
+ - stdio transport for local servers
+ - Zod schema validation included
+```
+
+---
+
+## Transport Selection Guide
+
+| Transport | Use Case |
+|-----------|----------|
+| **Streamable HTTP** | Remote servers, Claude.ai, web clients |
+| **stdio** | Local servers, Claude Desktop |
+| **SSE** | Legacy, prefer Streamable HTTP |