# Db migration agent

> Db migration agent is an open-source agent skill for databases. Plans and writes database schema migrations and seed data against a contract. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ivy00johns/Skill-Madness/tree/main/skills/roles/db-migration-agent
- **Repository:** https://github.com/ivy00johns/skill-madness
- **GitHub stars:** 12
- **License:** MIT
- **Skill name:** db-migration-agent
- **Collection:** https://github.com/ivy00johns/Skill-Madness
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-03

## About

This skill has the agent manage database schema migrations, seed data and schema evolution while treating the contracted data layer as the source of truth. It owns migration directories such as migrations/, seeds/, prisma/, alembic/ and knex/migrations/, and reads application models without changing them or touching route handlers and business logic.

The workflow starts by reading the data layer contract, shared type definitions and domain rules, then writes migrations that match contracted tables, column types, constraints and indexes. Migrations are meant to be idempotent, reversible with up and down steps, ordered, and atomic. Development seed data is meant to be realistic but clearly fake, cover every entity, exercise relationships and include edge cases, and stay deterministic for repeatable test runs. A validation pass checks tables, column types, foreign keys, indexes and seed loading before the work is reported done.

The skill is written for an orchestrated multi-agent build, but it also covers explicitly requested solo migration work where the user supplies scope and approved paths. It expects a project database CLI and an ORM or migration tool such as Alembic, Prisma, Knex, Django or raw SQL. Database writes, destructive migrations and production changes require separately scoped approval.

## When your agent uses it

> Manage database schema migrations, seed data and schema evolution in native orchestrator dispatch or explicitly requested solo migration work. Preserve contract boundaries and approval before database mutations; load it when the orchestrator assigns this role or the user asks for it.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/roles/db-migration-agent)
- [Asks for: Read, Write, Edit, Bash, Glob, Grep](https://github.com/ivy00johns/Skill-Madness/blob/HEAD/skills/roles/db-migration-agent/SKILL.md)
- [License: MIT](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/roles/db-migration-agent)

## Features

- **Contract-matched schema design:** Builds tables, column types, constraints and indexes to match the data layer contract.
- **Reversible migration files:** Writes ordered, idempotent migrations with both up and down steps.
- **Deterministic seed data:** Produces fake but realistic seed records covering entities, relationships and edge cases.
- **Post-migration schema validation:** Checks tables, column types, foreign keys, indexes and seed loading after migrating.
- **Approval gates for mutations:** Requires separate approval for database writes, destructive changes and production requests.
- **Ownership boundaries:** Restricts edits to migration and seed directories and leaves application code read-only.

## Good for

- Create migrations for a new set of database tables from a schema contract
- Write reversible Prisma or Alembic migrations after a model change
- Generate development seed data covering parent-child and many-to-many relationships
- Check that a database schema matches its contracted column types and indexes
- Plan a schema evolution while flagging destructive changes for approval

## Install

### Claude Code

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

```sh
/plugin marketplace add ivy00johns/Skill-Madness
/plugin install skill-madness@skill-madness
```

Or copy only this skill to `~/.claude/skills/db-migration-agent`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/db-migration-agent &&
cp -R "$tmp/skills/roles/db-migration-agent" ~/.claude/skills/db-migration-agent &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/db-migration-agent` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/db-migration-agent` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/db-migration-agent &&
cp -R "$tmp/skills/roles/db-migration-agent" ~/.agents/skills/db-migration-agent &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/db-migration-agent` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/db-migration-agent` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/db-migration-agent &&
cp -R "$tmp/skills/roles/db-migration-agent" ~/.cursor/skills/db-migration-agent &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/db-migration-agent` inside it instead.

### Gemini CLI

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

```sh
gemini skills install https://github.com/ivy00johns/Skill-Madness.git --path skills/roles/db-migration-agent
```

Or copy the folder to `~/.gemini/skills/db-migration-agent` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/db-migration-agent`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/db-migration-agent &&
cp -R "$tmp/skills/roles/db-migration-agent" ~/.copilot/skills/db-migration-agent &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/db-migration-agent` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git
```

Then copy `Skill-Madness/skills/roles/db-migration-agent` into your agent's skills folder as `db-migration-agent`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Db migration agent trigger?

It loads when an orchestrator assigns the db-migration role or when the user explicitly asks for it, since native activation is set to explicit only.

### Does Db migration agent change application code?

No. It owns migration and seed directories and treats src/models/ as read-only; route handlers and business logic are off-limits.

### What does Db migration agent need to run?

A project database CLI and a migration tool such as Alembic, Prisma, Knex, Django or raw SQL, with Read, Write, Edit, Bash, Glob and Grep tools available.

### Which AI clients does Db migration agent support?

The skill is published in a Claude Code plugin marketplace, and its frontmatter names Claude Code dispatch; it is otherwise a standard SKILL.md folder.

### How do I install Db migration agent in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/db-migration-agent to use it in all your projects, or to .claude/skills/db-migration-agent in one project. Or install the skill-madness plugin, which includes it: /plugin marketplace add ivy00johns/Skill-Madness, then /plugin install skill-madness@skill-madness.

### Does Db migration agent 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 Db migration agent?

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 Db migration agent?

The closest alternatives to Db migration agent are Database migrations, Db change management, Database migrations, Data layer patterns edho ferdian and Data archaeology.

## Where this comes from

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

## Alternatives

- [Database migrations](https://ai-powered.com/skills/database-migrations): Database migrations is an open-source agent skill for databases.
- [Db change management](https://ai-powered.com/skills/db-change-management): Db change management is an open-source agent skill for databases.
- [Database migrations](https://ai-powered.com/skills/database-migrations-nabwinsaud): Database migrations is an open-source agent skill for databases.
- [Data layer patterns edho ferdian](https://ai-powered.com/skills/data-layer-patterns-edho-ferdian): Data layer patterns edho ferdian is an open-source agent skill for databases.
- [Data archaeology](https://ai-powered.com/skills/data-archaeology): Data archaeology is an open-source agent skill for databases.
- [Postgres database migration](https://ai-powered.com/skills/postgres-database-migration): Postgres database migration is an open-source agent skill for databases.
- [Alembic migrations](https://ai-powered.com/skills/alembic-migrations): Alembic migrations is an open-source agent skill for databases.
- [To dbml](https://ai-powered.com/skills/to-dbml): To dbml is an open-source agent skill for databases.

---
Source: https://ai-powered.com/skills/db-migration-agent
