- Make the plan extremely concise. Sacrifice grammar for the sake of concision.
- At the end of each plan, give me a list of unresolved questions to answer, if any.
- Framework: Next.js 14+ (App Router)
- Auth: Supabase Auth
- Database: Supabase (PostgreSQL)
- UI: shadcn/ui + Radix primitives + Tailwind CSS
- Validation: Zod
app/
(marketing)/ # Public pages
(platform)/ # Authenticated app routes
api/ # API routes (webhooks, etc.)
actions/ # Server Actions - each in folder with index.ts, schema.ts, types.ts
lib/
supabase/
server.ts # Server-side Supabase client
client.ts # Browser-side Supabase client
hooks/ # React hooks
components/
ui/ # shadcn/ui components
providers/ # Context providers
supabase/
migrations/ # Database migrations
Before creating any new UI component:
- Search
components/for existing similar components - Check if an existing component can be made reusable with props
- Look at related features for patterns
Never duplicate UI patterns - extract to shared component instead.
Run npx tsc --noEmit before every commit. Do not commit if it fails.
# Development
npm run dev
# Supabase
npx supabase start # Start local Supabase
npx supabase db push # Push migrations
npx supabase gen types # Generate TypeScript types
npx supabase migration new # Create new migration
# Build
npm run build
npm run lintRequired in .env.local:
NEXT_PUBLIC_SUPABASE_URL- Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Supabase anon keySUPABASE_SERVICE_ROLE_KEY- Service role key (server-only)
- Bug fix: paste raw CI output/logs/errors, say "fix"
- Review: "Grill me on these changes, don't PR until I pass"
- Proof: "Prove this works - compare main vs branch"
- Reset: "Knowing everything you know now, scrap this and do the elegant solution"
- Heavy search/logs: append "use subagents" to keep main context clean