db-migration

db-migration is a command for coding agents from fockus/skill-memory-bank. It costs 10 tokens per session (1,018 once invoked), scanned A, original, MIT.

A database-change command that creates and manages migration files for common database tools and programming languages.

In plain words
What is it for?
Use it to inspect a project, find its migration tool, and create or manage a migration describing a database change.
Why use it?
It helps identify which migration system a project uses, so database changes follow the project’s existing setup.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/fockus/skill-memory-bank/db-migration
Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for db-migration

README.md
[![agentmods](https://agentmods.dev/badge/commands/fockus/skill-memory-bank/db-migration.svg)](https://agentmods.dev/commands/fockus/skill-memory-bank/db-migration)
Your own site
<a href="https://agentmods.dev/commands/fockus/skill-memory-bank/db-migration"><img src="https://agentmods.dev/badge/commands/fockus/skill-memory-bank/db-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,018 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.01018
Opus 5 $0.00005 $0.00509
Sonnet 5 $0.00002 $0.00204
Haiku 4.5 $0.00001 $0.00102

Measured 4d ago against content hash 4bc91dc974d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

db-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/db-migration.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Migration: $ARGUMENTS

0. Validate arguments

If $ARGUMENTS is empty, stop and ask the user what the migration should change.

1. Stack detection

eval "$(bash ~/.claude/skills/memory-bank/scripts/mb-metrics.sh)"
# Uses: stack to narrow the tooling search

2. Detect the migration tool

# golang-migrate / goose / Atlas (Go)
ls migrations/ db/migrations/ 2>/dev/null
grep -r "golang-migrate\|pressly/goose\|ariga/atlas" go.mod 2>/dev/null

# Alembic (Python)
ls alembic/ 2>/dev/null; cat alembic.ini 2>/dev/null

# Prisma (Node.js)
ls prisma/schema.prisma 2>/dev/null

# Sequelize / Knex (Node.js)
ls sequelize/ migrations/ knexfile.js knexfile.ts 2>/dev/null
grep -l "sequelize\|knex" package.json 2>/dev/null

# Diesel (Rust)
ls diesel.toml 2>/dev/null
grep -l "diesel" Cargo.toml 2>/dev/null

# SQLx (Rust)
ls migrations/ 2>/dev/null
grep -l "sqlx" Cargo.toml 2>/dev/null

# Flyway (Java/JVM)
ls flyway.conf db/migration/ src/main/resources/db/migration/ 2>/dev/null

# Liquibase (Java/JVM)
ls liquibase.properties changelog*.xml db/changelog/ 2>/dev/null

# Entity Framework Core (.NET)
ls Migrations/ 2>/dev/null
grep -l "EntityFrameworkCore" *.csproj 2>/dev/null

# Plain SQL files
find . -name "*.sql" -path "*/migrat*" 2>/dev/null | head -20

If none of the above matches, ask the user which migration tool the project uses before writing anything.

3. Universal requirements

Every migration must follow these rules, regardless of tool:

  • Both up and down (or equivalent forward / rollback). down must fully reverse up.
  • Destructive operations (DROP TABLE, DROP COLUMN, TRUNCATE, DELETE FROM without WHERE) require explicit y/N confirmation before the file is written — not just before it is applied. Default = No.
  • Schema migrations and data migrations must be in separate files.
  • Index creation uses CONCURRENTLY on PostgreSQL when the tool supports it (golang-migrate -disable-create-hash-comments, Alembic with op.create_index(..., postgresql_concurrently=True), etc.).
  • Idempotent wrappers (IF NOT EXISTS, IF EXISTS) on DDL where the dialect supports them.
  • Backward compatibility: the previous application version must still function against the new schema for the duration of a rolling deploy.

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 99 lines · 10 tokens per session scan A 4bc91dc974d2

Subscribe to this mod's changes

db-migration is a command published in the GitHub repository fockus/skill-memory-bank (25 stars, last pushed 1mo ago), licensed MIT. It adds 10 tokens to every session and 1,018 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.