new-migration

new-migration is a command for coding agents from RaNDoM6913/claude-code-superkit. It costs 22 tokens per session (2,439 once invoked), scanned A, original, MIT.

A command that creates a matching pair of database migration files: one to apply a change and one to undo it. It follows the project's existing migration tool, file naming, numbering, folder, and SQL dialect.

In plain words
What is it for?
Use it when adding a table, column, index, or other database schema change in a project that already uses migrations.
Why use it?
It avoids manually guessing where migrations belong or writing SQL that does not work with the project's database. The undo file also provides a defined reverse of the change.

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/random6913/claude-code-superkit/new-migration
Clone the repo
git clone --depth 1 https://github.com/RaNDoM6913/claude-code-superkit

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/random6913/claude-code-superkit/new-migration.svg)](https://agentmods.dev/commands/random6913/claude-code-superkit/new-migration)
Your own site
<a href="https://agentmods.dev/commands/random6913/claude-code-superkit/new-migration"><img src="https://agentmods.dev/badge/commands/random6913/claude-code-superkit/new-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,439 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.00022 $0.02439
Opus 5 $0.00011 $0.01220
Sonnet 5 $0.00004 $0.00488
Haiku 4.5 $0.00002 $0.00244

Measured yesterday against content hash 5124527e036a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

new-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 yesterday.

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.

packages/core/commands/new-migration.md · 183 lines

How it starts

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

New Migration

Role

Scaffold a database migration that matches the project's existing migration tool, directory, numbering scheme, and SQL dialect.

Migration description: $ARGUMENTS

Hard Rules

  1. NEVER invent a migrations directory, numbering scheme, or naming pattern — copy every convention from existing migrations, or ask the user (Step 2).
  2. No migration system detected, OR the migrations directory is empty → Step 2: report and ask. Create zero files on that branch.
  3. Match the project's SQL dialect (Step 3). NEVER emit PostgreSQL-only types (TIMESTAMPTZ, BIGSERIAL, JSONB) into a MySQL or SQLite project.
  4. SQL-file tools always get BOTH files: .up.sql and .down.sql. Down is the exact reverse of up.
  5. Use IF NOT EXISTS / IF EXISTS guards where the dialect supports them; never a destructive operation (DROP TABLE, DROP COLUMN) without IF EXISTS.
  6. Report only after verifying the created files exist on disk (ls or Read).

Step 1 — Detect Migration System

Check each marker with Glob. A row matches only if the directory contains at least one existing migration file:

Marker Tool Directory Naming Pattern
backend/migrations/*.sql with numbered names golang-migrate backend/migrations/ 000NNN_desc.{up,down}.sql
migrations/*.sql with numbered names golang-migrate migrations/ 000NNN_desc.{up,down}.sql
db/migrations/*.sql golang-migrate / dbmate db/migrations/ NNNNNN_desc.{up,down}.sql
db/migrate/*.rb Rails db/migrate/ YYYYMMDDHHMMSS_desc.rb
alembic/versions/*.py Alembic alembic/versions/ rev_desc.py
prisma/migrations/ Prisma prisma/migrations/ YYYYMMDDHHMMSS_desc/
drizzle/ + drizzle.config.ts Drizzle drizzle/ NNNN_desc.sql

Branches — exactly one applies:

  • Exactly one row matches → Step 3.
  • Two or more rows match → list the candidate directories, ask the user which one to use, wait for the answer.
  • No row matches, or a directory exists but holds no migration files → Step 2.

Read the full file on GitHub · 183 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. yesterday First seen · 183 lines · 22 tokens per session scan A 5124527e036a

Subscribe to this mod's changes

new-migration is a command published in the GitHub repository RaNDoM6913/claude-code-superkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 22 tokens to every session and 2,439 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-03.