Agent skill

Saleor Django Schema Migration

by saleor in saleor/saleor

Generates and splits Django schema migrations for Saleor with manage.py makemigrations, enforcing one new model or one field change per migration file.

BSD-3-ClauseAuto-check passedBackend & APIs

Install Saleor Django Schema Migration

skills CLI
$ npx skills add saleor/saleor --skill saleor-django-migration -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install saleor/saleor saleor-django-migration --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/saleor/saleor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/saleor-django-migration .claude/skills/saleor-django-migration && rm -rf skills-src

Use ~/.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/

Facts

Skill name
saleor-django-migration
GitHub stars
23k
Token cost
~1k tokens
SKILL.md length
453 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
BSD-3-Clause

At a glance

Generates and splits Django schema migrations for Saleor with manage.py makemigrations, enforcing one new model or one field change per migration file.

  • Works in 5 steps: Make model changes → Generate migration → Read and analyze the generated migration → …
  • Generating a Django migration after adding or changing a Saleor model
  • SKILL.md covers Scope, Critical Rules, Workflow and Error Handling, plus 1 more section
  • Calls python

What it does

The skill covers schema-only migrations such as CreateModel, AddField, AlterField, RemoveField and index or constraint operations, explicitly excluding data migrations with RunPython or RunSQL and async or background migrations; if a change needs data transformation, the agent stops and asks the user instead. Migration files must never be written by hand: the workflow edits the Django model files, activates the virtual environment, and runs python manage.py makemigrations, answering any interactive rename questions based on the actual model changes made.

After generation, every migration file is read and checked for schema-only operations and correct dependencies, then two separation rules apply: a migration that creates more than one new model must be split so each model is generated on its own, and a migration that alters more than one field on a single model must be split into one migration per field, in each case by deleting the combined migration and regenerating one change at a time. Exceptions that should not be split include a CreateModel with all its own fields, cross-model dependencies Django requires together such as a ForeignKey with its related model, and a field generated together with its own index or constraint.

When your agent uses it

  • Generating a Django migration after adding or changing a Saleor model
  • Splitting an auto-generated migration that creates multiple new models
  • Splitting a migration that alters more than one field on the same model

Example prompts

  • “I added a new field to the Order model. Generate and verify the migration.”
  • “This migration created three new models together. Split it into one migration per model.”
  • “Generate a migration for these two field changes on the Product model, one at a time.”

Requirements

  • A Saleor checkout with its Python virtual environment
  • A running database connection

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Make model changes
  2. Generate migration
  3. Read and analyze the generated migration
  4. Apply separation rules
  5. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 782a751. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Saleor Django Schema Migration loads about 1k tokens when it runs. Until then it costs about 117 tokens; SKILL.md has 453 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~1k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from saleor/saleor at commit 782a751, republished under its BSD-3-Clause licence (© saleor). 453 words, ~1,008 tokens.

Download SKILL.mdSave it as .claude/skills/saleor-django-migration/SKILL.md (or your agent's skills folder).
name
saleor-django-migration
description
Generate Django schema migrations for the Saleor codebase using manage.py makemigrations. Use when (1) a new Django model is created, (2) model fields are added/altered/removed, (3) user explicitly asks to create a migration. This skill covers ONLY synchronous schema migrations (CreateModel, AddField, AlterField, RemoveField, etc.) — NOT data migrations with RunPython or RunSQL. If unsure whether the migration is schema-only, ask the user.

Saleor Django Schema Migration

Scope

This skill handles schema-only migrations: CreateModel, AddField, AlterField, RemoveField, AddIndex, AddConstraint, etc. It does NOT cover:

  • Data migrations (RunPython, RunSQL with data changes)
  • Async/background migrations (celery tasks, post_migrate signals)

If the change requires data transformation, stop and ask the user.

Critical Rules

  1. NEVER write migration files by hand. Always let Django generate them.
  2. ALWAYS use ./manage.py makemigrations to generate migrations.
  3. Activate the virtual environment first — run . .venv/bin/activate before any manage.py command.
  4. If database connection fails, stop and ask the user to start the database.

Workflow

Step 1: Make model changes

Edit the Django model file(s) as needed. Do not touch any migration files.

Step 2: Generate migration
bash
. .venv/bin/activate && python manage.py makemigrations

If Django asks interactive questions (e.g. "Did you rename field X to Y?"), answer based on the model changes you made.

Step 3: Read and analyze the generated migration

Read every generated migration file. Verify:

  • It contains only schema operations (CreateModel, AddField, AlterField, RemoveField, AddIndex, etc.)
  • Dependencies look correct
  • No unexpected operations
Step 4: Apply separation rules

Apply these rules to the generated migration(s):

Rule A — One model per migration for new models: If the migration creates MORE THAN ONE new model (multiple CreateModel operations), split them. Generate each separately:

bash
python manage.py makemigrations <app>

If Django generates them together, delete the combined migration, then create models one at a time (add one model to models.py, run makemigrations, repeat).

Rule B — One field change per migration: If the migration alters MORE THAN ONE field within a single model (e.g. two AddField or two AlterField operations on the same model), split into separate migrations — one per field. Delete the combined migration, make one field change at a time, and run makemigrations after each.

Exceptions (do NOT split):

  • A CreateModel with all its fields is one operation — do not split the fields of a new model
  • Cross-model dependencies where Django requires them together (e.g. ForeignKey + related model creation)
  • Field + its index/constraint in the same migration is acceptable when auto-generated together
Show full SKILL.md (124 more words)Show less
Step 5: Verify

Run the check command to confirm no pending migrations remain:

bash
python manage.py makemigrations --check --dry-run

Expected output: No changes detected — meaning all model changes are captured in migrations.

Error Handling

ErrorAction
django.db.utils.OperationalError: could not connectAsk user to start the database
Conflicting migrations detectedStop and let user decide
ModuleNotFoundErrorVirtual environment not activated — run . .venv/bin/activate

Tips

  • Rely on autogenerated migrations for correct timestamps, sequential numbers, dependencies, and field definitions. If you must hand-edit (e.g. to split), regenerate rather than edit — delete the migration, adjust models.py, and re-run makemigrations.
  • When splitting, let Django figure out dependencies between the new smaller migrations.
  • Check the newest existing migration in the app (ls saleor/<app>/migrations/ | tail -5) before generating, so you can confirm the new migration number is sequential.

© saleor, BSD-3-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/saleor-django-migration of saleor/saleor.

Open the folder on GitHubat commit 782a751

Compare with similar skills

Saleor Django Schema Migration 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.

Saleor Django Schema Migration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Saleor Django Schema Migration this skillsaleor/saleor23k—~1kAutomated safety check: PassBSD-3-Clause
Generate Migrationgetsentry/sentry46k—~2.2kAutomated safety check: PassCustom licence
DB Migratorlaolaoshiren/claude-code-skills-zh880—~677Automated safety check: PassMIT
Database Migrationagulli/atlas-agents579—~702Automated safety check: PassMIT
Database Migrationsaffaan-m/ECC277k4 repos~3kAutomated safety check: PassMIT
Database Migrationsaffaan-m/ECC277k3 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Generate Migration

    getsentry/sentry

    Official

    Generate or review Django database migrations for Sentry. An agent skill from getsentry/sentry.

    46k GitHub stars~2.2k tokensUpdated yesterday
    DatabasesAuto-check passed
  • DB Migrator

    laolaoshiren/claude-code-skills-zh

    数据库迁移助手 - Schema 对比、迁移脚本生成

    880 GitHub stars~677 tokensUpdated 6 days ago
    DatabasesAuto-check passed
  • Database Migration

    agulli/atlas-agents

    Safely run database schema migrations. An agent skill from agulli/atlas-agents.

    579 GitHub stars~702 tokensUpdated 2 mo ago
    DatabasesAuto-check passed
  • Safe, reversible database migration patterns: forward-only production changes, expand-contract zero-downtime renames, concurrent indexes, batched backfills, and per-tool workflows for PostgreSQL…

    277k GitHub starsUsed in 4 repos~3k tokens
    DatabasesAuto-check passed
  • 数据库迁移最佳实践,涵盖模式变更、数据迁移、回滚以及零停机部署,适用于PostgreSQL、MySQL及常用ORM(Prisma、Drizzle、Django、TypeORM、golang-migrate)。

    277k GitHub starsUsed in 3 repos~1.9k tokens
    DatabasesAuto-check passed
  • Şema değişiklikleri, veri migration'ları, rollback'ler ve PostgreSQL, MySQL ve yaygın ORM'ler (Prisma, Drizzle, Django, TypeORM, golang-migrate) arasında sıfır kesinti deployment'ları için…

    277k GitHub starsUsed in 1 repo~2.4k tokens
    DatabasesAuto-check passed

More from saleor/saleor

All 8 skills in this repo
  • Benchmarks Django ORM filters in Saleor by generating bulk data, extracting the SQL and running EXPLAIN ANALYZE to check index usage.

    23k GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Commits changes in the Saleor codebase and works through pre-commit hook failures from ruff, mypy, the GraphQL schema check and the migrations check.

    23k GitHub stars~575 tokensUpdated yesterday
    Auto-check passed
  • Rules for writing Django migrations in Saleor that avoid long table locks and stay compatible with zero-downtime rolling deploys.

    23k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Pytest Runner

    saleor/saleor

    Run pytest tests with automatic virtual environment activation. Use this skill whenever running tests, executing pytest, or when asked to "run tests", "test…

    23k GitHub stars~251 tokensUpdated yesterday
    Auto-check passed
  • Saleor Port Changes

    saleor/saleor

    Forward-ports or backports a single PR or branch onto the currently checked-out Saleor branch, handling GraphQL version markers and migration numbering along the way.

    23k GitHub stars~969 tokensUpdated yesterday
    Auto-check passed
  • Checklist for adding, changing, deprecating or removing Saleor GraphQL fields, mutations, enums and webhook event types so the change passes review first time.

    23k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Saleor Django Schema Migration

What does Saleor Django Schema Migration do?

Generates and splits Django schema migrations for Saleor with manage.py makemigrations, enforcing one new model or one field change per migration file. The skill covers schema-only migrations such as CreateModel, AddField, AlterField, RemoveField and index or constraint operations, explicitly excluding data migrations with RunPython or RunSQL and async or background migrations; if a change needs data transformation, the agent stops and asks the user instead.py makemigrations, answering any interactive rename questions based on the actual model changes made.

When should I use Saleor Django Schema Migration?

Saleor Django Schema Migration fits situations like: generating a Django migration after adding or changing a Saleor model; splitting an auto-generated migration that creates multiple new models; splitting a migration that alters more than one field on the same model.

How do I install Saleor Django Schema Migration in Claude Code?

Run `npx skills add saleor/saleor --skill saleor-django-migration -a claude-code`. Or copy the skill folder (.claude/skills/saleor-django-migration in saleor/saleor) into .claude/skills/saleor-django-migration in your project. Claude Code loads it when a task matches its description.

How do I install Saleor Django Schema Migration in Codex?

Run `npx skills add saleor/saleor --skill saleor-django-migration -a codex`. Or copy the skill folder (.claude/skills/saleor-django-migration in saleor/saleor) into .agents/skills/saleor-django-migration in your project. Codex loads it when a task matches its description.

Can I use Saleor Django Schema Migration in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add saleor/saleor --skill saleor-django-migration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/saleor-django-migration, .gemini/skills/saleor-django-migration, .github/skills/saleor-django-migration and .opencode/skills/saleor-django-migration in your project.

What does Saleor Django Schema Migration need to run?

Going by SKILL.md and its folder, Saleor Django Schema Migration needs the command-line tools its instructions call (python). Our summary lists: A Saleor checkout with its Python virtual environment; A running database connection.

Does Saleor Django Schema Migration access the network?

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.

Is Saleor Django Schema Migration safe to install?

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.

What licence does Saleor Django Schema Migration use?

Saleor Django Schema Migration is published under the BSD-3-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Saleor Django Schema Migration use?

About 1k tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Saleor Django Schema Migration?

Skills that share tags, products or a category with Saleor Django Schema Migration: Generate Migration (getsentry/sentry, 46k stars), DB Migrator (laolaoshiren/claude-code-skills-zh, 880 stars), Database Migration (agulli/atlas-agents, 579 stars) and Database Migrations (affaan-m/ECC, 277k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Saleor Django Schema Migration?

saleor (a GitHub organization) maintains it in saleor/saleor, which has 23,428 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 9, 2026.

Source: saleor/saleor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.