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.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- suxrobGM/jobpilottheir own version, first seen Oct 3, 2026
- mgiovani/cc-arsenaltheir own version, first seen Sep 25, 2026
- pgnzbl-ux/crucibletheir own version, first seen Aug 27, 2026
- hiromps/claude-skillstheir own version, first seen Aug 4, 2026
- lfrodrigues/packt-claude-code-course-auththeir own version, first seen Jul 15, 2026
- Pradnyeshp/Claude-Skillstheir own version, first seen Jul 6, 2026
Used with
Projects with it also use e2e, ship and 1 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.
SentrySkille2e
Run E2E tests for Sentry JavaScript SDK test applications
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 5 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 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- alexeykrol/claude-code-starter★ 194same name
- suxrobGM/jobpilot★ 81same 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
- amajorai/skills★ 3same name
- vndee/engineering-skills★ 3same name
- Pradnyeshp/Claude-Skills★ 2same name
2 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 9 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 9 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.

