db-env-switch

Switch database configurations between local and production environments.

30|3|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/enbyaugust/zacs-claude-skills --skill db-env-switch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-env-switch
Source: https://github.com/enbyaugust/zacs-claude-skills/tree/main/skills/db-env-switch
Command: npx skills add https://github.com/enbyaugust/zacs-claude-skills --skill db-env-switch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill automates switching between local and production database configurations, reducing manual steps and risk whenever you change environments.

Core Features & Use Cases

  • Environment detection: Reads the current environment from .env.local to determine LOCAL vs PRODUCTION.
  • Safety and approvals: Enforces production-switch confirmation prompts to prevent accidental data exposure.
  • Environment updates: Updates .env.local to flip between LOCAL and PRODUCTION settings.
  • Process management: Terminates active Vite/dev and worker processes to ensure fresh environment loading.
  • Restart guidance: Provides clear instructions to restart services after a switch.
  • Use Case: When moving from local development to staging/production, switch safely with automatic checks and rollback-ready steps.

Quick Start

  • Tell the skill to switch to LOCAL or PRODUCTION.
  • It will verify prerequisites, update configuration, kill processes, and present restart commands.

Frequently Asked Questions about db-env-switch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely switch between local and production database configurations?

To safely switch database configurations, this skill detects the current environment, enforces confirmation prompts for production changes, updates .env.local, and terminates active processes to ensure a clean reload of development services.

Why do I need to kill Vite and worker processes when changing database environments?

Killing Vite and worker processes during an environment switch prevents stale configuration variables from persisting in memory, ensuring that your development services load the updated local or production database settings from .env.local.

How does environment detection work for Supabase database switching?

Environment detection works by reading the current LOCAL or PRODUCTION status directly from your .env.local file, enabling the skill to determine the active database configuration before initiating any switch or safety approvals.

Can I automate environment updates without manual confirmation for production databases?

No, you cannot automate production environment updates without manual confirmation. The skill deliberately enforces safety approval prompts when switching to production to prevent accidental data exposure or unauthorized configuration changes.

What happens to my dotenv file when I toggle my dev environment to production?

When toggling to production, your dotenv file is automatically updated to flip the environment settings from LOCAL to PRODUCTION, after which the skill terminates running processes and provides restart guidance for your services.

What are the limitations of using dotenv for staging and production database switches?

A key limitation is that process management requires manual restarts. While the skill updates .env.local and terminates Vite and worker processes, you must manually execute the provided restart commands to resume development services.