database-migrations
Skill0 starsChanged 2 months agoMITView on GitHub
Plan, implement, review, and verify database schema or data migrations with engine-aware locking, compatibility, backfill, rollback, and deployment sequencing. Use for migration files and persistent schema/data changes; do not use for ordinary application queries without a migration.
52 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
- profdorly/ultimate-dev-skillstheir own version, first seen Nov 8, 2026
- ahmadvahidi/skill-atlastheir own version, first seen Nov 8, 2026
- LeanMeanCleanApps/CleanModelContextProtocoltheir own version, first seen Nov 8, 2026
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use deployment-patterns, postgres-patterns and 6 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.
royaluniondesign-sysSkilldeployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
Also in 6 projects that use this
nek1987Skillpostgres-patterns
PostgreSQL patterns for reviewing migrations and writing efficient queries. Use when reviewing Alembic migrations, optimizing queries, or debugging database issues.
Also in 7 projects that use this
nek1987Skillredis-patterns
Upstash Redis patterns for caching and rate limiting.
Also in 3 projects that use this
seikaikyoSkillfastapi-patterns
FastAPI + SQLModel + Neon PostgreSQL 後端開發最佳實踐。適用於 Render 部署的 API 服務。涵蓋路由設計、資料庫操作、錯誤處理、認證授權。
Also in 3 projects that use this
MicrosoftSkillpython-testing
Write and run Python tests for the VoxelPic library. USE FOR: adding new pytest test cases, understanding the Python API and test patterns, debugging Python test failures, or running the existing Python test suite.
Also in 5 projects that use this
junimnjwSkillagent-harness-construction
Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.
Also in 3 projects that use this
Other versions52 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 52
- loulanyue/awesome-claude-notes★ 272same name
- langchain-ai/skills-benchmarks★ 116same name
- Fmarzochi/EGC★ 61same name
- skateddu/claude-code-python-setup★ 28same name
- wpank/ai★ 11same name
- gongyijie85/dsh-ecc★ 8same name
- reddygopalkrishna/developer-agent-skills★ 8same name
- zero-click/zero-ratchet★ 8same name
- sponge-b0b/Polaris★ 4same name
- chadixearth/graphyloop★ 3same name
42 more not listed
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 repository21 other files it gives its agents.
- global/AGENTS.mdAGENTS.md
- api-designSkill
- backend-patternsSkill
- brandSkill
- contract-firstSkill
- engineering-task-workflowSkill
- error-handlingSkill
- fixing-accessibilitySkill
- frontend-designSkill
- frontend-ui-engineeringSkill
- intent-driven-developmentSkill
- react-native-patternsSkill
- react-patternsSkill
- react-testingSkill
- security-best-practicesSkill
- shadcnSkill
- supabase-postgres-best-practicesSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- ui-ux-pro-maxSkill
- verification-before-completionSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 48 edited versions we read keep these.
12
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
- Distinctive: line 11
Treat a migration as a versioned compatibility change across database state, application versions, data volume, and deployment order.
- Distinctive: line 30
Use a single migration only when the change is demonstrably compatible and bounded.
- Distinctive: line 32
Expand: add compatible schema without removing the old contract.
- Distinctive: line 35
Contract: remove obsolete schema only after usage and rollback windows permit it.
- Distinctive: line 51
Never edit a migration known to be applied in a shared environment unless the project explicitly uses a safe reconciliation procedure.
- Distinctive: line 55
Follow the repository's naming and ordering.
- Distinctive: line 56
Keep the migration focused and deterministic.
- Distinctive: line 57
Avoid hidden network calls, production credentials, or environment-dependent data.
- Distinctive: line 58
Add guards only when supported and consistent with migration history.
- Distinctive: line 59
Update application code in the sequence required for compatibility.
- Distinctive: line 60
Document an irreversible step and its recovery path.
- Distinctive: line 69
Staging/production: only with explicit authorization and operational controls.
“Common” is measured: kept by at least 6 in 10 of the 48 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
Database Migrations
Treat a migration as a versioned compatibility change across database state, application versions, data volume, and deployment order.
Discover before designing
Identify:
- database engine and version;
- ORM or migration tool and its pinned version;
- repository migration conventions and applied-history rules;
- table size, write pattern, constraints, indexes, triggers, and dependent code when known;
- whether the target is a local/disposable database, staging, or production;
- rollout and rollback capabilities.
Consult current engine/tool documentation when lock, DDL, transaction, or online-index behavior matters. Do not generalize PostgreSQL syntax or guarantees to other databases.
For PostgreSQL, also use the selected PostgreSQL skill for SQL, RLS, indexing, concurrency, and constraint details.
Choose a safe lifecycle
Use a single migration only when the change is demonstrably compatible and bounded. Use expand/contract when old and new application versions may overlap:
- Expand: add compatible schema without removing the old contract.
- Migrate: backfill in bounded, restartable batches where volume requires it; validate progress and consistency.
- Switch: deploy code that reads the new representation and stops depending on the old one.
- Contract: remove obsolete schema only after usage and rollback windows permit it.
Separate schema and data operations when doing so reduces locks, transaction duration, rollback risk, or operational ambiguity. It is a decision based on the actual engine and tool, not an absolute formatting rule.
Safety questions
- What application versions can run before, during, and after the migration?
- Can the operation lock or rewrite a large table?
- Is a default computed per row or metadata-only in this engine/version?
- Can index or constraint validation be staged?
- Is the backfill idempotent, observable, bounded, and resumable?
- What happens to concurrent writes?
- How is partial failure detected and resumed?
- Is rollback safe, or is roll-forward the correct recovery strategy?
- Are destructive steps delayed until data is no longer needed?
Never edit a migration known to be applied in a shared environment unless the project explicitly uses a safe reconciliation procedure.
Implementation
- Follow the repository's naming and ordering.
- Keep the migration focused and deterministic.
- Avoid hidden network calls, production credentials, or environment-dependent data.
- Add guards only when supported and consistent with migration history.
- Update application code in the sequence required for compatibility.
- Document an irreversible step and its recovery path.
Verification levels
Report exactly which level was achieved:
- Static: syntax, formatting, schema diff, generated SQL, or migration graph inspected.
- Disposable database: apply from the correct prior state, inspect schema/data, run affected tests, and exercise rollback or roll-forward where meaningful.
- Representative-volume test: evaluate locks, duration, batching, and disk/replication impact with representative data.
- Staging/production: only with explicit authorization and operational controls.
Static validation alone does not prove a migration applies successfully. A local empty database does not prove production-scale safety.
Approval boundaries
Preparing migration files and testing in an authorized disposable database are ordinary implementation work. Applying a destructive/breaking migration, changing production data, or using production credentials requires explicit approval immediately before the operation.
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.

