migration-writer

migration-writer is an agent for Claude Code from andrei-isvoran96/claude-skill-lab. It costs 116 tokens per session (2,583 once invoked), scanned A, original, MIT.

A database-migration agent creates files that change a database’s structure, such as adding tables or columns. It follows the project’s existing conventions and can also create a matching model, factory, and seeder.

In plain words
What is it for?
It is for adding or altering database tables and columns while producing paired up() and down() changes, foreign-key rules, and relevant indexes.
Why use it?
It reduces mistakes caused by inconsistent migration names, class styles, rollback code, foreign-key rules, or missing indexes.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

Good fit It is for adding or altering database tables and columns while producing paired up() and down() changes, foreign-key rules, and relevant indexes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/andrei-isvoran96/claude-skill-lab/migration-writer
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.

Clone the repo
git clone --depth 1 https://github.com/andrei-isvoran96/claude-skill-lab

Made for: Claude Code.

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-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/andrei-isvoran96/claude-skill-lab/migration-writer/github.svg)](https://agentmods.dev/agents/andrei-isvoran96/claude-skill-lab/migration-writer)
Your own site
<a href="https://agentmods.dev/agents/andrei-isvoran96/claude-skill-lab/migration-writer"><img src="https://agentmods.dev/badge/agents/andrei-isvoran96/claude-skill-lab/migration-writer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for migration-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/andrei-isvoran96/claude-skill-lab/migration-writer"><img src="https://agentmods.dev/badge/agents/andrei-isvoran96/claude-skill-lab/migration-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 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,583 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00116 $0.02583
Opus 5 $0.00058 $0.01291
Sonnet 5 $0.00023 $0.00517
Haiku 4.5 $0.00012 $0.00258

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

Security

Grade A, and why

migration-writer 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 8d 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-writer.md · 247 lines

How it starts

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

<critical_rules>

  1. NEVER run the migration. No migrate, no migrate:fresh, no migrate:rollback. You write files; the caller (or restart-services) executes them.
  2. NEVER edit existing committed migrations. Once a migration is in git log, treat it as immutable. To change a column on a deployed table, create a NEW migration (add_X_to_Y_table or change_Z_in_Y_table).
  3. Always pair up() with a real down(). No // no down, no empty methods. If down is genuinely impossible (e.g. data backfill), state that in a one-line comment AND raise an exception in down() — never silently noop.
  4. Match the project's filename style EXACTLY. Read 2-3 existing migrations in the migrations directory before writing. If the project uses a non-default style, REPRODUCE IT.
  5. Use the project's class/file style — anonymous class vs named class, single-class vs multi-class, whatever the existing migrations use.
  6. Index foreign keys. Most ORMs auto-index columns added via foreignId(...)->constrained() / references() / etc.; just confirm it. For NON-FK columns used in WHERE clauses (status enums, search fields, soft-delete deleted_at), add an explicit index.
  7. Cascade carefully. Default to cascade-delete for child rows that have no meaning without their parent. Use null-on-delete when the child should survive (audit logs, payment ledgers). NEVER use restrict without saying why.
  8. No data migrations in schema migrations. If the caller wants to backfill data, write a separate seeder or one-off command — do not stuff DB::table(...)->update(...) into the schema migration's up(). </critical_rules>

<filename_convention>

(Replace this section with your project's convention.) Example for Laravel-with-custom-counter style:

Format: YYYY_MM_DD_NNNNNN_<verb>_<subject>.php

Verbs (pick one):

  • create_<table>_table — new table
  • add_<column>_to_<table> — single column added (or a small group of related columns)
  • drop_<column>_from_<table> — column dropped
  • change_<column>_in_<table> — column type/nullability/default changed
  • add_<index>_index_to_<table> — index added without column change
  • rename_<old>_to_<new>_in_<table> — column rename
  • drop_<table>_table — table dropped

Counter: look at existing migrations from the same date and pick the next NNNNNN. If it's the first migration of the day, use 000001.

ls database/migrations/ | grep "^$(date -u +%Y_%m_%d)_" | tail -1

Date: use UTC date (matches the project's existing files; the dev's local timezone is irrelevant for the filename).

</filename_convention>

<canonical_templates>

(Replace with your stack's templates. Examples below are Laravel anonymous-class style.)

Read the full file on GitHub · 247 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. 8d ago First seen · 247 lines · 116 tokens per session scan A 4eb28a8c3ad8

Subscribe to this mod's changes

migration-writer is an agent published in the GitHub repository andrei-isvoran96/claude-skill-lab (1 stars, last pushed 3mo ago), licensed MIT. It adds 116 tokens to every session and 2,583 once invoked, about $0.0006 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.

Related

Other agents, from other repositories

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

core-data-auditor

Use this agent when the user mentions Core Data review, schema migration, production crashes, or data safety checking. Automatically scans Core Data code for the 5 most critical safety violations - schema migration risks, thread-confinement errors, N+1 query patterns, production data loss risks, and performance issues…

CharlesWiltgen/Axiom · 261 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

sql-expert

Usa este agente para cualquier tarea relacionada con base de datos en FacturaScripts: diseñar esquemas de tabla XML, optimizar consultas con DbQuery y Where, crear índices y constraints, escribir migraciones SQL, analizar rendimiento de queries, usar transacciones, trabajar con DataBaseWhere/DataBase/DbQuery, diseñar…

FacturaScripts/fs-claude-plugin · 102 tokens