| name | create-app |
| description | Use this skill whenever creating a new application. IMPORTANT: This should be the FIRST thing you read when starting a new project. IMPORTANT: Read this before planning or brainstorming. |
Create App Implementation Plan
For Claude Code: Follow this plan phase-by-phase. If any step fails, notify the user and ask for next steps.
Phase Summary Template: At the end of each phase, output to the user a detailed summary (2-3 paragraphs) that includes:
- What was accomplished in this phase
- Key files/directories created or modified
- Important values to remember (service_id, schema names, etc.)
- Brief preview of what's coming next
Goal: Scaffold a production-ready fullstack web application with database, optional auth, and polished UI.
Architecture: T3 stack (Next.js + tRPC + Drizzle) with Timescale Cloud database and shadcn/ui components.
Tech Stack: Next.js, tRPC, Drizzle ORM, Timescale Cloud (PostgreSQL), Better Auth, shadcn/ui, Tailwind CSS
Getting Started
Tell the user:
"Let's build a minimal v0/demo version of your app. We'll focus on the core features needed to get something working, then iterate from there.
Here's how we'll build this:
- ๐ฏ Phase 1: Understand the product - I'll ask a few questions about what you're building
- ๐๏ธ Phase 2: Scaffold the app - Create a cloud database and app with Next.js, tRPC, and Drizzle
- ๐ Phase 3: Configure auth (if needed) - Set up user authentication
- ๐๏ธ Phase 4: Design the database - Create tables for your data
- โ๏ธ Phase 5: Build the backend - Create API endpoints with tRPC
- ๐จ Phase 6: Build the frontend - Create pages and components with shadcn/ui
- โ Phase 7: Run, verify, and commit - Make sure everything works and save to git
Optional hardening (after commit):
- ๐งช Phase 8: Add testing - Integration tests with Vitest
- ๐ Phase 9: Strict checks - Stricter TypeScript and linting
Let's go!"
Phase 1: Understand the Product
Key Principles:
- One question at a time - Don't overwhelm with multiple questions
- Multiple choice preferred - Easier to answer than open-ended when possible
- YAGNI ruthlessly - Remove unnecessary features from all designs
- Explore alternatives - Always propose 2-3 approaches before settling
- Incremental validation - Present design in sections, validate each
- Be flexible - Go back and clarify when something doesn't make sense
Determine app type - If not clear from the prompt, ask: "Is this a multi-user app (requires user accounts/login)?"
Gather auth requirements (if multi-user) - Ask the user: "Which authentication methods do you want? Pick one or more:" Email signup, GitHub OAuth, Google OAuth
Confirm app name - Propose a sensible app name based on the user's request. The name should be lowercase, use hyphens instead of spaces (e.g.,
todo-app,fitness-tracker), and appropriate for a directory name. Ask: "I'll name the project<proposed-name>. Does that work, or would you prefer something else?"Understand what product you are building - Try to understand the project from the user prompt then ask questions one at a time to refine the idea. Focus on what the product will do, NOT technical details.
Once you understand what you're building, present the product brief to the user for confirmation:
- App type: Single-user or multi-user
- Authentication (if multi-user): Which methods (email, GitHub, Google)
- Product description: A one to three paragraph description of what the project will do
- Minimal features for v0/demo: A short bulleted list - just enough to get a working application
Example product brief:
**App type:** Multi-user
**Authentication:** Email signup
**Product description:**
A collaborative to-do app where users can create personal to-do lists and share them with other users. Users sign up with email, create tasks, and can invite collaborators to view or edit their lists together.
**Minimal features for v0/demo:**
- Email signup/login
- Create, edit, delete, and complete to-dos
- Share a to-do list with another user by email
- Collaborators can view and edit shared lists
Ask the user: "Is this product brief correct?"
After the user confirms the product brief, ask: "Are there any features not in the v0/demo that might affect how we build this? For example: offline support, real-time sync, multi-tenancy, or specific integrations. These won't be built now, but knowing them helps us make the right architectural choices upfront."
If yes, create and confirm a list of "future features".
Phase 2: Project Setup
- Use the
create_databaseMCP tool to provision a new Timescale Cloud database - Store the returned
service_id- you'll need it later - Use the
create_web_appMCP tool with:app_nameconfirmed in Phase 1use_auth: trueif multi-user appproduct_brieffrom Phase 1future_featuresfrom Phase 1 (if any)
- Change into the app directory:
cd <app_name> - Output a phase summary to the user using the template.
Phase 3: Auth Configuration (If Multi-User)
Skip this phase if the app is single-user.
- Pass the drizzle schemas into
drizzleAdapterinsrc/server/better-auth/config.ts:import * as schema from "~/server/db/schema"; drizzleAdapter(db, { provider: "pg", schema, }) - Update the Better Auth configuration to enable only the providers the user requested (email, GitHub, Google)
- Update
src/env.js,.env, and.env.examplewith the required environment variables for the auth providers - Output a phase summary to the user using the template.
Phase 4: Database Schema
Check that the database status is
READYusing theservice_getMCP tool with theservice_idfrom Phase 2. If not ready, poll every 10 seconds for up to 2 minutes.Use the
setup_app_schemaMCP tool with:application_directory: "."service_idfrom Phase 2app_name(use the same name, converted to lowercase with underscores)
This creates a PostgreSQL schema and user, and writes
DATABASE_URLandDATABASE_SCHEMAto.envIn
src/env.jsadd DATABASE_SCHEMA variable (use theschema_namereturned bysetup_app_schemaas default) to both the server and runtimeEnv sectionsModify
drizzle.config.tsto remove the tablesFilter and add a schemasFilter with the value of the DATABASE_SCHEMA env variableIn
src/server/db/schema.ts, remove pgTableCreator pattern and instead create all tables (including auth tables, if present) using:export const dbSchema = pgSchema(env.DATABASE_SCHEMA); const createTable = dbSchema.table;Note: make sure the schema is exported
Delete the example
posttable definition - it was only there as a templateBased on the user's app requirements, add the necessary Drizzle table definitions to
src/server/db/schema.tsPush schema to database:
npm run db:pushOutput a phase summary to the user using the template.
Phase 5: Backend Implementation
- Remove any example/post router that references the old post model
- Create tRPC routers for CRUD operations on the app's data models in
src/server/api/routers/ - Register new routers in
src/server/api/root.ts - Verify with
npx tsc --noEmit -p tsconfig.server.json(checks only server code, avoids frontend errors) - Output a phase summary to the user using the template.
Phase 6: Frontend Implementation
Install and configure shadcn:
npx shadcn@latest init --base-color=neutral cp src/styles/globals.css.orange src/styles/globals.cssInstall required shadcn components (button, card, input, form, table, etc.):
npx shadcn@latest add <component1> <component2> ...Build the pages needed for the app using shadcn components (ensure all buttons have a type attribute)
Connect pages to the backend using tRPC hooks to fetch and mutate data
Create a sign-in form component at
src/components/auth/sign-in-form.tsx(if multi-user) supporting all requested auth methods (email, GitHub, Google)Replace hardcoded T3 template colors with shadcn CSS variables:
bg-gradient-to-b from-slate-900 to-slate-800โbg-backgroundtext-whiteโtext-foregroundbg-white/10โbg-mutedborder-white/20โborder-border
Verify with
npm run buildand fix any errorsOutput a phase summary to the user using the template.
Phase 7: Run, Verify, and Commit
Run
npm run check:writeto auto-fix formatting issues, then verifynpm run checkpassesStart the dev server:
npm run devUse the
open_appMCP tool to open http://localhost:3000 in a browser and verify the app works as expectedUse the
write_claude_mdMCP tool to generate the project guide:application_directory: "."app_name: from Phase 1use_auth: Whether auth is enabledproduct_brief: from Phase 1future_features: from Phase 1 (if any)db_schema: fromsetup_app_schemain Phase 4db_user: fromsetup_app_schemain Phase 4
Read the generated
CLAUDE.mdfile. Make sure it is accurate. Fix if needed.Ask the user "Do you want to commit this initial version to git?". If yes:
git init git add . git commit -m "Initial commit: <app_name>"Tell the user:
"๐ Congrats! Your app is set up and committed. You have a working demo you can iterate on.
Next steps:
- ๐ก๏ธ Harden - Add testing and stricter checks (recommended)
- ๐ง Brainstorm - Plan your next features
- ๐ Deploy - Ship to Vercel
Why harden? These checks act like a reward signal for AI-assisted development - they catch mistakes early and help guide me toward correct solutions faster. Without them, bugs can compound silently.
Shall we add hardening now?"
If the user wants to skip hardening, the skill is complete.
Phase 8: Backend Testing (Optional Hardening)
Ask the user (yes/no): "Do you want to add backend testing?"
If no, skip this phase.
- Use the
view_skillMCP tool to read theadd-backend-testingskill - Follow the skill with
service_idfrom Phase 2 - Offer to git commit these changes
Phase 9: Stricter Checks (Optional Hardening)
Ask the user (yes/no): "Do you want to enable stricter TypeScript checks?"
If no, skip this phase.
- Use the
view_skillMCP tool to read theadd-strict-checksskill - Follow the skill
- Offer to git commit these changes