db-migration
Skill7 starsChanged 7 months agoMITView on GitHub
Generates database migration files for schema changes with up/down migrations, safety checks, rollback instructions, and index recommendations. Auto-detects the ORM/migration tool in use.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- ricci-labs/twisetheir own version, first seen Nov 8, 2026
- aniketshukla1/sdlc-kittheir own version, first seen Nov 8, 2026
- globalmpc/backendskillstheir own version, first seen Nov 8, 2026
- F3-Nation/f3-nationtheir own version, first seen Nov 2, 2026
- andidev30/the-artifacttheir own version, first seen Oct 20, 2026
- lepresk/groundworktheir own version, first seen Oct 15, 2026
Used with
Projects with it also use api-endpoint, git-workflow and 4 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.
tadoEngSkillapi-endpoint
Add or change a backend API endpoint on this product, keeping Pydantic as the single contract authority and regenerating the TypeScript client. Use when asked to add an endpoint, expose data to the frontend, change a request or response shape, or wire a new backend capability into a page.
Also in 4 projects that use this
Microsoft AzureSkillgit-workflow
Squad branching model: dev-first workflow with insiders preview channel
Also in 3 projects that use this
Microsoft AzureSkilldesign
Design rules and conventions for the API Center Portal. Use when editing detail pages, card components, badges, layout, navigation, sidebars, or headers. Covers badge styling, metadata placement, page navigation patterns, and layout alignment.
Also in 3 projects that use this
VercelSkillagent-browser
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
Also in 3 projects that use this
MicrosoftSkillrelease
Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).
Also in 3 projects that use this
- +1 more from Azure
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- dipu-bd/lightnovel-crawler★ 2.6ksame name
- lncrawl/lightnovel-crawler★ 2.6ksame name
- openmeterio/openmeter★ 2.4ksame name
- F3-Nation/f3-nation★ 210same name
- hiromaily/go-crypto-wallet★ 128same name
- nrjdalal/zerostarter★ 65same name
- xin-lai/CodeSpirit★ 56same name
- globalmpc/backendskills★ 44same name
- NicholasFlemmer/styx-app★ 31same name
- nikandr-surkov/ai-saas-starter★ 16same name
14 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 repository45 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- a11y-auditSkill
- api-designSkill
- architecture-reviewSkill
- business-blueprintSkill
- business-logic-auditSkill
- changelogSkill
- ci-pipelineSkill
- code-coverageSkill
- competitive-analysisSkill
- convert-codeSkill
- create-componentSkill
- debugSkill
- dependency-auditSkill
- deploy-checklistSkill
- design-flowSkill
- docker-setupSkill
- env-setupSkill
- error-monitorSkill
- estimateSkill
- explain-codeSkill
- fix-issueSkill
- generate-docsSkill
- git-cleanupSkill
- grill-meSkill
- handoffSkill
- legal-pagesSkill
- memory-importSkill
- memorySkill
- microcopySkill
- migrate-frameworkSkill
- onboardSkill
- optimizeSkill
- pr-summarySkill
- refactorSkill
- reference-appSkill
- review-prSkill
- security-scanSkill
- seo-scaffoldSkill
- tddSkill
- web-launch-checkSkill
- wireframeSkill
- write-skillSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
9
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
- Distinctive: line 26
Check current schema state
- Very specific: line 45
Update schema.prisma first, then generate.
- Distinctive: line 63
Create migration file manually following existing patterns.
- Distinctive: line 66
Create SQL files with up/down sections.
- Distinctive: line 75
Default values for new NOT NULL columns
- Distinctive: line 94
Run on staging first
- Distinctive: line 103
Always generate both UP and DOWN migrations
- Distinctive: line 104
Never drop columns without explicit user confirmation
- Distinctive: line 105
Always add indexes for foreign keys
- Distinctive: line 106
Test migrations against a copy of production data when possible
“Common” is measured: kept by at least 6 in 10 of the 21 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 Migration Helper
Detect Migration Tool
!ls prisma/ migrations/ alembic/ alembic.ini db/migrate/ knexfile.* flyway.conf sequelize* typeorm* drizzle.config.* 2>/dev/null
!ls package.json 2>/dev/null && cat package.json 2>/dev/null | grep -E "prisma|knex|sequelize|typeorm|drizzle|kysely|mikro-orm" | head -5
!ls requirements.txt pyproject.toml 2>/dev/null && cat requirements.txt pyproject.toml 2>/dev/null | grep -iE "alembic|django|sqlalchemy|tortoise" 2>/dev/null | head -5
!ls go.mod 2>/dev/null && cat go.mod 2>/dev/null | grep -E "goose|migrate|atlas|ent" | head -5
Existing Migrations
!find . -path "*/migrations/*" -o -path "*/migrate/*" -o -path "*/prisma/migrations/*" -o -path "*/db/migrate/*" 2>/dev/null | grep -v node_modules | tail -10
Migration Process
Step 1: Understand the Change
- Parse the requested schema change
- Identify affected tables/collections
- Check current schema state
- Determine if this is: CREATE, ALTER, DROP, or INDEX
Step 2: Safety Analysis
Data Loss Risk Assessment:
- Dropping a column/table → HIGH RISK — requires data backup
- Renaming a column → MEDIUM RISK — two-step migration recommended
- Adding NOT NULL without default → HIGH RISK — will fail on existing rows
- Changing column type → MEDIUM RISK — potential data truncation
- Adding column with default → LOW RISK — safe
- Adding index → LOW RISK — may lock table on large datasets
Step 3: Generate Migration
For Prisma (Node.js)
npx prisma migrate dev --name <description>Update schema.prisma first, then generate.
For Alembic (Python/SQLAlchemy)
alembic revision --autogenerate -m "<description>"For Django
python manage.py makemigrations --name <description>For Rails ActiveRecord
rails generate migration <Description>For Knex/Sequelize
Create migration file manually following existing patterns.
For Go (goose/migrate)
Create SQL files with up/down sections.
For Raw SQL
Generate separate UP and DOWN files.
Step 4: Migration Content
UP migration must include:
- Table/column creation or modification
- Default values for new NOT NULL columns
- Indexes for columns used in WHERE, JOIN, ORDER BY
- Foreign key constraints where appropriate
- Comments explaining the change
DOWN migration must include:
- Exact reversal of the UP migration
- Data preservation strategy if dropping columns
- Warning comments for irreversible operations
Step 5: Index Recommendations
For the affected tables, recommend indexes based on:
- New foreign key columns (always index)
- Columns used in WHERE clauses
- Columns used in ORDER BY
- Columns used in JOIN conditions
- Composite indexes for multi-column queries
Step 6: Deployment Notes
- Run on staging first
- Estimated duration for large tables
- Lock implications (table locks, row locks)
- Recommended maintenance window (if needed)
- Rollback command
Rules
- Always generate both UP and DOWN migrations
- Never drop columns without explicit user confirmation
- Always add indexes for foreign keys
- Test migrations against a copy of production data when possible
- Include data migration logic if restructuring data
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
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.

