Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Migrate

ASecurity

Applies pending Supabase migrations to the local or production database. This skill is strictly additive — it only applies new migrations and NEVER resets, truncates, or drops existing data.

419 stars
0 votes
0 copies
0 views
Added 9/20/2026
databasesbashsqldatabase

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add pipecat-ai/gradient-bang --skill migrate --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Migrate?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Migrate
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pipecat-ai-migrate/badge)](https://www.skillsdirectory.com/skills/pipecat-ai-migrate)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
# Run Database Migration

Applies pending Supabase migrations to the local or production database. This skill is strictly additive — it only applies new migrations and NEVER resets, truncates, or drops existing data.

## Safety rules — READ BEFORE PROCEEDING

**You MUST follow every rule below. No exceptions.**

1. **NEVER** run `supabase db reset`, `supabase db reset --linked`, or any command that drops/recreates the database.
2. **NEVER** run `DROP TABLE`, `DROP SCHEMA`, `TRUNCATE`, or `DELETE FROM` against any table unless it is explicitly part of the migration SQL the user has already reviewed.
3. **NEVER** pass `--linked` to `db reset`. There is no safe use of `db reset` in this skill.
4. **NEVER** modify or overwrite an existing migration file. Migrations that have already been applied are immutable.
5. **ALWAYS** show the user the exact SQL that will run before applying it.
6. **ALWAYS** confirm with the user before applying migrations to **production**.
7. **NEVER** rely on `--linked` for remote targets. The currently linked project may belong to a different environment than the one the user asked for. Always target the database explicitly via `--db-url "$POSTGRES_POOLER_URL"` (sourced from the env file for the requested environment).
8. If anything looks destructive or risky, **STOP and ask the user** before continuing.

## Parameters

The user specifies the environment as an argument: `/migrate local`, `/migrate dev`, or `/migrate prod`. If not provided, ask which environment.

- `local` → env file: `.env.supabase`
- `dev` → env file: `.env.cloud.dev`
- `prod` → env file: `.env.cloud`

## Steps

### 1. Source environment variables

```bash
set -a && source <env-file> && set +a
```

### 2. Check for pending migrations

List which migrations have already been applied and which are pending.

For **local**:
```bash
npx supabase migration list --workdir deployment --local
```

For **dev** or **prod**, target the env's database directly via `--db-url` — never rely on `--linked`:
```bash
npx supabase migration list --workdir deployment --db-url "$POSTGRES_POOLER_URL"
```

`POSTGRES_POOLER_URL` comes from the env file sourced in step 1; it embeds the password and project host, so this command is unambiguous about which database it hits regardless of what `supabase link` last pointed at.

Show the user the list of pending (not yet applied) migrations.

### 3. Review migration SQL

For each pending migration, read the file from `deployment/supabase/migrations/` and display its contents to the user. Summarise what the migration does. Flag anything that looks destructive (drops, truncates, deletes) and ask the user to confirm.

### 4. Apply the migrations

For **local** — apply pending migrations to the running local Supabase instance:
```bash
npx supabase migration up --workdir deployment --local
```

For **dev** or **prod** — push pending migrations directly to the env's database via `--db-url`:
```bash
npx supabase db push --workdir deployment --db-url "$POSTGRES_POOLER_URL" --include-all
```

Do NOT use `--linked` for remote pushes. Targeting `--db-url` from the just-sourced env file guarantees the push lands on the env the user asked for, even if `supabase link` was last run against a different project.

**Production only:** Before running `db push`, ask the user for explicit confirmation one more time. Show them exactly which migrations will be applied.

### 5. Verify

After applying, re-run the migration list command from step 2 and confirm all migrations now show as applied. Report the result to the user.

## Creating a new migration

If the user wants to create a new migration (not just apply existing ones):

1. Generate a timestamped migration file:
```bash
npx supabase migration new <migration_name> --workdir deployment
```

2. Open the newly created file for the user to write the SQL.
3. After the SQL is written, follow steps 2–5 above to review and apply it.

## Important notes

- Migrations live in `deployment/supabase/migrations/` and follow the naming convention `YYYYMMDDhhmmss_description.sql`.
- For local development, Supabase must already be running (`npx supabase start --workdir deployment/`).
- Each cloud env file (`.env.cloud.dev`, `.env.cloud`) defines `POSTGRES_POOLER_URL` for its project. The skill targets that URL via `--db-url`, so there is no `supabase link` step and no risk of pushing to the wrong project because the link points elsewhere. If a future env file is missing this var, surface that to the user instead of falling back to `--linked`.
- All command output should be redirected to files when it may be verbose. Do NOT use `tee`.
- This skill is **only** for schema migrations. For seeding runtime config (e.g. combat cron), use the `reset-world` or `deploy` skills instead.

Attribution

pipecat-aipipecat-ai
View sourceMore from pipecat-ai →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Mysql Best Practices

MySQL development best practices for schema design, query optimization, and database administration

2481 votes

Clickhouse Io

ClickHouse数据库模式、查询优化、分析和数据工程最佳实践,适用于高性能分析工作负载。

2456590 votes

Jpa Patterns

Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。

2456590 votes

Postgres Patterns

基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。

2456590 votes

Database Optimizer

Expert database optimizer specializing in modern performance

458250 votes
View all in databases →