askill
db-env-switch

db-env-switchSafety 92Repository

Switch between local and production database environments by updating .env.local, killing running processes, and providing restart instructions. Use when user says "switch to local database", "switch to production database", or "change database environment".

30 stars
1.2k downloads
Updated 1/27/2026

Package Files

Loading files...
SKILL.md

Database Environment Switch

Safely switch between local and production database configurations with process restart.

<when_to_use>

When to Use

Invoke when user says:

  • "switch to local database"
  • "switch to production database"
  • "use local Supabase"
  • "connect to production"
  • "change database environment" </when_to_use>
PhaseActionReference
1Detect current environmentRead .env.local
2Safety check (production requires approval)AskUserQuestion
3Update .env.localComment/uncomment sections
4Kill running processesVite + Worker PIDs
5Verify + provide restart instructionsSummary report

For detailed steps: references/workflow-phases.md

<safety_rules>

Critical Safety Rules

  1. ALWAYS confirm production switch - Use AskUserQuestion before switching TO production
  2. Verify local Supabase is running - Check npx supabase status before switching TO local
  3. Kill ALL processes - Dev server and worker cache env vars; updating .env.local alone is NOT enough </safety_rules>
EnvironmentURLSafe to Experiment
LOCALhttp://127.0.0.1:54321Yes
PRODUCTIONhttps://<production-project-id>.supabase.coNO - Real user data!

<approval_gates>

Approval Gates

GatePhaseQuestion
Production ConfirmSwitching TO production"Switch to PRODUCTION? All queries affect REAL USER DATA."
Local SupabaseSwitching TO local (not running)"Start local Supabase now?"

</approval_gates>

<quick_reference>

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

For detailed commands: references/commands-reference.md For error recovery: references/error-recovery.md For safety reminders: references/safety-reminders.md </quick_reference>

<version_history>

Version History

  • v2.1.0 (2025-01-18): AI optimization updates

    • Add blockquote summary after title
  • v2.0.0 (2025-12-28): Refactored to follow skill-authoring-patterns

    • Added XML tags for structure
    • Created references/ for detailed content
    • Reduced from 916 to ~120 lines
  • v1.0.0 (2025-11-03): Initial release </version_history>

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

78/100Analyzed 2/24/2026

Well-structured skill with clear workflow, safety rules, and approval gates. Excellent use of XML tags for organization and includes trigger phrases for when to use. The skill references external files for detailed content but provides sufficient overview and quick reference commands. Strong safety considerations with production data warnings. Minor deduction for project-specific commands that limit reusability beyond similar Supabase projects.

92
88
65
75
72

Metadata

Licenseunknown
Version2.1.0
Updated1/27/2026
Publisherenbyaugust

Tags

apidatabasegithub-actions