Complete, production-ready starter project for building full-stack applications on Cloudflare with React, Hono, AI SDK, and all Cloudflare services pre-configured.
/plugin marketplace add secondsky/claude-skills/plugin install cloudflare-full-stack-scaffold@claude-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/ai-sdk-guide.mdreferences/architecture-patterns.mdreferences/customization-guide.mdreferences/enabling-auth.mdreferences/full-stack-patterns.mdreferences/project-overview.mdreferences/quick-start-guide.mdreferences/service-configuration.mdreferences/supporting-libraries-guide.mdscripts/enable-ai-chat.shscripts/enable-auth.shscripts/enable-queues.shscripts/enable-vectorize.shscripts/init-services.shscripts/setup-project.shComplete, production-ready starter project for building full-stack applications on Cloudflare with React, Hono, AI SDK, and all Cloudflare services pre-configured.
Use this skill when you need to:
This skill includes 9 comprehensive reference files. Load them progressively based on your task:
references/quick-start-guide.md - Load when: user wants to create new project, needs setup walkthrough, first-time setupreferences/project-overview.md - Load when: user asks about scaffold structure, what's included, helper scripts, directory organizationreferences/service-configuration.md - Load when: configuring D1/KV/R2/Workers AI, setting up bindings, service integration, wrangler.jsonc questionsreferences/ai-sdk-guide.md - Load when: implementing AI chat, using AI SDK, text generation, streaming responses, tool calling, AI provider setupreferences/full-stack-patterns.md - Load when: building forms, implementing validation, data fetching, React Hook Form questions, TanStack Query usage, full-stack validation patternsreferences/supporting-libraries-guide.md - Load when: deep dive into specific libraries (React Hook Form, Zod, TanStack Query, Hono routing), API reference neededreferences/enabling-auth.md - Load when: setting up Clerk auth, implementing authentication, user management, JWT verification, protected routesreferences/architecture-patterns.md - Load when: frontend-backend connection issues, CORS errors, environment variables confusion, API not responding, auth race conditionsreferences/customization-guide.md - Load when: removing services, adding features, customizing theme, creating routes, switching AI providers, modifying scaffoldStrategy: Start with SKILL.md quick start. Load references only when user needs detailed implementation guidance for specific areas.
Complete production-ready scaffold you can copy and customize immediately.
cp -r scaffold/ my-new-app/ && cd my-new-app/
bun install
./scripts/init-services.sh # Creates D1, KV, R2
npm run d1:local && npm run dev
Result in ~5 minutes:
npm run enable-auth (Clerk)npm run enable-ai-chat (AI SDK UI)npm run enable-queues (async processing)npm run enable-vectorize (vector search & RAG)Frontend: React 19, Vite, Tailwind v4, shadcn/ui, React Router, dark mode Backend: Hono, Cloudflare Workers, CORS middleware, typed routes Services: D1 (SQL), KV (cache), R2 (storage), Workers AI, Queues, Vectorize AI: AI SDK v5 with multi-provider support (OpenAI, Anthropic, Gemini, Workers AI) Auth: Clerk integration (optional, enable script provided) Planning: Complete docs (Architecture, Database, API, Phases, UI, Testing), SCRATCHPAD.md for session handoff Scripts: 6 helper scripts for setup, service initialization, and feature enabling
Full structure, helper scripts, and reference docs: Load references/project-overview.md for complete details.
Three flexible approaches:
c.env.AI.run())workers-ai-provider)Chat UI (optional): Enable with npm run enable-ai-chat for complete useChat hook interface
Details: Load references/ai-sdk-guide.md for streaming, tool calling, RAG patterns, provider switching
Industry-standard pattern for production apps:
Full-stack validation: Define schema once in shared/schemas/, use everywhere with type inference
Details: Load references/full-stack-patterns.md for complete working examples and patterns
Core (init script provided): D1 (SQL), KV (cache), R2 (storage), Workers AI (inference) Optional (enable scripts): Queues (async), Vectorize (RAG)
All services have example routes with CRUD operations, typed helpers, and best practices
Details: Load references/service-configuration.md for binding config and usage patterns
All auth patterns included but COMMENTED - uncomment to enable:
./scripts/enable-auth.sh
# Prompts for Clerk keys, uncomments all patterns
What gets enabled:
docs/ directory - Complete planning structure:
SCRATCHPAD.md - Session handoff protocol:
cp -r scaffold/ my-new-app/ && cd my-new-app/
bun install
./scripts/init-services.sh # Creates D1, KV, R2, updates wrangler.jsonc
npm run d1:local && npm run dev # http://localhost:5173
npm run enable-auth # Clerk authentication
npm run enable-ai-chat # AI SDK UI chat interface
npm run enable-queues # Async message processing
npm run enable-vectorize # Vector search & RAG
npm run build && bunx wrangler deploy
bunx wrangler d1 execute my-app-db --remote --file=schema.sql
bunx wrangler secret put CLERK_SECRET_KEY # Repeat for other secrets
Detailed setup walkthrough: Load references/quick-start-guide.md
Common patterns: remove unused services, add API routes, switch AI providers, customize theme, add pages
Complete step-by-step guides: Load references/customization-guide.md
Frontend-Backend Connection: Vite plugin runs Worker on SAME port → use relative URLs (fetch('/api/data'))
Environment Variables: .env (VITE_ prefix, frontend) vs .dev.vars (no prefix, backend secrets)
CORS: Apply middleware BEFORE routes (app.use('/api/*', corsMiddleware) must come first)
Auth: Check isLoaded before API calls to prevent race conditions
Detailed troubleshooting & examples: Load references/architecture-patterns.md when debugging connection/CORS/auth issues
Frontend: React 19, Vite, Tailwind v4, shadcn/ui (Radix UI), React Router, React Hook Form, Zod, TanStack Query Backend: Hono, Cloudflare Workers, Wrangler AI: AI SDK v5 (OpenAI, Anthropic, Google providers), Workers AI Provider Auth: Clerk (optional, commented)
All packages current as of 2025-11. Full list with versions: See references/supporting-libraries-guide.md
| Scenario | Without Scaffold | With Scaffold | Savings |
|---|---|---|---|
| Initial setup | ~18-22k tokens | ~3-5k tokens | ~80% |
| Service configuration | ~8-10k tokens | 0 tokens (done) | 100% |
| Frontend-backend connection | ~5-7k tokens | 0 tokens (done) | 100% |
| AI SDK setup | ~4-6k tokens | 0 tokens (done) | 100% |
| Auth integration | ~6-8k tokens | ~500 tokens | ~90% |
| Planning docs | ~3-5k tokens | 0 tokens (included) | 100% |
| Total | ~44-58k tokens | ~3-6k tokens | ~90% |
Time Savings: 3-4 hours → 5-10 minutes (~95% faster)
| Issue | How Scaffold Prevents It |
|---|---|
| Service binding errors | All bindings pre-configured and tested |
| CORS errors | Middleware in correct order |
| Auth race conditions | Proper loading state patterns |
| Frontend-backend connection | Vite plugin correctly configured |
| AI SDK setup confusion | Multiple working examples |
| Missing planning docs | Complete docs/ structure included |
| Environment variable mix-ups | Clear .dev.vars.example with comments |
| Missing migrations | migrations/ directory with examples |
| Inconsistent file structure | Standard, tested structure |
| Database type errors | Typed query helpers included |
| Theme configuration | Tailwind v4 theming pre-configured |
| Build errors | Working build config (vite + wrangler) |
Total Errors Prevented: 12+ common setup and integration errors
For these cases: Use minimal templates or official framework starters.
Based on:
Package versions verified: 2025-10-23
Works with:
Setup new project:
cp -r scaffold/ my-app/
cd my-app/
bun install
# Follow quick-start-guide.md
Enable auth:
./scripts/enable-auth.sh
Enable AI chat:
./scripts/enable-ai-chat.sh
Deploy:
npm run build
bunx wrangler deploy
Key Files:
wrangler.jsonc - Service configurationvite.config.ts - Build configuration.dev.vars.example - Environment variables templatedocs/ARCHITECTURE.md - System designSCRATCHPAD.md - Session handoff protocolRemember: This scaffold is a starting point, not a constraint. Customize everything to match your needs. The value is in having a working foundation with all the integration patterns already figured out, saving hours of setup and debugging time.