Skip to content
Agentmart
Submit a tool

migration-safety

Safety checklist for schema and data migrations.

Skill by diego81b

IndexedAGPL-3.0★ 2
Write a review

Chalk Labs

Need help deploying migration-safety?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/diego81b-migration-safety

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Safety checklist for schema and data migrations. Resolves expand/contract sequencing, lock duration, backfill restartability, reversibility, and what a code rollback does to data already written in the new shape — before the migration is designed and again before the rollback plan is written.

Use cases: documents, data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/migration-safety

What's inside

Skill name
migration-safety
Description
Safety checklist for schema and data migrations. Resolves expand/contract sequencing, lock duration, backfill restartability, reversibility, and what a code rollback does to data already written in the new shape — before the migration is designed and again before the rollback plan is written.
License
AGPL-3.0
Instructions
64 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: missing

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Migration Safety

Shared reference for `architect-agent` and `release-planner-agent`.

A migration is the one change that a code rollback cannot undo. Reverting a deploy restores the previous binary; it does not restore a dropped column, un-rewrite a backfilled row, or release a lock that already blocked production for four minutes. These questions are cheap while the data model is still on paper, and they are the difference between a rollback plan that works and one that reads well.

Invoked conditionally: when the design does not change the schema and writes no data migration, this costs nothing. Answer the applicable sections and record each resolution — `N/A — [reason]` included — so the deployment runbook can cite them rather than re-derive them.

---

## 1. Shape of the Change

- Is this change **additive** (new table, new nullable column, new index), **destructive** (drop, rename, narrow a type, add NOT NULL), or a **rewrite** (backfill, re-encode, re-partition)?
- A destructive change to a column the currently-deployed code still reads or writes is an outage, not a migration. Which currently-running code touches it?

## 2. Expand / Contract Sequencing

For anything not purely additive, the safe shape is three releases, not one:

- **Expand** — add the new structure alongside the old; new code writes both, reads the old.
- **Migrate** — backfill; flip reads to the new structure.
- **Contract** — stop writing the old; drop it, in a later release.

Questions to resolve:
- Which of the three does *this* change perform? Naming it prevents a contract step from riding along with an expand step.
- During the window when both old and new code are running (rolling deploy, canary, a straggler pod), is every combination safe — old code reading new-shaped data, new code reading not-yet-backfilled data?
- Can the contract step be deferred to a separate release, and is it tracked somewhere that it will actually happen?

## 3. Lock Duration and Table Size

- Roughly how many rows does the target table hold **in production**, not in development?
- Which statements in this migration take a lock that blocks reads or writes, and for how long at that row count? (Adding a NOT NULL column with a default, rewriting a type, and building an index without the concurrent variant are the usual offenders — the exact behaviour is engine- and version-specific, so state which engine you are assuming.)
- Is there a lock timeout and a retry, so a migration that cannot acquire its lock fails fast instead of queueing every query behind it?
- Does the deployment have a maintenance window, or must this run against live traffic?

## 4. Backfill

- Is the backfill **batched**, with a bounded batch size — or a single statement over the whole table?
- Is it **idempotent**: does re-running it over rows it already processed produce the same result?
- Is it **restartable**: if it dies at 60%, does the next run resume rather than start over?
- Does it write at a rate the replicas can follow, or will it build replication lag?
- Is the backfill part of the migration transaction, or a separate job? (Coupling a long backfill to the schema change usually means holding a lock for its whole duration.)

## 5. Reversibility

- Is there a `down` migration, and has it actually been run against a copy of production-shaped data — or does it merely exist?
- Is this change reversible **without data loss**? A dropped column is not; a renamed one is only if nothing wrote to it in between.
- If it is not reversible, say so explicitly in the runbook. A rollback plan that implies reversibility it doesn't have is worse than one that states the limit.

## 6. What a Code Rollback Does to New-Shaped Data

The question most often missed. After the migration ran and the application wrote records in the new shape:

- If the application is rolled back to the previous version, what does the old code do with those records — ignore them, crash, or silently corrupt them?
- Are records written during the window recoverable, or are they lost to the old code's view?
- Is the correct recovery "roll forward with a fix" rather than "roll back"? If so, the runbook should say that instead of listing a rollback that must not be used.

## 7. Ordering Against the Code Deploy

- Does the migration run **before** the code deploy, **after** it, or between two code deploys?
- Is that ordering enforced by the pipeline, or by whoever runs it remembering the right sequence?
- If the migration succeeds and the code deploy then fails, what state is the system in — and is that state serviceable?

From diego81b/kairos-agents-framework, AGPL-3.0.

More from diego81b/kairos-agents-framework

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Sep 14, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
AGPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from diego81b

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get migration-safety running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying migration-safety?

CallGet help
Cite this page

migration-safety skill. Agent Mart. https://agentmart.dev/skills/diego81b-migration-safety (last updated 2026-10-24)