django-safe-migration — Claude Code skill for Django migrations
django-safe-migration is a Claude Code skill that reviews and rewrites Django migrations for PostgreSQL with deployment locks in mind, before schema changes or releases.
no license 822 installs ★ 176 updated 2026-07-23
npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a claude-codeWhat django-safe-migration does
The skill helps assess Django migrations for PostgreSQL and rewrite risky operations. During a review, it calls for inspecting the SQL produced by Django and judging it against a rolling deployment. A lock can hold up queries to a table and cause more requests to queue behind it.
The described techniques include AddIndexConcurrently, adding a foreign key with NOT VALID before checking existing rows with VALIDATE CONSTRAINT, and separating database changes from Django’s recorded state. Operations that need an ACCESS EXCLUSIVE lock should use lock_timeout. The skill also asks the agent to read project instructions; Django’s version matters when considering db_default.
What it helps with
- review a migration before a rolling deploy
- rewrite a schema change with PostgreSQL locks in mind
- add a foreign key and validate existing rows later
- inspect the SQL Django will run
Example prompts for the agent
- Review this Django migration for PostgreSQL before a rolling deploy.
- Rewrite this foreign-key change so existing rows are checked in a separate step.
- Show the SQL for this migration and assess its table-lock risk.
How to install django-safe-migration
1Skills CLI (Vercel)
npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a claude-code2Manually: put the files in place
~/.claude/skills/django-safe-migration/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/django-safe-migration/
1Skills CLI (Vercel)
npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a codex2Manually: put the files in place
.agents/skills/django-safe-migration/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a cursor2Manually: put the files in place
.cursor/skills/django-safe-migration/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install vintasoftware/django-ai-plugins skills/django-safe-migration2Manually: put the files in place
.github/skills/django-safe-migration/SKILL.md1Skills CLI (Vercel)
npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a gemini-cli2Platform CLI
gemini skills install https://github.com/vintasoftware/django-ai-plugins --path skills/django-safe-migrationManually: put the files in place
.devin/skills/django-safe-migration/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about django-safe-migration
How do I install django-safe-migration in Claude Code?
Run npx skills add vintasoftware/django-ai-plugins --skill django-safe-migration -a claude-code. The skill file is placed at ~/.claude/skills/django-safe-migration/SKILL.md.
What does django-safe-migration do?
It helps write, review, and rewrite Django migrations for PostgreSQL, taking database locks and deployment safety into account.
How does the skill handle foreign-key constraints?
It describes creating a constraint with NOT VALID and validating existing rows afterward with VALIDATE CONSTRAINT. This separates constraint creation from the scan.