db-migrate
Skill1 starsChanged 6 months agoMITView on GitHub
Generate safe, reversible SQL migrations with proper up/down statements, transactional wrappers, and rollback safety checks. Supports Postgres, MySQL, SQLite.
18 other projects use a version of this.
Adopted by
Most recently taken up by
- suxrobGM/jobpilottheir own version, first seen Nov 7, 2026
- lablup/backend.aitheir own version, first seen Oct 8, 2026
- linuxfoundation/insightstheir own version, first seen Oct 8, 2026
- Ame-Al/ametheir own version, first seen Oct 8, 2026
- simstudioai/simtheir own version, first seen Oct 8, 2026
- mgiovani/cc-arsenaltheir own version, first seen Sep 25, 2026
Used with
Projects with it also use react-query-best-practices, you-might-not-need-a-callback and 8 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.
bibektimilsina00Skillreact-query-best-practices
Audit and fix React Query usage in apps/web — enforce query key factories, signal forwarding, staleTime, and proper mutation patterns. Use when reviewing or fixing server-state code.
Also in 3 projects that use this
bibektimilsina00Skillyou-might-not-need-a-callback
Analyze and fix useCallback anti-patterns in your code
Also in 3 projects that use this
MicrosoftSkillcleanup
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 7 projects that use this
VercelSkilldeploy
Deploy applications to Vercel. Use when the user says "deploy", "deploy to Vercel", "push to production", "deploy my app", or "go live".
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 3 projects that use this
- +3 more from bibektimilsina00
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- simstudioai/sim★ 30ksame name
- lablup/backend.ai★ 679same name
- linuxfoundation/insights★ 288same name
- alexeykrol/claude-code-starter★ 194same name
- suxrobGM/jobpilot★ 110same name
- getsentry/abacus★ 77same name
- lfrodrigues/packt-claude-code-course-auth★ 9same name
- mgiovani/cc-arsenal★ 8same name
- mean-weasel/bullhorn★ 4same name
- pgnzbl-ux/crucible★ 4same name
8 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 repository5 other files it gives its agents.
- api-mockSkill
- changelog-genSkill
- i18n-translateSkill
- license-checkSkill
- security-auditSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
6
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 22
Look for these markers (in order):
- Distinctive: line 27
If you can't tell, ask before writing.
- Distinctive: line 36
Use git log and the existing migrations dir to determine the convention.
- Distinctive: line 51
Document this in a comment block.
- Distinctive: line 55
Add new column, copy data
- Distinctive: line 56
Update code to use new column
- Very specific: line 64
Use ON DELETE strategy explicitly.
“Common” is measured: kept by at least 6 in 10 of the 13 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
DB Migrate Skill
You are generating a database migration. Migrations must be reversible, safe under concurrent writes, and idempotent where possible.
Step 1 — Detect the migration tool
Look for these markers (in order):
migrations/ordb/migrate/directory- Tool config files:
knexfile.*,alembic.ini,migrate.yaml,prisma/schema.prisma,supabase/migrations/ - ORM clues in
package.json,requirements.txt,go.mod
If you can't tell, ask before writing.
Step 2 — Compute the next filename
Standard formats:
YYYYMMDDHHmmss_<slug>.sql(Supabase, Knex)001_<slug>.sql(sequential)<n>_<slug>.{up,down}.sql(separate files)
Use git log and the existing migrations dir to determine the convention. Never break the existing pattern.
Step 3 — Write the migration
For each operation, follow these safety rules:
Adding a column
- ✅
ADD COLUMN ... NULL DEFAULT <value>— safe - ❌
ADD COLUMN ... NOT NULLwithout default — breaks on large tables - ✅ Two-step: add nullable → backfill in batches → add NOT NULL constraint
Removing a column
- 🚨 Two-deploy approach required:
- Deploy code that stops reading/writing the column
- Then drop it in a follow-up migration
- Document this in a comment block.
Renaming a column
- 🚨 Three-step approach:
- Add new column, copy data
- Update code to use new column
- Drop old column
Adding an index
- ✅
CREATE INDEX CONCURRENTLYon Postgres for tables > 1M rows - ❌ Regular
CREATE INDEXwill lock the table
Foreign keys
- Use
ON DELETEstrategy explicitly. Never default.
Step 4 — Provide rollback
For each up, write the inverse down. If the down would lose data, say so explicitly in a comment.
-- up
ALTER TABLE users ADD COLUMN email_verified BOOLEAN DEFAULT FALSE;
-- down
-- ⚠️ This is destructive — deleted rows can't be recovered.
ALTER TABLE users DROP COLUMN email_verified;Step 5 — Wrap in a transaction (where possible)
- Postgres/SQLite: wrap in
BEGIN; ... COMMIT; - MySQL: most DDL is implicit-commit; warn the user.
- Statements that cannot be in a transaction (e.g.,
CREATE INDEX CONCURRENTLY) go in their own migration file.
Step 6 — Hand off
Print:
- The file path created
- The exact command to apply (
npm run migrate,alembic upgrade head,supabase migration up) - The exact rollback command
When NOT to use
- Seeding test data (use a fixture skill instead)
- ORM-driven schema changes that are auto-generated (Prisma migrate, ActiveRecord)
- Stored procedure-only changes (use
stored-procskill if available)
Failure modes
- ⚠️ Backfills against tables > 10M rows should be done outside the migration in a chunked job. Suggest this when relevant.
- ⚠️ Always recommend running migrations on a staging copy first.
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.

