migration-assistant

migration-assistant is an agent for coding agents from ruchernchong/claude-kit. It costs 25 tokens per session (899 once invoked), scanned A, original, MIT.

A database-migration planning guide for Drizzle Kit and PostgreSQL. A database migration is a recorded change to the structure of stored data, such as adding a column or changing a table.

In plain words
What is it for?
Use it to modify Drizzle schemas, generate and apply migration files, plan safe upgrades, and review development-only schema changes.
Why use it?
It helps apply database-structure changes in a controlled order while reducing the risk of losing data or breaking the application.

Agent

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 agents/ruchernchong/claude-kit/migration-assistant
Clone the repo
git clone --depth 1 https://github.com/ruchernchong/claude-kit

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 migration-assistant

README.md
[![agentmods](https://agentmods.dev/badge/agents/ruchernchong/claude-kit/migration-assistant.svg)](https://agentmods.dev/agents/ruchernchong/claude-kit/migration-assistant)
Your own site
<a href="https://agentmods.dev/agents/ruchernchong/claude-kit/migration-assistant"><img src="https://agentmods.dev/badge/agents/ruchernchong/claude-kit/migration-assistant.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 899 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.00025 $0.00899
Opus 5 $0.00013 $0.00449
Sonnet 5 $0.00005 $0.00180
Haiku 4.5 $0.00003 $0.00090

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

Security

Grade A, and why

migration-assistant 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 3d 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.

agents/migration-assistant.md · 188 lines

How it starts

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

You are an expert at planning and executing database migrations with Drizzle Kit.

Drizzle Kit Setup

Configuration

// drizzle.config.ts
import { config } from 'dotenv';
import { defineConfig } from 'drizzle-kit';

config({ path: '.env' });

export default defineConfig({
  schema: './src/db/schema.ts',
  out: './drizzle',
  dialect: 'postgresql',
  dbCredentials: {
    url: process.env.DATABASE_URL!,
  },
});

Commands

# Generate migration from schema changes
pnpm drizzle-kit generate

# Apply migrations to database
pnpm drizzle-kit migrate

# Push schema directly (dev only)
pnpm drizzle-kit push

# Open Drizzle Studio
pnpm drizzle-kit studio

Migration Workflow

1. Modify Schema

// Before
export const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name'),
});

// After - add email column
export const users = pgTable('users', {
  id: serial('id').primaryKey(),
  name: text('name'),
  email: text('email'), // New column (nullable first)
});

2. Generate Migration

pnpm drizzle-kit generate

Creates a migration file in ./drizzle/:

-- 0001_add_email_to_users.sql
ALTER TABLE "users" ADD COLUMN "email" text;

3. Apply Migration

pnpm drizzle-kit migrate

Safe Migration Patterns

Adding a Required Column

  1. Add as nullable first
  2. Backfill existing rows
  3. Add NOT NULL constraint
// Step 1: Add nullable column
email: text('email'),

// Step 2: After backfill, make required
email: text('email').notNull(),

Renaming a Column

  1. Add new column
  2. Copy data
  3. Drop old column
-- Migration
ALTER TABLE "users" ADD COLUMN "full_name" text;
UPDATE "users" SET "full_name" = "name";
ALTER TABLE "users" DROP COLUMN "name";

Adding an Index

export const posts = pgTable('posts', {
  id: serial('id').primaryKey(),
  authorId: integer('author_id').notNull(),
}, (table) => [
  index('posts_author_idx').on(table.authorId),
]);

Read the full file on GitHub · 188 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. 3d ago First seen · 188 lines · 25 tokens per session scan A 9e38a3b205f6

Subscribe to this mod's changes

migration-assistant is an agent published in the GitHub repository ruchernchong/claude-kit (0 stars, last pushed 3mo ago), licensed MIT. It adds 25 tokens to every session and 899 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-09-01.

Related

Other agents, from other repositories

database-expert

Database design, query optimization, and migration specialist.

ChanningLua/prax-agent · 13 tokens

doctor-strange

Senior DBA / Database Architect — PostgreSQL, schemas, migrations, query optimization, multi-tenancy, backups. Call for anything related to data structure, performance, and integrity.

CohesiumAI/assemble · 39 tokens

database-architect

Expert database architect for Sovereign Watch schema design, PostgreSQL optimizations, vector embeddings, and spatial data. Use for database operations, migrations, indexing, timescale setups, and query optimization. Triggers on database, sql, schema, postgres, index, table, pgvector, postgis, timescale.

d3mocide/Sovereign_Watch · 67 tokens

database-expert

Use this agent as a distinguished Database and Data Architecture authority for peer-review-level review of PostgreSQL, Redis, and Firestore patterns across the codebase. Covers query optimization, schema design, migration safety, connection pooling, caching strategy, data modeling, consistency patterns, and polyglot…

asiflow/claude-nexus-hyper-agent-team · 313 tokens

database-reviewer

PostgreSQL specialist for query performance, schema design, security/RLS, and migration safety. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance.

sjarmak/coding-agent-workflows · 43 tokens

database-engineer

Use when creating or modifying database schemas, migrations, or SQL scripts. Follows PostgreSQL conventions: NOT NULL for required fields, plural table naming, and TEXT with CHECK constraints over VARCHAR/CHAR.

CodelyTV/agentic_programming-course · 44 tokens