django-migration-psql

django-migration-psql is a skill for Claude Code from prowler-cloud/prowler. It costs 96 tokens per session (4,453 once invoked), scanned A, original, Apache-2.0.

A guide for creating and reviewing Django database migrations for PostgreSQL. A migration is a tracked change that updates database tables, fields, indexes, or rules.

In plain words
What is it for?
It helps developers add or change database tables, fields, indexes, constraints, and data backfills safely.
Why use it?
It helps prevent migrations from locking production tables, blocking reads and writes, or failing to create indexes correctly on partitioned tables. It also explains how to split large automatically generated migrations into safer changes.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit It helps developers add or change database tables, fields, indexes, constraints, and data backfills safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/prowler-cloud/prowler/django-migration-psql
About the project

Prowler is an open-source cloud security platform that checks cloud environments for security issues and compliance with standards such as CIS, NIST, and GDPR. Security teams use it to assess configurations, prioritize findings, produce reports, and guide remediation.

prowler-cloud/prowler · 14,765 stars · on GitHub · prowler.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add prowler-cloud/prowler --skill django-migration-psql
Clone the repo
git clone --depth 1 https://github.com/prowler-cloud/prowler

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for django-migration-psql

README.md
[![agentmods](https://agentmods.dev/badge/skills/prowler-cloud/prowler/django-migration-psql.svg)](https://agentmods.dev/skills/prowler-cloud/prowler/django-migration-psql)
Your own site
<a href="https://agentmods.dev/skills/prowler-cloud/prowler/django-migration-psql"><img src="https://agentmods.dev/badge/skills/prowler-cloud/prowler/django-migration-psql.svg" alt="Measured on agentmods" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,453 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00096 $0.04453
Opus 5 $0.00048 $0.02227
Sonnet 5 $0.00019 $0.00891
Haiku 4.5 $0.00010 $0.00445

Measured 7d ago against content hash c03d7a9a4eb9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

django-migration-psql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/django-migration-psql/SKILL.md · 455 lines

How it starts

The opening of the file, as written. The whole thing — 455 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When to use

  • Creating a new Django migration
  • Running makemigrations or pgmakemigrations
  • Reviewing a PR that adds or modifies migrations
  • Adding indexes, constraints, or models to the database

Why this matters

A bad migration can lock a production table for minutes, block all reads/writes, or silently skip index creation on partitioned tables.

Auto-generated migrations need splitting

makemigrations and pgmakemigrations bundle everything into one file: CreateModel, AddIndex, AddConstraint, sometimes across multiple tables. This is the default Django behavior and it violates every rule below.

After generating a migration, ALWAYS review it and split it:

  1. Read the generated file and identify every operation
  2. Group operations by concern:
    • CreateModel + AddConstraint for each new table → one migration per table
    • AddIndex per table → one migration per table
    • AddIndex on partitioned tables → two migrations (partition + parent)
    • AlterField, AddField, RemoveField for each table → one migration per table
  3. Rewrite the generated file into separate migration files with correct dependencies
  4. Delete the original auto-generated migration

When adding fields or indexes to an existing model, makemigrations may also bundle AddIndex for unrelated tables that had pending model changes. Always check for stowaways from other tables.

Rule 1: separate indexes from model creation

CreateModel + AddConstraint = same migration (structural). AddIndex = separate migration file (performance).

Django runs each migration inside a transaction (unless atomic = False). If an index operation fails, it rolls back everything, including the model creation. Splitting means a failed index doesn't prevent the table from existing. It also lets you --fake index migrations independently (see Rule 4).

Bad

# 0081_finding_group_daily_summary.py — DON'T DO THIS
class Migration(migrations.Migration):
    operations = [
        migrations.CreateModel(name="FindingGroupDailySummary", ...),
        migrations.AddIndex(model_name="findinggroupdailysummary", ...),  # separate this
        migrations.AddIndex(model_name="findinggroupdailysummary", ...),  # separate this
        migrations.AddConstraint(model_name="findinggroupdailysummary", ...),  # this is fine here
    ]

Read the full file on GitHub · 455 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 455 lines · 96 tokens per session scan A c03d7a9a4eb9

Subscribe to this mod's changes

django-migration-psql is a skill published in the GitHub repository prowler-cloud/prowler (14,765 stars, last pushed 2d ago), licensed Apache-2.0. It adds 96 tokens to every session and 4,453 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

database-rds-devops

Database-level data-plane diagnostics for Aurora MySQL and Aurora PostgreSQL. Executes predefined read-only health check queries via RDS Data API to analyze buffer pool, connections, locks, replication, storage, performance, and index efficiency. Requires the rds-aidba MCP server for database-internal access beyond…

aws/tools-for-devops-agent · 75 tokens

cis-aws-database-3.11

Ensure to Regularly Review Security Configuration.

CyberStrikeus/CyberStrike · 17 tokens

firebase-app-platform

Build and operate apps on Firebase using Auth, Firestore, Cloud Functions, and Hosting. Use when building mobile/web backends with managed services, real-time data sync, or serverless APIs.

BagelHole/DevOps-Security-Agent-Skills · 43 tokens

google-firebase-ninja

Master orchestrator for 18+ Firebase agent skills from official Google repositories. Use when working with Firebase, Firestore, Firebase Auth, Firebase Hosting, Cloud Functions, Firebase Extensions, or any Firebase backend task. Routes to the optimal specialized skill based on context. Triggers: Firebase, Firestore…

fabricioctelles/jump-skills · 98 tokens

crm-production-investigation-guidelines

Guidelines for investigating production incidents in the CRM application. Use when triaging any alert or incident involving the CRM REST API, SQS queues, Lambda functions, or Aurora DSQL database in this AWS account. Ensures thorough root cause analysis using AWS-native observability tools.

aws/tools-for-devops-agent · 62 tokens

convex-backend

Build reactive backends with Convex functions, schema validation, auth integration, and deployment workflows. Use when building real-time apps with type-safe server functions and automatic caching.

BagelHole/DevOps-Security-Agent-Skills · 39 tokens