DB Migrations
kurealnum/dotfiles
A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…
Author or review a Drizzle DB migration for zero-downtime safety — expand/contract phasing, backward-compatibility with the deployed app version, and writing the -- migration-safe acknowledgment the…
$ npx skills add simstudioai/sim --skill db-migrate -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install simstudioai/sim db-migrate --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/simstudioai/sim.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/db-migrate .claude/skills/db-migrate && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "db-migrate" agent skill from https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrate into .claude/skills/db-migrate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "db-migrate", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrateType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add simstudioai/sim --skill db-migrate -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install simstudioai/sim db-migrate --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/simstudioai/sim.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/db-migrate .agents/skills/db-migrate && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "db-migrate" agent skill from https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrate into .agents/skills/db-migrate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "db-migrate", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add simstudioai/sim --skill db-migrate -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install simstudioai/sim db-migrate --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/simstudioai/sim.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/db-migrate .cursor/skills/db-migrate && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "db-migrate" agent skill from https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrate into .cursor/skills/db-migrate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "db-migrate", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/simstudioai/sim.git --path .agents/skills/db-migrate--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add simstudioai/sim --skill db-migrate -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install simstudioai/sim db-migrate --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/simstudioai/sim.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/db-migrate .gemini/skills/db-migrate && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "db-migrate" agent skill from https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrate into .gemini/skills/db-migrate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "db-migrate", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install simstudioai/sim db-migrateInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add simstudioai/sim --skill db-migrate -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/simstudioai/sim.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/db-migrate .github/skills/db-migrate && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "db-migrate" agent skill from https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrate into .github/skills/db-migrate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "db-migrate", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add simstudioai/sim --skill db-migrate -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install simstudioai/sim db-migrate --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/simstudioai/sim.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/db-migrate .opencode/skills/db-migrate && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "db-migrate" agent skill from https://github.com/simstudioai/sim/tree/main/.agents/skills/db-migrate into .opencode/skills/db-migrate/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "db-migrate", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
db-migrateAuthor or review a Drizzle DB migration for zero-downtime safety — expand/contract phasing, backward-compatibility with the deployed app version, and writing the -- migration-safe acknowledgment the…
DB Migrate is an agent skill from simstudioai/sim. Author or review a Drizzle DB migration for zero-downtime safety — expand/contract phasing, backward-compatibility with the deployed app version, and writing the -- migration-safe acknowledgment the check:migrations lint requires. Use when adding/editing files under packages/db/migrations/ or changing packages/db/schema.ts.
Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Database migrations, Linting and formatting and ORMs and data access. The repository describes itself as: Sim is the collaborative workspace to build, deploy, and monitor AI agents and workflows. Used by 100,000+ builders. The licence is Apache-2.0.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 546d4e7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
bunbunxFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use bunx, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
DB Migrate loads about 2k tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 1,066 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from simstudioai/sim at commit 546d4e7, republished under its Apache-2.0 licence (© simstudioai). 1,066 words, ~2,031 tokens.
.claude/skills/db-migrate/SKILL.md (or your agent's skills folder).You make schema changes that survive a deploy without downtime. The check:migrations lint (scripts/check-migrations-safety.ts) is the deterministic gate; you are the judgment that decides whether a flagged change is actually safe and writes the annotation that satisfies it.
A deploy runs the migration, then rolls out the new app image via blue/green. The two are not atomic and cannot be — during cutover the old task set keeps serving against the already-migrated schema. So:
Every migration must be backward-compatible with the app version that is already deployed.
If a migration drops a column the old code still reads, renames one, or adds a NOT NULL the old inserts don't populate, the old code throws until traffic fully shifts — the downtime we're guarding against. You can't fix this by reordering the pipeline; the only fix is discipline.
Split every breaking change across two deploys:
Never put expand and contract in the same PR. If this PR both removes the code that used a column and drops the column, the old code is still live during cutover — split it.
| You want to | Do (deploy 1 = expand) | Do (deploy 2 = contract) |
|---|---|---|
| Add a required column | ADD COLUMN nullable or DEFAULT; code writes it | backfill, then SET NOT NULL |
| Rename a column/table | add the new name; code dual-writes / reads new-then-old | drop the old name |
| Drop a column/table | stop all reads/writes in code; ship it | DROP (annotate) |
| Change a column type | add a new column of the new type; dual-write | backfill, swap reads, drop old |
| Add FK / CHECK | ADD CONSTRAINT ... NOT VALID | VALIDATE CONSTRAINT separately |
| Index an existing table | COMMIT; breakpoint → SET lock_timeout = 0 → CREATE INDEX CONCURRENTLY IF NOT EXISTS (see packages/db/scripts/migrate.ts) | — |
| Drop an index | COMMIT; breakpoint → DROP INDEX CONCURRENTLY IF EXISTS — plain DROP INDEX takes ACCESS EXCLUSIVE on the table | — |
| Backfill data | batched + idempotent UPDATE (keyset/WHERE, bounded) | — |
A CREATE INDEX, ADD COLUMN, or ADD CONSTRAINT against a table created in the same migration is always safe (no rows, no live traffic) — the lint already suppresses those.
The contract half is deferred to a later deploy — and that is exactly when it gets forgotten, leaving dead columns, orphaned tables, and NOT NULLs that never land. Every deferred contract must become a durable, greppable TODO.
When an expand defers a drop, leave a contract-pending marker on the legacy column/table in packages/db/schema.ts — that is the file you will be editing when you finally do the drop, so the reminder lives where the work happens:
// contract-pending(after #5035 is fully deployed): drop once permission-check.ts stops reading it
workspaceId: text('workspace_id'),Format: contract-pending(<precondition>): <what to drop> — <why it's safe once the precondition holds>. The precondition names the PR/release that removes the last reader and must be fully deployed before the contract ships.
grep -rn "contract-pending" packages/db apps/sim. Run it when starting migration work to see what is owed.@deprecated and make every read of that table name its columns: no argless select().from(t), findFirst() without columns, argless .returning(), or bare getTableColumns(t) — use omit(getTableColumns(t), [...]). check:pending-drop-tables enforces this.-- migration-safe: annotation references the expand, and you delete the contract-pending marker in the same PR:-- migration-safe: contract of #5035 — workspace_id readers removed there, deployed 2026-06-10
ALTER TABLE "permission_group" DROP COLUMN "workspace_id";The lint flags risky shapes; it cannot know whether a given drop is safe right now. For each flagged statement, do the work it can't:
apps/sim and packages for the column name, the Drizzle field (camelCase), and the table object. If any live read/write remains, it is not safe — fix the code first.UPDATE/DELETE is batched (bounded WHERE/keyset, not a single whole-table statement), idempotent (safe to replay — a failed migration re-runs unjournaled files from the top), and safe under concurrent writes from the still-live old app.packages/db/schema.ts, then cd packages/db && bunx drizzle-kit generate to produce the SQL. If this is an expand that defers a drop, leave a contract-pending marker on the legacy column (see "Tracking the contract"). If this is the contract, delete the marker it resolves.CONCURRENTLY + COMMIT; breakpoint for indexes on existing tables, NOT VALID for constraints, batching for backfills.bun run check:migrations (base defaults to origin/staging).add-not-null-no-default, rename, index-not-concurrent, concurrent-index-not-idempotent, concurrent-index-no-commit, drop-index-not-concurrent, concurrent-drop-index-not-idempotent, concurrent-drop-index-no-commit, constraint-not-valid, …): rewrite into expand/contract. Do not try to annotate them away — the lint won't accept it.drop-table, drop-column, drop-constraint, drop-default, set-not-null, alter-type): only after you've confirmed steps 1–3 above, add a comment on the line directly above the statement:-- migration-safe: `secret` read removed in v0.6.1 (#1234), shipped two deploys ago
ALTER TABLE "webhook" DROP COLUMN "secret";data-backfill): non-blocking, but confirm the batching/idempotency before merging.bun run scripts/generate-schema-mock.ts (check:schema-mock in check:audits fails after any schema.ts change until you do).(cd packages/db && bunx drizzle-kit generate) once your migration is written: it must report no schema changes and write no new file, or CI fails on the schema and migrations disagreeing.cd packages/db && bun run db:migrate against a dev DB.Never annotate a destructive statement just to make the lint pass. The annotation is a claim that you verified the old code no longer depends on it. If you can't make that claim truthfully, the change belongs in a later deploy — tell the user to split it.
© simstudioai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/db-migrate of simstudioai/sim.
Open the folder on GitHubat commit 546d4e7
DB Migrate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| DB Migrate this skillsimstudioai/sim | 30k | — | ~2k | Automated safety check: Pass | Apache-2.0 | |
| DB Migrationskurealnum/dotfiles | 290 | — | ~820 | Automated safety check: Pass | None | |
| Change Database Schemamartin-ueding/geo-activity-playground | 100 | — | ~225 | Automated safety check: Pass | Custom licence | |
| Drizzlekurealnum/dotfiles | 290 | — | ~1.3k | Automated safety check: Pass | None | |
| Migrationkortix-ai/suna | 20k | — | ~1.2k | Automated safety check: Pass | Custom licence | |
| Specx Sqlalchemy Migrationsmaksimzayats/specx | 202 | — | ~822 | Automated safety check: Pass | MIT |
kurealnum/dotfiles
A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…
martin-ueding/geo-activity-playground
How to change the SQLAlchemy data model and generate the matching Alembic migration.
kurealnum/dotfiles
Drizzle ORM schema and database guide. An agent skill from kurealnum/dotfiles.
kortix-ai/suna
How to change the database schema in this repo. An agent skill from kortix-ai/suna.
maksimzayats/specx
Add or repair Alembic migrations for specx SQLAlchemy services.
kid-sid/claude-spellbook
A skill your agent uses when using async SQLAlchemy 2.0 — defining models, writing queries, managing async sessions, loading relationships without N+1, or setting up and debugging Alembic migrations.
simstudioai/sim
Install, upgrade, and operate the Sim Helm chart on Kubernetes.
simstudioai/sim
Add a new table column type to Sim — registry entry, icon, storage shape, coercion, and the behavioral hooks the grid and API read.
simstudioai/sim
Add a code-defined table enrichment (registry entry) under apps/sim/enrichments/ backed by an ordered provider cascade, ensuring every provider tool it calls has hosted-key support.
simstudioai/sim
Add hosted API key support to a tool so Sim provides the key (metered and billed to the workspace) when a user has not brought their own.
simstudioai/sim
Add or upgrade a curated, immutable managed CLI for Sim Function sandboxes, including client-safe catalog metadata, a pinned server-only installation recipe, checksum and executable verification…
simstudioai/sim
Add or update a Sim dynamic selector using the shared manifest, server attachment, and selectors.execute path.
Categories
Author or review a Drizzle DB migration for zero-downtime safety — expand/contract phasing, backward-compatibility with the deployed app version, and writing the -- migration-safe acknowledgment the…. DB Migrate is an agent skill from simstudioai/sim. Author or review a Drizzle DB migration for zero-downtime safety — expand/contract phasing, backward-compatibility with the deployed app version, and writing the -- migration-safe acknowledgment the check:migrations lint requires.
DB Migrate fits situations like: adding/editing files under packages/db/migrations/; changing packages/db/schema.ts.
Run `npx skills add simstudioai/sim --skill db-migrate -a claude-code`. Or copy the skill folder (.agents/skills/db-migrate in simstudioai/sim) into .claude/skills/db-migrate in your project. Claude Code loads it when a task matches its description.
Run `npx skills add simstudioai/sim --skill db-migrate -a codex`. Or copy the skill folder (.agents/skills/db-migrate in simstudioai/sim) into .agents/skills/db-migrate in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add simstudioai/sim --skill db-migrate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/db-migrate, .gemini/skills/db-migrate, .github/skills/db-migrate and .opencode/skills/db-migrate in your project.
Going by SKILL.md and its folder, DB Migrate needs the command-line tools its instructions call (bun and bunx).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
DB Migrate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with DB Migrate: DB Migrations (kurealnum/dotfiles, 290 stars), Change Database Schema (martin-ueding/geo-activity-playground, 100 stars), Drizzle (kurealnum/dotfiles, 290 stars) and Migration (kortix-ai/suna, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
simstudioai (a GitHub organization) maintains it in simstudioai/sim, which has 29,792 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 8, 2026.
Source: simstudioai/sim on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.