Skip to main content
Don’t want to set this up manually? Paste a link to this page into a Devin session and ask it to set everything up for you.
1

Create the migration checklist skill

A repository skill is a markdown file you commit to .agents/skills/<your-skill>/ in any of your repos. Devin sees all skills across all connected repositories — you can trigger them manually or Devin can choose to trigger them automatically when it detects a relevant situation. This skill tells Devin exactly how to review database migrations before opening or updating a PR — catching the mistakes that code review usually misses.Commit .agents/skills/migration-checklist/migration-checklist.md to your repository:
Once this file is committed, Devin sees it as an available skill. Whenever a session touches migration files in this repo, Devin can trigger the checklist automatically — or you can invoke it manually at any point.
2

See the skill trigger on a real migration

When Devin works on a task that adds or modifies a migration file, it reads the diff, matches the migration checklist skill, and follows the checklist before opening the PR. Here’s what that looks like in practice:
  1. Scans the diff — Devin sees a new file in db/migrate/ and activates the migration checklist skill
  2. Flags a destructive operation — The migration removes a legacy_email column. Devin adds a PR comment:
    remove_column :users, :legacy_email is a destructive operation. Verified: migration includes a data backup step copying values to user_archives before removal.
  3. Adds a missing index — The migration adds account_id to the invoices table but has no index. Devin appends add_index :invoices, :account_id to the migration file
  4. Runs rollback — Devin executes bin/rails db:migrate:rollback STEP=1 against the test database. It passes
  5. Regenerates the schema — Devin runs bin/rails db:schema:dump, detects a diff in db/schema.rb, and includes the updated file in the commit
  6. Runs model tests — All model tests pass. Devin opens the PR with a summary of each check
The PR description includes a checklist showing what passed and what Devin fixed, so reviewers can focus on the business logic instead of the migration mechanics.
3

Adapt the skill for your ORM and stack

The checklist above targets Rails, but the same structure works for any ORM. Ask Devin to rewrite the skill for your stack:
4

Extend the checklist over time

Every migration incident reveals a gap the checklist didn’t cover. After each one, add a rule — it’s a one-line commit to the skill file.Here are common additions teams make after real incidents:
Because the skill file lives in your repo, these rules go through code review — your entire team agrees on what gets checked, and it’s always in sync with your migration tooling.