data-migration
Skill1 starsChanged 2 months agoMITView on GitHub
Migrate a live database safely — additive schema changes first, backfill in batches with no long locks, expand/contract for anything that isn't purely additive, reversible, and decoupled from the code deploy. Postgres / Prisma / Mongo. Use when asked to "add a column / table / index", "write a migration", "change the schema", "backfill X", or "move this data".
9 other projects use a version of this.
Adopted by
Most recently taken up by
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Nov 4, 2026
- RBraga01/a-teamtheir own version, first seen Nov 1, 2026
- philtzjp/skillstheir own version, first seen Oct 28, 2026
- muon-m2/magento2-toolstheir own version, first seen Oct 13, 2026
- shaheershoaib/data-migrationtheir own version, first seen Sep 5, 2026
- Abdox-menara/guard-skillstheir own version, first seen Aug 24, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- korchard333/claude-power-platform-community★ 46same name
- RBraga01/a-team★ 24same name
- muon-m2/magento2-tools★ 6same name
- Cure-Consulting-Group/ProductEngineeringSkills★ 3same name
- philtzjp/skills★ 2same name
- Abdox-menara/guard-skills★ 0same name
- geoffsdesk/portage★ 0same name
- Jinbae10/skills★ 0same name
- shaheershoaib/data-migration★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bigquery-analyticsSkill
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- redis-patternsSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-eventSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- debug-with-tracesSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- rebase-cleanSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- kafkaSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Commit feat(db): <change> or chore(db): ….
“Common” is measured: kept by at least 6 in 10 of the 7 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.
Files
Data migration
Pairs with deployment/code-migration — the schema moves first and
additively, the code cutover comes after.
The rule: a migration must be safe to run while the old code is still serving traffic, and the new code must be safe to run against the old schema. Deploy and migrate are separate steps.
Expand / contract for anything not purely additive
| Change | Safe sequence |
| Add nullable column | one step — add it |
| Add non-null column | add nullable → backfill → set default / not-null in a later migration |
| Rename column | add new → dual-write in code → backfill → switch reads → drop old (later) — see quality/wide-rename |
| Change column type | add new column of new type → backfill → switch → drop |
| Drop column | stop writing (deploy) → drop (next migration), once nothing reads it |
| Add index | CREATE INDEX CONCURRENTLY (Postgres) — never a plain CREATE INDEX on a big table, it locks writes |
| Add NOT NULL / CHECK / FK | add as NOT VALID → VALIDATE CONSTRAINT separately (Postgres) |
Backfill
- In batches with a bounded loop (
WHERE id BETWEEN … LIMIT n), commit per batch, sleep between. Never oneUPDATEover millions of rows — it locks and bloats the WAL. - Idempotent and resumable — safe to re-run after a failure mid-way.
- A separate script/job, not inside the DDL migration.
Rules
- Reversible — write the
down, or explicitly note "irreversible, forward-fix only" and why. - No
@Transaction/ long transaction across a paginated loop — it pins a pool connection and holds locks (a real flag in the review corpus). - Test on a prod-sized copy for timing if the table is large.
- Mongo — same spirit: additive fields are free; a field rename or type change
needs dual-read in code + a batched backfill;
MONGO_AUTO_INDEX=falsein prod so index builds are deliberate. - Commit
feat(db): <change>orchore(db): …; keep the migration and any code that depends on it in a sequence the deploy can follow.
Anti-patterns
- ❌ Add-non-null-with-default in one step on a large table (rewrites every row).
- ❌ Plain
CREATE INDEXon a hot table. - ❌ One unbounded
UPDATEbackfill. - ❌ Dropping a column in the same deploy that stops writing it.
- ❌ No
downand no note saying why.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

