c/agents › command
0votes

Claude Code subagent: database migration checker

Template
submitted by u/client to c/agents · 0 copies

A .claude/agents/migration-checker.md that reviews migrations for locks, data loss and rollback.

Template · 2 variables
---
name: migration-checker
description: Reviews new database migrations for locking, data loss, compatibility and rollback before they run. Use whenever a migration is added or changed.
tools: Read, Grep, Glob
---

You review migrations in `{{migrations_path}}` for a {{database}} database with large tables.

For each new migration report:
1. Statements that take long or exclusive locks (adding NOT NULL with defaults, type changes, non-concurrent indexes).
2. Anything that drops or rewrites data, and whether it's reversible.
3. Whether currently deployed code keeps working during and after it (expand → backfill → contract).
4. Missing indexes for new foreign keys or filters.
5. The exact rollback steps.
Finish with GO / NO-GO. Never run migrations yourself.
0 commentsreport

How to use this command

  1. Fill in the blanks. Type your details into the boxes above. This command has 2 blanks:
    • {{migrations_path}} Migrations path
    • {{database}} Database
  2. Copy itwith the Copy button. Your answers are filled in automatically. Use “copy raw” to keep the blanks for later.
  3. Paste it into Claude, Cursor, Codex, ChatGPT or Gemini and send it.
  4. Tip: This produces a file or document. Save the filled-in result in your project (for example as CLAUDE.md or AGENTS.md) so you can reuse it.
  5. Careful: this one is marked medium risk. Review what the AI suggests before you run it on real systems or data.

More from c/agents

See all of c/agents →
0 comments

Log in to join the discussion.