Agent skill

Supabase Migration Deep Dive

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

Database migration patterns with the Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and TypeScript type…

MITAuto-check passedDatabases

Install Supabase Migration Deep Dive

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill supabase-migration-deep-dive -a claude-code

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace supabase-migration-deep-dive --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-migration-deep-dive .claude/skills/supabase-migration-deep-dive && 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-migration-deep-dive
GitHub stars
2.8k
Token cost
~1.9k tokens
SKILL.md length
658 words
Files
8 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Database migration patterns with the Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and TypeScript type…

  • Works in 3 steps: Create and Manage Migrations → Zero-Downtime Migration Patterns → Data Backfill, Versioning, and Rollback
  • Creating database migrations
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Calls npx, supabase and npm

What it does

Supabase Migration Deep Dive is an agent skill from jeremylongshore/tons-of-skills-marketplace. Database migration patterns with the Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and TypeScript type generation. Use when creating database migrations, performing zero-downtime schema changes, backfilling data in production, managing schema versions, or planning rollback strategies. Trigger with "supabase migration", "supabase schema change", "supabase zero downtime", "supabase rollback", "supabase db push", "supabase…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/backfill-versioning-rollback.md`, `references/creating-migrations.md` and `references/errors.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Database migrations and Type safety. 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

  • Creating database migrations
  • Performing zero-downtime schema changes
  • Backfilling data in production
  • Managing schema versions

Example prompts

  • “supabase migration”
  • “supabase schema change”
  • “supabase zero downtime”
  • “/supabase-migration-deep-dive”

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(psql:*), Grep, Glob

Workflow steps

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

  1. Create and Manage Migrations
  2. Zero-Downtime Migration Patterns
  3. Data Backfill, Versioning, and Rollback

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. 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(psql:*)
    • Grep
    • Glob

    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
    • postgresql.org

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    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 Migration Deep Dive loads about 1.9k tokens when it runs, and up to ~7.2k if it reads all its reference files. Until then it costs about 139 tokens; SKILL.md has 658 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 cfae287, republished under its MIT licence (© jeremylongshore). 658 words, ~1,946 tokens.

Download SKILL.mdSave it as .claude/skills/supabase-migration-deep-dive/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
supabase-migration-deep-dive
description
Database migration patterns with the Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and TypeScript type generation. Use when creating database migrations, performing zero-downtime schema changes, backfilling data in production, managing schema versions, or planning rollback strategies. Trigger with "supabase migration", "supabase schema change", "supabase zero downtime", "supabase rollback", "supabase db push", "supabase migration new".
allowed-tools
Read, Write, Edit, Bash(npx supabase:*), Bash(supabase:*), Bash(psql:*), Grep, Glob
compatibility
Designed for Claude Code
version
1.54.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, supabase, migration, database, schema, zero-downtime, rollback

Supabase Migration Deep Dive

Overview

Supabase migrations are timestamped SQL files managed by the CLI that track schema changes across environments. This skill covers the full lifecycle — creating migrations, zero-downtime schema changes, batch backfills, versioning, rollback, and TypeScript type generation — using real CLI commands and createClient from @supabase/supabase-js.

When to use: Creating new database migrations, modifying production schemas without downtime, backfilling existing data after adding columns, managing migration history across dev/staging/production, rolling back failed migrations, or regenerating TypeScript types.

Prerequisites

  • Supabase CLI installed: npm install -g supabase or npx supabase --version
  • @supabase/supabase-js v2+ installed in your project
  • Local Supabase running: npx supabase start
  • Understanding of PostgreSQL DDL and transaction behavior

Instructions

Step 1: Create and Manage Migrations

Create each migration as a timestamped SQL file, write the DDL, test it against a local reset, then promote it through environments with db push:

bash
npx supabase migration new add_profiles_table   # create timestamped SQL file
npx supabase migration list                      # show applied/pending status
npx supabase db reset                            # apply + seed locally (destructive)
npx supabase gen types typescript --local > lib/database.types.ts
npx supabase link --project-ref "<ref>" && npx supabase db push   # promote to remote

Write DDL that enables RLS, adds policies, indexes, and triggers in the same file so the schema is complete when applied. For the full worked migration (a profiles table with RLS policies, an email index, a signup trigger, and an updated_at trigger) plus the local-test and staging/production promotion commands, see creating migrations.

Step 2: Zero-Downtime Migration Patterns

Production schema changes must avoid locking tables. The core rules: adding a nullable column with a default is lock-free on Postgres 11+; build indexes with CREATE INDEX CONCURRENTLY in a -- supabase:disable-transaction migration; rename or retype a column in two phases (add new column, backfill, sync trigger, then drop the old one) rather than an in-place ALTER COLUMN. Example of the safe column-add:

sql
-- Nullable column with a default does NOT lock the table in Postgres 11+
ALTER TABLE public.orders ADD COLUMN status text DEFAULT 'pending';
-- Then, in a separate -- supabase:disable-transaction migration:
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_orders_status ON public.orders(status);

For the complete set — two-phase column rename with a sync trigger, safe type change via add-backfill-swap, and an SDK health-check that samples query latency during the migration — see zero-downtime patterns.

Step 3: Data Backfill, Versioning, and Rollback

See data backfill, versioning, and rollback for batch backfill patterns with the SDK, schema versioning across environments, three rollback strategies (compensating migration, repair, feature flags), and type regeneration after migrations.

Output

This skill produces:

  • Migration creation workflow — npx supabase migration new with descriptive SQL files and local testing
  • Zero-downtime patterns — safe column additions, two-phase renames, concurrent index creation
  • Batch backfill — SDK-based row-by-row updates with progress logging and rate limiting
  • Schema versioning — supabase migration list and db diff for comparing environments
  • Rollback strategies — compensating migrations, migration repair, and feature-flagged schema changes
  • Type regeneration — supabase gen types typescript after every schema change
  • Migration promotion — db push workflow from local to staging to production
Show full SKILL.md (249 more words)Show less

Error Handling

ErrorCauseSolution
migration has already been appliedRe-running existing migrationUse supabase migration list to check status; never modify applied migrations
cannot run inside a transaction blockCREATE INDEX CONCURRENTLY in transactionAdd -- supabase:disable-transaction comment at top of migration file
column does not exist after migrationMigration not applied or types staleRun supabase db push then supabase gen types typescript
deadlock detected during backfillConcurrent updates on same rowsReduce batch size; add retry logic with exponential backoff
statement timeout on large tableMigration takes longer than timeoutIncrease statement_timeout in migration: SET statement_timeout = '300s';
migration repair failedWrong version numberUse exact version from supabase migration list (the timestamp prefix)
db diff shows unexpected changesSchema drift from manual SQL Editor changesRun supabase db pull to capture manual changes as a migration
Type mismatch after migrationGenerated types don't match new schemaDelete database.types.ts and regenerate from --local or --linked

Examples

The create-write-test-push workflow for a real column addition:

text
npx supabase migration new add_tags_to_projects
cat > supabase/migrations/20260322150000_add_tags_to_projects.sql << 'SQL'
ALTER TABLE public.projects ADD COLUMN tags text[] DEFAULT '{}';
CREATE INDEX idx_projects_tags ON public.projects USING GIN(tags);
SQL
npx supabase db reset
npx supabase gen types typescript --local > lib/database.types.ts
npx supabase link --project-ref <staging-ref> && npx supabase db push

See examples for three full worked examples: the complete local-to-production migration workflow, a batch backfill with progress tracking from the SDK, and a safe enum migration using a CHECK constraint instead of ALTER TYPE.

Resources

Next Steps

  • For advanced troubleshooting after migrations, see supabase-advanced-troubleshooting
  • For multi-environment migration promotion, see supabase-multi-env-setup
  • For performance tuning after schema changes, see supabase-performance-tuning

© 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 7 other files (references) in skills/.curated/supabase-migration-deep-dive of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/backfill-versioning-rollback.md
  • references/creating-migrations.md
  • references/errors.md
  • references/examples.md
  • references/implementation-plan.md
  • references/pre-migration-assessment.md
  • references/zero-downtime-patterns.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Supabase Migration Deep Dive 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 Migration Deep Dive compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Supabase Migration Deep Dive this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.9kAutomated safety check: PassMIT
Lovableaiskillstore/marketplace4331 repos~2.7kAutomated safety check: NotesNone
Supabase Postgres Best Practicessupabase/agent-skills2.7k24 repos~808Automated safety check: PassMIT
Prisma 8 Contract-First ORMprisma/orm48k—~3.8kAutomated safety check: NotesApache-2.0
Stash Indexingcipherstash/stack157—~5.8kAutomated safety check: PassMIT
Drizzle Ormericrisco/rsc-harness180—~2.6kAutomated safety check: PassMIT

Similar skills

  • Lovable

    aiskillstore/marketplace

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

    433 GitHub starsUsed in 1 repo~2.7k tokens
    DatabasesAuto-check: notes
  • Official

    Gives the agent Postgres rules to consult before writing or changing tables, queries, indexes, RLS policies or migrations, and when diagnosing slow queries.

    2.7k GitHub starsUsed in 24 repos~808 tokens
    DatabasesAuto-check passed
  • Official

    Routes Prisma 8 tasks such as contracts, migrations, queries and upgrades to the right reference files for projects on the contract-first @prisma/orm packages.

    48k GitHub stars~3.8k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • Stash Indexing

    cipherstash/stack

    Create and verify PostgreSQL indexes on EQL v3 encrypted columns — functional-index recipes over the term extractors (eqlv3.eqterm, ordterm, ordtermore, matchterm, tostevecquery) mapped to the types.

    157 GitHub stars~5.8k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Drizzle Orm

    ericrisco/rsc-harness

    A skill your agent uses when modeling data or querying with Drizzle ORM in TypeScript — pgTable schema in .ts, type-safe select/insert/relational queries, drizzle-kit migrations.

    180 GitHub stars~2.6k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Prisma Orm

    ericrisco/rsc-harness

    A skill your agent uses when modeling data or writing type-safe queries with Prisma ORM in TypeScript — schema.prisma, prisma.config.ts, the generated Prisma Client, and Prisma Migrate, including…

    180 GitHub stars~3k tokensUpdated yesterday
    DatabasesAuto-check passed

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 today
    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 today
    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 today
    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 today
    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 today
    Auto-check passed

Works with

Categories

Questions about Supabase Migration Deep Dive

What does Supabase Migration Deep Dive do?

Database migration patterns with the Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and TypeScript type…. Supabase Migration Deep Dive is an agent skill from jeremylongshore/tons-of-skills-marketplace. Database migration patterns with the Supabase CLI: npx supabase migration new, zero-downtime migrations, data backfill strategies, schema versioning, rollback strategies, and TypeScript type generation.

When should I use Supabase Migration Deep Dive?

Supabase Migration Deep Dive fits situations like: creating database migrations; performing zero-downtime schema changes; backfilling data in production; managing schema versions.

How do I install Supabase Migration Deep Dive in Claude Code?

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

How do I install Supabase Migration Deep Dive in Codex?

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

Can I use Supabase Migration Deep Dive 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-migration-deep-dive -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-migration-deep-dive, .gemini/skills/supabase-migration-deep-dive, .github/skills/supabase-migration-deep-dive and .opencode/skills/supabase-migration-deep-dive in your project.

What does Supabase Migration Deep Dive need to run?

Going by SKILL.md and its folder, Supabase Migration Deep Dive needs the command-line tools its instructions call (npx, supabase and npm). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npx supabase:*), Bash(supabase:*), Bash(psql:*), Grep, Glob. Compatibility (from SKILL.md): Designed for Claude Code.

Does Supabase Migration Deep Dive access the network?

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

Is Supabase Migration Deep Dive safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Supabase Migration Deep Dive use?

Supabase Migration Deep Dive 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 Migration Deep Dive use?

About 1.9k tokens (SKILL.md is roughly 7.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 5.2k tokens, read only when the agent opens those files.

What are the alternatives to Supabase Migration Deep Dive?

Skills that share tags, products or a category with Supabase Migration Deep Dive: Lovable (aiskillstore/marketplace, 433 stars), Supabase Postgres Best Practices (supabase/agent-skills, 2.7k stars), Prisma 8 Contract-First ORM (prisma/orm, 48k stars) and Stash Indexing (cipherstash/stack, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Supabase Migration Deep Dive?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 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.