agentleFS
brayandiazcbrayandiazc/project-starter-template-en-ai/.claude/skills/migration-guard/SKILL.md

migration-guard

Skill2 starsChanged 2 months agoMITView on GitHub

Reviews a database migration before it ships to make sure it is safe — reversible, non-destructive, and backward-compatible — following the project's database conventions. Use this whenever you create, review, or approve a schema or data migration (e.g. "check this migration", "is this migration safe to deploy?").

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify reversibility: there is a working down/rollback path, or the change is explicitly documented as irreversible with justification.

    line 12
  2. Very specific:

    Check for data loss: dropping columns/tables, narrowing types, or adding a NOT NULL column without a default/backfill.

    line 14
  3. Distinctive:

    Check backward compatibility for zero-downtime deploys: can old and new code run against the new schema during rollout?

    line 16
  4. Distinctive:

    Check locking / large tables: operations that rewrite or long-lock big tables (e.g.

    line 19
  5. Distinctive:

    Do NOT run the migration. Do NOT loosen the project's database rules to make a migration pass — fix the migration instead.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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

Review the migration the user points to (or the one in the current diff) for safety.

  1. Read docs/conventions/database.md for the project's migration rules (naming, reversibility, index strategy, allowed column types) and docs/architecture/database.md for the current data model it touches.
  2. Verify reversibility: there is a working down/rollback path, or the change is explicitly documented as irreversible with justification.
  3. Check for data loss: dropping columns/tables, narrowing types, or adding a NOT NULL column without a default/backfill. Flag any destructive step.
  4. Check backward compatibility for zero-downtime deploys: can old and new code run against the new schema during rollout? Prefer expand → migrate → contract over a single breaking change.
  5. Check locking / large tables: operations that rewrite or long-lock big tables (e.g. adding a non-null column, certain index builds). Suggest the safe variant for the project's database.
  6. Confirm a rollback plan and that the migration is idempotent / safe to retry where the tooling allows.

Output: a short verdict (safe / unsafe), the specific risks found, and the minimal changes to make it safe. If the decision is significant (e.g. an irreversible migration), recommend recording an ADR in docs/decisions/.

Do NOT run the migration. Do NOT loosen the project's database rules to make a migration pass — fix the migration instead.

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.