ALWAYS confirm production switch - Use AskUserQuestion before switching TO production
Verify local Supabase is running - Check npx supabase status before switching TO local
Kill ALL processes - Dev server and worker cache env vars; updating .env.local alone is NOT enough
## Environments
Environment
URL
Safe to Experiment
LOCAL
http://127.0.0.1:54321
Yes
PRODUCTION
https://<production-project-id>.supabase.co
NO - Real user data!
Approval Gates
Gate
Phase
Question
Production Confirm
Switching TO production
"Switch to PRODUCTION? All queries affect REAL USER DATA."
Local Supabase
Switching TO local (not running)
"Start local Supabase now?"
Quick Reference
# Check current environment
grep "^VITE_SUPABASE_URL" .env.local
# Find processes (Windows)
wmic process where "commandline like '%vite%'" get processid 2>nul
# Kill by PID
taskkill //F //PID [pid]
# Restart services after switch
npm run dev
npm run worker:dev