Agent skill

Supabase Multi Env Setup

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Configure Supabase across development, staging, and production with separate projects, environment-specific secrets, and safe migration promotion.

MITAuto-check: notesDevOps & Cloud

Install Supabase Multi Env Setup

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-multi-env-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-multi-env-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/supabase-multi-env-setup .claude/skills/supabase-multi-env-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
supabase-multi-env-setup
GitHub stars
2.8k
Token cost
~2.2k tokens
SKILL.md length
756 words
Files
5 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Configure Supabase across development, staging, and production with separate projects, environment-specific secrets, and safe migration promotion.

  • Works in 3 steps: Environment Files and Project Layout → Environment-Aware Client and Safeguards → Migration Promotion and Database Branching
  • Setting up multi-environment deployments
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Calls npx, supabase and npm; needs SUPABASE_DB_PASSWORD

What it does

Supabase Multi Env Setup is an agent skill from jeremylongshore/tons-of-skills-marketplace. Configure Supabase across development, staging, and production with separate projects, environment-specific secrets, and safe migration promotion. Use when setting up multi-environment deployments, isolating dev from prod data, configuring per-environment Supabase projects, or promoting migrations through environments. Trigger with "supabase environments", "supabase staging", "supabase dev prod", "supabase multi-project", "supabase env config", "database branching".

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/configuration-structure.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code

It sits in DevOps & Cloud, covering Deployment. It works with Supabase. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Setting up multi-environment deployments
  • Isolating dev from prod data
  • Configuring per-environment Supabase projects
  • Promoting migrations through environments

Example prompts

  • “supabase environments”
  • “supabase staging”
  • “supabase dev prod”
  • “/supabase-multi-env-setup”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npx supabase:*), Bash(supabase:*), Bash(vercel:*)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Environment Files and Project Layout
  2. Environment-Aware Client and Safeguards
  3. Migration Promotion and Database Branching

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npx supabase:*)
    • Bash(supabase:*)
    • Bash(vercel:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • supabase
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • supabase.com
    • 12factor.net

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • SUPABASE_DB_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Supabase Multi Env Setup loads about 2.2k tokens when it runs, and up to ~5.8k if it reads all its reference files. Until then it costs about 124 tokens; SKILL.md has 756 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~124
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:42
    e.js 18+ with a framework that supports `.env` files (Next.js, Nuxt, SvelteKit, etc.)
  • NoteMentions a .env fileSKILL.md:54
    ject with **shared migrations** and one `.env.*` file per
  • NoteMentions a .env fileSKILL.md:55
    s at a different Supabase project; only `.env.local` is safe to
  • NoteMentions a .env fileSKILL.md:60
    .env.local             # supabase start defaults (safe to commit)
  • NoteMentions a .env fileSKILL.md:61
    .env.staging           # staging project creds  (gitignored)
  • NoteMentions a .env fileSKILL.md:62
    .env.production        # production project creds (gitignored — NEVER commit)
  • NoteMentions a .env fileSKILL.md:73
    for full `.env.*` contents, the `.gitignore` block, and the local-port reference.
  • NoteMentions a .env fileSKILL.md:115
    - **Environment-specific `.env` files** — `.env.local`, `.env.staging`, `.env.production` with correct credentials
  • NoteMentions a .env fileSKILL.md:131
    | `Wrong environment keys in client` | `.env` file mismatch | Check `SUPABASE_ENV` var and verify URL matches expected p
  • NoteMentions a .env fileSKILL.md:142
    abase start        # local, copy keys to .env.local

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 756 words, ~2,197 tokens.

Download SKILL.mdSave it as .claude/skills/supabase-multi-env-setup/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
supabase-multi-env-setup
description
Configure Supabase across development, staging, and production with separate projects, environment-specific secrets, and safe migration promotion. Use when setting up multi-environment deployments, isolating dev from prod data, configuring per-environment Supabase projects, or promoting migrations through environments. Trigger with "supabase environments", "supabase staging", "supabase dev prod", "supabase multi-project", "supabase env config", "database branching".
allowed-tools
Read, Write, Edit, Bash(npx supabase:*), Bash(supabase:*), Bash(vercel:*)
compatibility
Designed for Claude Code
version
1.54.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, supabase, deployment, environments, multi-env, devops

Supabase Multi-Environment Setup

Overview

Production Supabase deployments require a separate project per environment — each with its own URL, API keys, database, and RLS policies. This skill configures a three-tier architecture (local dev, staging, production) with safe migration promotion via supabase db push, environment-aware createClient initialization, database branching for preview deployments, and CI/CD that prevents accidental cross-environment operations.

When to use: setting up a new project with multiple environments, migrating from a single-project setup, adding staging to an existing dev/prod split, or configuring preview environments with database branching.

Prerequisites

  • Three separate Supabase projects created at supabase.com/dashboard (dev, staging, production)
  • Supabase CLI installed: npm install -g supabase or npx supabase --version
  • @supabase/supabase-js v2+ installed in your project
  • Node.js 18+ with a framework that supports .env files (Next.js, Nuxt, SvelteKit, etc.)
  • A secret management solution for CI (GitHub Actions Secrets, Vercel env vars, etc.)

Instructions

The workflow is three steps. Each step below gives the shape and the one command that matters; the full implementation walkthrough carries the complete env files, TypeScript client factory, RLS policies, CI/CD workflow, and seed data verbatim.

Step 1: Environment Files and Project Layout

Keep one Supabase CLI project with shared migrations and one .env.* file per environment. Each file points at a different Supabase project; only .env.local is safe to commit.

supabase/migrations/   # shared schema — every env applies the same migrations
.env.local             # supabase start defaults (safe to commit)
.env.staging           # staging project creds  (gitignored)
.env.production        # production project creds (gitignored — NEVER commit)

The CLI links one project at a time. Before any db push or functions deploy, re-link to the target:

text
npx supabase link --project-ref <target-ref>

See the implementation walkthrough (Step 1) for full .env.* contents, the .gitignore block, and the local-port reference.

Step 2: Environment-Aware Client and Safeguards

Detect the active environment once, then build browser (anon key, respects RLS) and server (service-role key, bypasses RLS) clients from it. Gate every destructive helper behind a production guard so seeds and resets can never fire against prod:

typescript
export function requireNonProduction(operation: string): void {
  if (isProduction()) {
    throw new Error(`[BLOCKED] "${operation}" is not allowed in production.`);
  }
}

The implementation walkthrough (Step 2) has the full lib/env.ts detection, the createBrowserClient / createServerClient factory, the seedTestData / resetDatabase guards, and environment-scoped RLS policies.

Step 3: Migration Promotion and Database Branching

Promote schema changes strictly local → staging → production. db reset applies everything plus seed.sql locally; db push applies only new migrations to a linked remote:

text
npx supabase db reset                              # local: all migrations + seed
npx supabase link --project-ref <staging-ref> && npx supabase db push   # then staging
npx supabase link --project-ref <prod-ref>    && npx supabase db push   # then production

For preview deployments, supabase branches create (Pro plan) gives each feature its own isolated database, URL, and keys. Full migration workflow, branching commands, the GitHub Actions deploy workflow (with a production approval gate), and seed data live in the implementation walkthrough (Step 3).

Output

Completing this skill produces:

  • Three isolated Supabase projects — each with its own URL, API keys, database, and storage
  • Environment-specific .env files — .env.local, .env.staging, .env.production with correct credentials
  • Environment-aware createClient — browser and server clients auto-configured from env vars with x-environment header tracking
  • Production safeguards — requireNonProduction() blocks destructive operations outside local/staging
  • Migration promotion pipeline — supabase db push promotes schema changes local → staging → production
  • Database branching — preview environments get isolated database branches (Pro plan)
  • CI/CD workflows — GitHub Actions deploys migrations and Edge Functions per environment with approval gates for production
  • Generated TypeScript types — database.types.ts generated from local or linked project schema
Show full SKILL.md (267 more words)Show less

Error Handling

ErrorCauseSolution
Cannot find project refCLI not linked to a projectRun npx supabase link --project-ref <ref> before db push
Migration has already been appliedRe-running an existing migrationCheck supabase_migrations.schema_migrations table; migrations are idempotent by ref
Permission denied for schema publicWrong database passwordVerify SUPABASE_DB_PASSWORD matches the project's database password in dashboard
Seed data appeared in productionRan supabase db reset on prodseed.sql only runs on db reset — never reset production; use db push instead
Wrong environment keys in client.env file mismatchCheck SUPABASE_ENV var and verify URL matches expected project ref
Branch creation failedFree plan or branching not enabledDatabase branching requires Supabase Pro plan; enable in project settings
Migration drift between envsSkipped staging promotionAlways promote through staging first; compare with supabase migration list per project
Type generation mismatchTypes generated from wrong envRegenerate from local (--local) or re-link to the canonical environment

Examples

Three worked examples live in references/examples.md. The fastest path — a full three-env bootstrap from supabase init to a production db push — is:

bash
npx supabase init && npx supabase start        # local, copy keys to .env.local
npx supabase migration new create_users        # author schema, then:
npx supabase db reset                           # verify locally
npx supabase link --project-ref "<staging-ref>" && npx supabase db push
npx supabase link --project-ref "<prod-ref>"    && npx supabase db push

Examples 2 and 3 (full file) show a Next.js middleware that stamps and gates on x-supabase-env, and an admin handler that calls requireNonProduction before a destructive RPC.

Resources

Next Steps

  • For authentication patterns across environments, see supabase-auth-storage-realtime-core
  • For RLS policy testing and validation, see supabase-policy-guardrails
  • For local development workflow optimization, see supabase-local-dev-loop
  • For monitoring and observability across environments, see supabase-observability

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/.curated/supabase-multi-env-setup of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/configuration-structure.md
  • references/errors.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit 80f86df

Compare with similar skills

Supabase Multi Env Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Supabase Multi Env Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Supabase Multi Env Setup this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.2kAutomated safety check: NotesMIT
Project Toolingalinaqi/maggy707—~2.5kAutomated safety check: NotesMIT
Stash Deploymentcipherstash/stack157—~6.5kAutomated safety check: PassMIT
Lovableaiskillstore/marketplace4301 repos~2.7kAutomated safety check: NotesNone
Golivemikehasa/golive-skill1.2k—~13kAutomated safety check: NotesMIT
Kubeshark Installerkubeshark/kubeshark12k—~3.6kAutomated safety check: NotesApache-2.0

Similar skills

  • Project Tooling

    alinaqi/maggy

    gh, vercel, supabase, render CLI and deployment platform setup

    707 GitHub stars~2.5k tokensUpdated 15 days ago
    DevOps & CloudAuto-check: notes
  • Stash Deployment

    cipherstash/stack

    Deploy a CipherStash encryption rollout to a live environment without losing data — the multi-deploy ladder (schema-add + dual-write → backfill → read cutover → stop dual-writes → drop plaintext)…

    157 GitHub stars~6.5k tokensUpdated today
    DatabasesAuto-check passed
  • Lovable

    aiskillstore/marketplace

    Integration skill for Lovable.dev projects. An agent skill from aiskillstore/marketplace.

    430 GitHub starsUsed in 1 repo~2.7k tokens
    DatabasesAuto-check: notes
  • Golive

    mikehasa/golive-skill

    Take an agent-written app from repo to live production on the user's OWN accounts, with providers they choose (hosting, database, auth, payments, email, domain/DNS).

    1.2k GitHub stars~13k tokensUpdated 6 days ago
    Backend & APIsAuto-check: notes
  • Kubeshark Installer

    kubeshark/kubeshark

    Installs and configures Kubeshark on a Kubernetes cluster, choosing between the quick CLI path and a Helm install with custom values.

    12k GitHub stars~3.6k tokensUpdated 2 days ago
    DevOps & CloudAuto-check: notes
  • GreptimeDB Dev Docker Image

    GreptimeTeam/greptimedb

    Packages a locally built GreptimeDB debug binary into a development-only Docker image for local-cluster testing, with an optional push to a dev registry.

    6.7k GitHub stars~4k tokensUpdated today
    DevOps & CloudAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated yesterday
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Supabase Multi Env Setup

What does Supabase Multi Env Setup do?

Configure Supabase across development, staging, and production with separate projects, environment-specific secrets, and safe migration promotion. Supabase Multi Env Setup is an agent skill from jeremylongshore/tons-of-skills-marketplace. Configure Supabase across development, staging, and production with separate projects, environment-specific secrets, and safe migration promotion.

When should I use Supabase Multi Env Setup?

Supabase Multi Env Setup fits situations like: setting up multi-environment deployments; isolating dev from prod data; configuring per-environment Supabase projects; promoting migrations through environments.

How do I install Supabase Multi Env Setup in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-multi-env-setup -a claude-code`. Or copy the skill folder (skills/.curated/supabase-multi-env-setup in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/supabase-multi-env-setup in your project. Claude Code loads it when a task matches its description.

How do I install Supabase Multi Env Setup in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-multi-env-setup -a codex`. Or copy the skill folder (skills/.curated/supabase-multi-env-setup in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/supabase-multi-env-setup in your project. Codex loads it when a task matches its description.

Can I use Supabase Multi Env Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-multi-env-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/supabase-multi-env-setup, .gemini/skills/supabase-multi-env-setup, .github/skills/supabase-multi-env-setup and .opencode/skills/supabase-multi-env-setup in your project.

What does Supabase Multi Env Setup need to run?

Going by SKILL.md and its folder, Supabase Multi Env Setup needs the command-line tools its instructions call (npx, supabase and npm) and credentials named SUPABASE_DB_PASSWORD. Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npx supabase:*), Bash(supabase:*), Bash(vercel:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Supabase Multi Env Setup access the network?

SKILL.md names 2 domains. As links in the text: supabase.com and 12factor.net. This is read from the text; nothing was executed.

Is Supabase Multi Env Setup safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Supabase Multi Env Setup use?

Supabase Multi Env Setup is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Supabase Multi Env Setup use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.6k tokens, read only when the agent opens those files.

What are the alternatives to Supabase Multi Env Setup?

Skills that share tags, products or a category with Supabase Multi Env Setup: Project Tooling (alinaqi/maggy, 707 stars), Stash Deployment (cipherstash/stack, 157 stars), Lovable (aiskillstore/marketplace, 430 stars) and Golive (mikehasa/golive-skill, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Supabase Multi Env Setup?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.