agentleFS
aradmanamnaoonaradmanamnaoon/vibe-coding-skills/skills/backend/migration-safety-reviewer/SKILL.md

migration-safety-reviewer

Skill0 starsChanged 20 days agoMITView on GitHub

Audit database migrations for destructive changes, locking, backfill, rollback, and mixed-version rollout safety. Use before applying schema/data migrations.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read applicable repository instructions before edits.

    line 20
  2. Distinctive:

    Use expand-migrate-contract when old and new application versions can overlap.

    line 35
  3. Distinctive:

    Test forward migration on representative data plus rollback where rollback is claimed.

    line 37
  4. Distinctive:

    Verify old/new application compatibility at the intended deployment boundary.

    line 38
  5. Distinctive:

    Document operations that require production-specific online/lock behavior verification.

    line 39
  6. Distinctive:

    Never apply destructive migrations to production or user data as part of an audit without explicit authorization.

    line 47
  7. Distinctive:

    No destructive operation is hidden inside a supposedly additive deploy.

    line 51
  8. Distinctive:

    If production data volume/engine behavior is unknown, flag locking/runtime risk instead of estimating it as safe.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purpose

Prevent data loss and unsafe one-step migrations.

When to activate

A migration changes persisted schema/data or a deploy requires coordinated DB/application versions.

When not to activate

The change only adds isolated development fixture data with no persistent production path.

Preconditions

  • Read applicable repository instructions before edits.
  • Preserve unrelated working-tree changes and establish a baseline when the workflow can modify code.
  • Identify which tools and environments are actually available; do not claim unavailable checks ran.

Required inputs

  • Migration files
  • Database engine/version
  • Deployment sequence
  • Data size/criticality assumptions

Workflow

  1. Classify every operation as additive, transformative, destructive, or potentially locking/long-running.
  2. Identify drops, renames, type narrowing, not-null changes, uniqueness, rewrites, backfills, and index creation that need staged rollout.
  3. Use expand-migrate-contract when old and new application versions can overlap.
  4. Define backup/recovery and rollback semantics; distinguish reversible schema from irreversible data transformation.
  5. Test forward migration on representative data plus rollback where rollback is claimed.
  6. Verify old/new application compatibility at the intended deployment boundary.
  7. Document operations that require production-specific online/lock behavior verification.

Relevant tools

Migration tool, isolated database/container, schema diff/query tools.

Safety restrictions

Never apply destructive migrations to production or user data as part of an audit without explicit authorization.

Validation

  • No destructive operation is hidden inside a supposedly additive deploy.
  • Claimed rollback is actually executable on test data.
  • Mixed-version assumptions are explicit and tested where relevant.

Expected output

  • Operation classification
  • Staged rollout plan
  • Forward/rollback evidence
  • Production-only risks

Failure handling

If production data volume/engine behavior is unknown, flag locking/runtime risk instead of estimating it as safe.

Completion criteria

The skill is complete only when every applicable validation item above has observed evidence or is explicitly marked not executed with the concrete blocker. Do not replace missing evidence with confidence language.

Research mapping

This skill was selected from research problems: P033. See research/vibe-coding-problems.md and research/problem-evidence.csv in the Vibe Coding Skills repository.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.