Generate Migration
getsentry/sentry
Generate or review Django database migrations for Sentry. An agent skill from getsentry/sentry.
Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green.
$ npx skills add softspark/ai-toolkit --skill migration-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install softspark/ai-toolkit migration-patterns --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/softspark/ai-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/app/skills/migration-patterns .claude/skills/migration-patterns && 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 "migration-patterns" agent skill from https://github.com/softspark/ai-toolkit/tree/main/app/skills/migration-patterns into .claude/skills/migration-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "migration-patterns", 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/softspark/ai-toolkit/tree/main/app/skills/migration-patternsType 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 softspark/ai-toolkit --skill migration-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install softspark/ai-toolkit migration-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .agents/skills && cp -r skills-src/app/skills/migration-patterns .agents/skills/migration-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "migration-patterns" agent skill from https://github.com/softspark/ai-toolkit/tree/main/app/skills/migration-patterns into .agents/skills/migration-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "migration-patterns", 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 softspark/ai-toolkit --skill migration-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install softspark/ai-toolkit migration-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/app/skills/migration-patterns .cursor/skills/migration-patterns && 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 "migration-patterns" agent skill from https://github.com/softspark/ai-toolkit/tree/main/app/skills/migration-patterns into .cursor/skills/migration-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "migration-patterns", 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/softspark/ai-toolkit.git --path app/skills/migration-patterns--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 softspark/ai-toolkit --skill migration-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install softspark/ai-toolkit migration-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/app/skills/migration-patterns .gemini/skills/migration-patterns && 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 "migration-patterns" agent skill from https://github.com/softspark/ai-toolkit/tree/main/app/skills/migration-patterns into .gemini/skills/migration-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "migration-patterns", 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 softspark/ai-toolkit migration-patternsInstalls 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 softspark/ai-toolkit --skill migration-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .github/skills && cp -r skills-src/app/skills/migration-patterns .github/skills/migration-patterns && 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 "migration-patterns" agent skill from https://github.com/softspark/ai-toolkit/tree/main/app/skills/migration-patterns into .github/skills/migration-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "migration-patterns", 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 softspark/ai-toolkit --skill migration-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install softspark/ai-toolkit migration-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/softspark/ai-toolkit.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/app/skills/migration-patterns .opencode/skills/migration-patterns && 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 "migration-patterns" agent skill from https://github.com/softspark/ai-toolkit/tree/main/app/skills/migration-patterns into .opencode/skills/migration-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "migration-patterns", 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.
migration-patternsZero-downtime DB migrations: expand-contract, double-write, backfill, blue-green.
Migration Patterns is an agent skill from softspark/ai-toolkit. Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green. Triggers: migration, schema change, backfill, ALTER TABLE, online DDL.
Its SKILL.md is about 2.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, Deployment and Backend development. The repository describes itself as: Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Antigravity, Codex CLI… The licence is Apache-2.0.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit d64db2b. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
phpnpxpythongitkubectldockerFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npx, git, kubectl and docker, 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.
Migration Patterns loads about 2.2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 510 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 softspark/ai-toolkit at commit d64db2b, republished under its Apache-2.0 licence (© softspark). 510 words, ~2,158 tokens.
.claude/skills/migration-patterns/SKILL.md (or your agent's skills folder).# Initialize
alembic init migrations
# Create migration
alembic revision --autogenerate -m "add users table"
# Apply
alembic upgrade head
# Rollback
alembic downgrade -1# migrations/versions/001_add_users.py
def upgrade():
op.create_table(
"users",
sa.Column("id", sa.Integer, primary_key=True),
sa.Column("email", sa.String(255), unique=True, nullable=False),
sa.Column("created_at", sa.DateTime, server_default=sa.func.now()),
)
op.create_index("idx_users_email", "users", ["email"])
def downgrade():
op.drop_index("idx_users_email")
op.drop_table("users")# Create migration
npx prisma migrate dev --name add_users
# Apply in production
npx prisma migrate deploy
# Reset (dev only)
npx prisma migrate reset# Create migration
php artisan make:migration create_users_table
# Apply
php artisan migrate
# Rollback
php artisan migrate:rollback --step=1
# Dry run
php artisan migrate --pretend# Create migration from models
python manage.py makemigrations
# Apply
python manage.py migrate
# Rollback
python manage.py migrate app_name 0001
# Show plan
python manage.py showmigrationsflyway migrate
flyway info
flyway undo # Undo last migration (Teams edition)
flyway repair # Fix metadata tablePhase 1 (Expand): Add new column, keep old
ALTER TABLE users ADD COLUMN full_name VARCHAR(200);
Phase 2 (Migrate): Copy data
UPDATE users SET full_name = first_name || ' ' || last_name;
Phase 3 (Switch): Update code to use new column
Deploy new code that reads/writes full_name
Phase 4 (Contract): Remove old columns
ALTER TABLE users DROP COLUMN first_name;
ALTER TABLE users DROP COLUMN last_name;-- Safe: Add nullable column
ALTER TABLE users ADD COLUMN phone VARCHAR(20);
-- Safe: Add column with default (PostgreSQL 11+, instant)
ALTER TABLE users ADD COLUMN status VARCHAR(20) DEFAULT 'active';
-- Safe: Create index concurrently (no lock)
CREATE INDEX CONCURRENTLY idx_users_status ON users(status);
-- UNSAFE: Add NOT NULL without default (locks table)
-- Instead, do it in 3 steps:
ALTER TABLE users ADD COLUMN email VARCHAR(255);
UPDATE users SET email = 'unknown@example.com' WHERE email IS NULL;
ALTER TABLE users ALTER COLUMN email SET NOT NULL;Step 1: Add new column
Step 2: Write to both old and new columns (dual-write)
Step 3: Backfill new column from old
Step 4: Read from new column
Step 5: Stop writing to old column
Step 6: Drop old column (next release)BATCH_SIZE = 1000
def backfill_users():
last_id = 0
while True:
batch = db.execute(
"SELECT id, first_name, last_name FROM users "
"WHERE id > :last_id ORDER BY id LIMIT :limit",
{"last_id": last_id, "limit": BATCH_SIZE}
).fetchall()
if not batch:
break
for row in batch:
db.execute(
"UPDATE users SET full_name = :name WHERE id = :id",
{"name": f"{row.first_name} {row.last_name}", "id": row.id}
)
db.commit()
last_id = batch[-1].id
logger.info(f"Backfilled up to id={last_id}")GET /api/v1/users
GET /api/v2/usersGET /api/users
Accept: application/vnd.myapp.v2+json# FastAPI
from fastapi import APIRouter
v1_router = APIRouter(prefix="/api/v1")
v2_router = APIRouter(prefix="/api/v2")
@v1_router.get("/users")
def get_users_v1():
return [{"name": user.name} for user in users] # Old format
@v2_router.get("/users")
def get_users_v2():
return [{"full_name": user.name, "id": user.id} for user in users] # New format# Simple feature flag
import os
def is_feature_enabled(feature: str, user_id: str | None = None) -> bool:
flag = os.getenv(f"FF_{feature.upper()}", "false")
if flag == "true":
return True
if flag.endswith("%") and user_id:
percentage = int(flag[:-1])
return hash(user_id) % 100 < percentage
return False
# Usage
if is_feature_enabled("new_search", user_id=request.user.id):
return new_search(query)
else:
return old_search(query)# Always test rollback before deploying
alembic downgrade -1 # Alembic
npx prisma migrate resolve --rolled-back 20240101_migration # Prisma
php artisan migrate:rollback --step=1 # Laravel# Git-based rollback
git revert HEAD --no-edit
git push
# Container rollback
kubectl rollout undo deployment/api
docker service rollback apiALTER TABLE ... ADD COLUMN NOT NULL DEFAULT <value> in Postgres rewrites the whole table before version 11 (fast since 11 for non-volatile defaults). On older versions this locks the table for minutes. Add as NULL + default, backfill, then apply NOT NULL.CREATE INDEX CONCURRENTLY cannot run inside a transaction, which means many migration tools (Alembic default, Rails) need an override to use it. Check the tool's docs for non-transactional migrations./migrate/database-patterns/refactor-plan/ci-cd-patterns© softspark, 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 app/skills/migration-patterns of softspark/ai-toolkit.
Open the folder on GitHubat commit d64db2b
Migration Patterns 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 |
|---|---|---|---|---|---|---|
| Migration Patterns this skillsoftspark/ai-toolkit | 179 | — | ~2.2k | Automated safety check: Pass | Apache-2.0 | |
| Generate Migrationgetsentry/sentry | 46k | — | ~2.2k | Automated safety check: Pass | Custom licence | |
| Migration Risk AnalyzerMathews-Tom/armory | 328 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Lovableaiskillstore/marketplace | 430 | 1 repos | ~2.7k | Automated safety check: Notes | None | |
| Wtfnoobnooc/agent | 1.4k | — | ~2.1k | Automated safety check: Notes | None | |
| Database Migrationagulli/atlas-agents | 579 | — | ~702 | Automated safety check: Pass | MIT |
getsentry/sentry
Generate or review Django database migrations for Sentry. An agent skill from getsentry/sentry.
Mathews-Tom/armory
Analyzes database migration scripts for lock contention, downtime, rollback strategy, and deployment risk.
aiskillstore/marketplace
Integration skill for Lovable.dev projects. An agent skill from aiskillstore/marketplace.
noobnooc/agent
Pre-launch and pre-commit audit for vibe coding projects. An agent skill from noobnooc/agent.
agulli/atlas-agents
Safely run database schema migrations. An agent skill from agulli/atlas-agents.
openclaw/clawhub
Applies ClawHub's repository-specific Convex rules and routes work to the right managed Convex skill for performance, migrations, retention and deployments.
softspark/ai-toolkit
Prepare or verify a project QA environment with source identity, readiness, browser access, evidence paths and owned cleanup.
softspark/ai-toolkit
Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. An agent skill from softspark/ai-toolkit.
softspark/ai-toolkit
Analyzes code quality, complexity, patterns across codebase.
softspark/ai-toolkit
Drives a brief, specification, issue or existing PR through implementation, review, tests and QA to a ready PR.
softspark/ai-toolkit
Direct technical voice for docs, README, user-facing text. An agent skill from softspark/ai-toolkit.
softspark/ai-toolkit
Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI).
Categories
Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green. Migration Patterns is an agent skill from softspark/ai-toolkit. Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green.
Migration Patterns fits situations like: tasks that involve Database migrations; tasks that involve Deployment; tasks that involve Backend development.
Run `npx skills add softspark/ai-toolkit --skill migration-patterns -a claude-code`. Or copy the skill folder (app/skills/migration-patterns in softspark/ai-toolkit) into .claude/skills/migration-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add softspark/ai-toolkit --skill migration-patterns -a codex`. Or copy the skill folder (app/skills/migration-patterns in softspark/ai-toolkit) into .agents/skills/migration-patterns 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 softspark/ai-toolkit --skill migration-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/migration-patterns, .gemini/skills/migration-patterns, .github/skills/migration-patterns and .opencode/skills/migration-patterns in your project.
Going by SKILL.md and its folder, Migration Patterns needs the command-line tools its instructions call (php, npx, python, git, kubectl and docker). Our summary lists: Python 3; Node.js; Docker. Its frontmatter pre-approves these tools: Read.
SKILL.md contains no URLs. Its commands use npx, git and docker, which can reach the network depending on how they are called. 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.
Migration Patterns 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 2.2k tokens (SKILL.md is roughly 8.6k 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 Migration Patterns: Generate Migration (getsentry/sentry, 46k stars), Migration Risk Analyzer (Mathews-Tom/armory, 328 stars), Lovable (aiskillstore/marketplace, 430 stars) and Wtf (noobnooc/agent, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
softspark (a GitHub user) maintains it in softspark/ai-toolkit, which has 179 GitHub stars. The repository holds 112 skills in this directory. The repository was last updated on October 7, 2026.
Source: softspark/ai-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.