Skip to content
Skill

Database migrations

Guides agents through safe Postgres schema changes, backfills and sqlc regeneration

Database migrations is an open-source agent skill for databases. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
8
Last commit
License
MIT
Listing updated

Similar skills

About Database migrations

This skill gives an agent a set of Postgres-first rules for changing schema and data: one new migration per change, never editing a migration that may already be applied, and writing a reversible down for every up. It explains which DDL operations lock tables and what to do instead, such as concurrent index builds, NOT VALID constraints with separate validation, and lock_timeout settings.

It also lays out an expand/contract sequence for renames and type changes, spread across separate releases, and advice to batch large backfills so they stay idempotent and restartable. Tool-specific commands are included for golang-migrate, goose, Alembic and Prisma, with notes on reviewing autogenerated output by hand.

For Go projects using sqlc, the skill describes the loop of editing SQL queries, running sqlc generate and vet, rebuilding and testing, and never hand-editing generated files. It expects a Postgres database to test against and the relevant migration tool in the repository.

When your agent uses it

Postgres-first rules for schema and data changes - one new migration per change, never edit applied ones, expand/contract for renames, concurrent indexes, batched backfills, reversible downs - plus tool workflows (golang-migrate, goose, Alembic, Prisma) and the sqlc generate/vet loop. Use when a job changes schema, queries or data.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (6 KB) on GitHub on 2 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the forgeline plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add Nabwinsaud/forgeline
/plugin install forgeline@forgeline

Or copy only this skill to ~/.claude/skills/database-migrations:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/database-migrations &&
cp -R "$tmp/skills/database-migrations" ~/.claude/skills/database-migrations &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/database-migrations inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/database-migrations to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/database-migrations &&
cp -R "$tmp/skills/database-migrations" ~/.agents/skills/database-migrations &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/database-migrations inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/database-migrations to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/database-migrations &&
cp -R "$tmp/skills/database-migrations" ~/.cursor/skills/database-migrations &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/database-migrations inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/Nabwinsaud/forgeline.git --path skills/database-migrations

Or copy the folder to ~/.gemini/skills/database-migrations yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/database-migrations:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/database-migrations &&
cp -R "$tmp/skills/database-migrations" ~/.copilot/skills/database-migrations &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/database-migrations inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/Nabwinsaud/forgeline.git

Then copy forgeline/skills/database-migrations into your agent's skills folder as database-migrations. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Migration safety rules
Ground rules for one-change migrations, never editing applied ones, and keeping old code working during deploys.
Lock-aware DDL guidance
A table of Postgres operations showing which ones block writes or scan tables and safer alternatives.
Expand and contract steps
A staged approach for renames and column type changes spread across separate releases.
Batched backfill pattern
Keyed, per-batch UPDATE pattern that keeps large data changes restartable.
Multi-tool migration commands
Create, up and down commands for golang-migrate, goose, Alembic and Prisma.
sqlc generate and vet loop
Steps for editing queries, regenerating typed Go code and verifying the build and tests.

Good for

  • Add a column to a large Postgres table without locking writes
  • Rename a column using expand and contract across releases
  • Write a concurrent index migration for goose or golang-migrate
  • Backfill a new status column in batches
  • Regenerate sqlc code after changing a query

Database migrations FAQ

When does Database migrations trigger?

Its description says it applies when a job changes schema, queries or data.

Which migration tools does Database migrations cover?

It includes workflows for golang-migrate, goose, Alembic and Prisma, plus the sqlc generate and vet loop.

Does Database migrations run any scripts?

No scripts are included; it provides rules and command examples only.

Is Database migrations specific to one database?

Its guidance is Postgres-first, with concurrent indexes, NOT VALID constraints and lock_timeout advice.

How do I install Database migrations in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/database-migrations to use it in all your projects, or to .claude/skills/database-migrations in one project. Or install the forgeline plugin, which includes it: /plugin marketplace add Nabwinsaud/forgeline, then /plugin install forgeline@forgeline.

Does Database migrations run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Database migrations?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Database migrations?

The closest alternatives to Database migrations are Database migrations, Go database, Db change management, Alembic knowledge patch and Reviewing oracle to postgres migration.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from Nabwinsaud/forgeline

  1. Gives agents conventions for designing HTTP/JSON endpoints, errors and pagination

    • Open source
    • 8 GitHub stars
    • Developer tools
  2. Records a human approve, reject or retry decision on a paused Forgeline job

    • Open source
    • 8 GitHub stars
    • Developer tools
  3. Gives a read-only reviewer agent a prioritized procedure for checking factory PRs

    • Open source
    • 8 GitHub stars
    • Developer tools
  4. Turns one sentence into a Forgeline job that runs through to a reviewed PR

    • Open source
    • 8 GitHub stars
    • Developer tools
  5. Checks whether your machine and repo are ready to run the Forgeline factory

    • Open source
    • 8 GitHub stars
    • Developer tools
  6. Guides an agent to write and run Playwright end-to-end tests for acceptance criteria

    • Open source
    • 8 GitHub stars
    • Developer tools