agentleFS
evolplusevolplus/talos/skills/migration-safety/SKILL.md

migration-safety

Skill9 starsChanged 6 months agoApache-2.0View on GitHub

Evaluate database, schema, data, queue, index, or storage migrations before deployment. Use when DevOps must verify migration ordering, dry-run results, backups, expand-contract strategy, lock/runtime impact, data-loss risk, rollback constraints, and operator approvals.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use frontend-data-fetching, git-workflow and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    frontend-data-fetching

    Fetch data in Sentry's frontend with TanStack Query and apiOptions. Use when adding or editing React code in static/ that calls the API — useQuery/useMutation/useInfiniteQuery, apiOptions, queryOptions/mutationOptions, fetchMutation, reading response headers/pagination, conditional fetching, or query keys and cache filters (invalidateQueries, setQueriesData, predicates). Trigger on "fetch data", "add an API call", "useQuery", "useMutation", "apiOptions", "queryFn", "queryKey", "invalidateQueries", "pagination headers", "X-Hits", or "why is my query type wrong".

    Also in 3 projects that use this

  • Microsoft AzureSkill

    git-workflow

    Squad branching model: dev-first workflow with insiders preview channel

    Also in 3 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 9

    Distinctive

    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:

    Use this skill whenever a deployment includes schema changes, data migrations, queue/topic changes, search index rebuilds, object-storage …

    line 14
  2. Distinctive:

    Check compatibility: Prefer expand-contract: deploy additive schema first, release compatible code, backfill safely, then remove old fields …

    line 24
  3. Distinctive:

    Run dry-run/preflight: Use local/staging with production-like schema where possible.

    line 27
  4. Distinctive:

    Coordinate app versioning: Verify old and new app versions tolerate the migration during rolling deploy and rollback.

    line 28
  5. Distinctive:

    Never run a migration against staging or production without an explicit target and approval.

    line 34
  6. Distinctive:

    Never approve destructive or irreversible migrations without backup/restore evidence and human sign-off.

    line 35
  7. Distinctive:

    Never assume rollback is possible after data deletion, type narrowing, irreversible transforms, or external side effects.

    line 36
  8. Distinctive:

    Never print database URLs, credentials, tokens, dumps, or row-level sensitive data.

    line 37
  9. Distinctive:

    Never couple schema removal with first code deployment unless architecture explicitly proves compatibility.

    line 38

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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

Migration Safety

When to use

Use this skill whenever a deployment includes schema changes, data migrations, queue/topic changes, search index rebuilds, object-storage rewrites, or irreversible data operations.

Inputs and outputs

  • Inputs: migration files, ORM migration plan, architecture data contracts, affected services, target environment, backup policy, expected data volume, and rollback plan.
  • Outputs: migration safety verdict, execution order, preflight/dry-run evidence, backup/restore notes, risk classification, and blockers.

Procedure

  1. Classify the migration. Label as additive, backfill, destructive, contract/removal, reindex, data rewrite, or operational maintenance. Destructive/irreversible work needs explicit approval.
  2. Check compatibility. Prefer expand-contract: deploy additive schema first, release compatible code, backfill safely, then remove old fields in a later release.
  3. Estimate runtime impact. Identify locks, table scans, long transactions, index builds, queue replays, and service downtime. Require batching or online migration tools when needed.
  4. Verify backup and restore. Record backup location/status by name only, restore procedure, owner, and latest restore-test evidence. Do not read backup credentials.
  5. Run dry-run/preflight. Use local/staging with production-like schema where possible. For production, use native dry-run/explain tooling or a reviewed plan before mutation.
  6. Coordinate app versioning. Verify old and new app versions tolerate the migration during rolling deploy and rollback.
  7. Define failure handling. Record pause/resume, retry, rollback, manual repair, and "stop-the-line" thresholds.
  8. Emit verdict. safe, safe-with-conditions, or blocked.

Hard rules

  • Never run a migration against staging or production without an explicit target and approval.
  • Never approve destructive or irreversible migrations without backup/restore evidence and human sign-off.
  • Never assume rollback is possible after data deletion, type narrowing, irreversible transforms, or external side effects.
  • Never print database URLs, credentials, tokens, dumps, or row-level sensitive data.
  • Never couple schema removal with first code deployment unless architecture explicitly proves compatibility.

References

  • ../rollback-readiness/SKILL.md - rollback constraints for migrations.
  • ../secrets-config-audit/SKILL.md - DB credential handling.
  • ../../agents/_templates/devops.md - DevOps role contract.

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.