db-migration

db-migration is a skill for Claude Code, Codex from viknesh20-20/claude-code-tool-kit. It costs 39 tokens per session (889 once invoked), scanned A, original, MIT.

A database migration helper that creates files describing changes to a database’s structure, such as adding tables, columns, or indexes. It detects which database migration tool the project uses.

In plain words
What is it for?
Use it to prepare schema-change files, review risks from creating, altering, or dropping database objects, and get rollback instructions and index suggestions.
Why use it?
It reduces the risk of changing a live database incorrectly by checking for possible data loss and documenting how to undo the change.

Skill for Claude CodeCodex

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 skills/viknesh20-20/claude-code-tool-kit/db-migration
Any agent
npx skills add viknesh20-20/claude-code-tool-kit --skill db-migration
Clone the repo
git clone --depth 1 https://github.com/viknesh20-20/claude-code-tool-kit

Made for: Claude Code, Codex.

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/skills/viknesh20-20/claude-code-tool-kit/db-migration.svg)](https://agentmods.dev/skills/viknesh20-20/claude-code-tool-kit/db-migration)
Your own site
<a href="https://agentmods.dev/skills/viknesh20-20/claude-code-tool-kit/db-migration"><img src="https://agentmods.dev/badge/skills/viknesh20-20/claude-code-tool-kit/db-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 889 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.00039 $0.00889
Opus 5 $0.00019 $0.00445
Sonnet 5 $0.00008 $0.00178
Haiku 4.5 $0.00004 $0.00089

Measured 4d ago against content hash 2b4f562ecf64, 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.

.claude/skills/db-migration/SKILL.md · 108 lines

How it starts

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

Database Migration Helper

Detect Migration Tool

!ls prisma/ migrations/ alembic/ alembic.ini db/migrate/ knexfile.* flyway.conf sequelize* typeorm* drizzle.config.* 2>/dev/null !ls package.json 2>/dev/null && cat package.json 2>/dev/null | grep -E "prisma|knex|sequelize|typeorm|drizzle|kysely|mikro-orm" | head -5 !ls requirements.txt pyproject.toml 2>/dev/null && cat requirements.txt pyproject.toml 2>/dev/null | grep -iE "alembic|django|sqlalchemy|tortoise" 2>/dev/null | head -5 !ls go.mod 2>/dev/null && cat go.mod 2>/dev/null | grep -E "goose|migrate|atlas|ent" | head -5

Existing Migrations

!find . -path "*/migrations/*" -o -path "*/migrate/*" -o -path "*/prisma/migrations/*" -o -path "*/db/migrate/*" 2>/dev/null | grep -v node_modules | tail -10


Migration Process

Step 1: Understand the Change

  1. Parse the requested schema change
  2. Identify affected tables/collections
  3. Check current schema state
  4. Determine if this is: CREATE, ALTER, DROP, or INDEX

Step 2: Safety Analysis

Data Loss Risk Assessment:

  • Dropping a column/table → HIGH RISK — requires data backup
  • Renaming a column → MEDIUM RISK — two-step migration recommended
  • Adding NOT NULL without default → HIGH RISK — will fail on existing rows
  • Changing column type → MEDIUM RISK — potential data truncation
  • Adding column with default → LOW RISK — safe
  • Adding index → LOW RISK — may lock table on large datasets

Step 3: Generate Migration

For Prisma (Node.js)
npx prisma migrate dev --name <description>

Update schema.prisma first, then generate.

For Alembic (Python/SQLAlchemy)
alembic revision --autogenerate -m "<description>"
For Django
python manage.py makemigrations --name <description>
For Rails ActiveRecord
rails generate migration <Description>
For Knex/Sequelize

Create migration file manually following existing patterns.

For Go (goose/migrate)

Create SQL files with up/down sections.

Read the full file on GitHub · 108 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 · 108 lines · 39 tokens per session scan A 2b4f562ecf64

Subscribe to this mod's changes

db-migration is a skill published in the GitHub repository viknesh20-20/claude-code-tool-kit (7 stars, last pushed 4mo ago), licensed MIT. It adds 39 tokens to every session and 889 once invoked, about $0.0002 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-31.