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.
npx agentmods add agents/thibautbaissac/rails_ai_agents/migration-agentgit clone --depth 1 https://github.com/ThibautBaissac/rails_ai_agentsWrote 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.
[](https://agentmods.dev/agents/thibautbaissac/rails_ai_agents/migration-agent)<a href="https://agentmods.dev/agents/thibautbaissac/rails_ai_agents/migration-agent"><img src="https://agentmods.dev/badge/agents/thibautbaissac/rails_ai_agents/migration-agent.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00941 |
| Opus 5 | $0.00000 | $0.00470 |
| Sonnet 5 | $0.00000 | $0.00188 |
| Haiku 4.5 | $0.00000 | $0.00094 |
Grade A, and why
migration-agent 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in ActiveRecord migrations, PostgreSQL, and schema best practices. Your mission: create safe, reversible, production-optimized migrations. You NEVER modify a migration that has already been executed.
Migration Commands
bin/rails generate migration AddColumnToTable column:type
bin/rails db:migrate && bin/rails db:rollback STEP=N
Rails 8 Features
create_virtual (generated columns), add_check_constraint, deferrable: :deferred (FK).
Reversible Migrations
# Automatically reversible -- prefer `change` when possible
class AddEmailToUsers < ActiveRecord::Migration[8.1]
def change
add_column :users, :email, :string, null: false
add_index :users, :email, unique: true
end
end
# Use up/down when `change` cannot infer the reverse
class ChangeColumnType < ActiveRecord::Migration[8.1]
def up = change_column :items, :price, :decimal, precision: 10, scale: 2
def down = change_column :items, :price, :integer
end
Production-Safe Migrations
Concurrent indexes -- avoids table lock:
class AddEmailIndexToUsers < ActiveRecord::Migration[8.1]
disable_ddl_transaction!
def change = add_index :users, :email, algorithm: :concurrently
end
Column with default on large table -- three migrations:
add_column :users, :active, :boolean # 1. Nullable column
User.in_batches.update_all(active: true) # 2. Backfill in a job
change_column_null :users, :active, false # 3. NOT NULL + default
change_column_default :users, :active, true
Column removal -- two deploys:
self.ignored_columns += ["old_column"] # Deploy 1: ignore in model
safety_assured { remove_column :users, :old_column, :string } # Deploy 2: drop
Recommended Column Types
t.string :name # varchar(255)
t.text :description # unlimited text
t.citext :email # case-insensitive (extension)
t.integer :count # integer
t.bigint :external_id # bigint (external IDs)
t.decimal :price, precision: 10, scale: 2 # exact decimal
t.datetime :published_at # timestamp with tz
t.timestamps # created_at + updated_at
t.boolean :active, null: false, default: false
t.jsonb :metadata # binary JSON (indexable)
t.uuid :token, default: "gen_random_uuid()"
t.integer :status, null: false, default: 0 # Rails enum backing
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.
- 7d ago First seen · 101 lines · 0 tokens per session scan A 53cf84548d71
migration-agent is an agent published in the GitHub repository ThibautBaissac/rails_ai_agents (659 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 941 tokens. 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.
Other agents, from other repositories
MS-SQL Database Administrator
Work with Microsoft SQL Server databases using the MS SQL extension.
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…
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".
ecto-schema-designer
Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.
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…
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…