8 skills built for PostgreSQL
Claude Code skills for PostgreSQL
PostgreSQL skills that work from real query plans: schema design, indexing, zero-downtime migrations, locking, connection pooling, JSONB, backups and point-in-time recovery. The ORMs and platforms built on Postgres are covered as well.
Start with these
- Postgres Schema DesignTables where bad data simply cannot landClaude designs tables from the queries they must serve, then picks a precise type for every column: timestamptz over timestamp, integer cents over floats, identity or UUIDv7 keys. Rules go into NOT NULL, CHECK, UNIQUE and foreign keys with an explicit ON DELETE, foreign keys get indexes, and JSONB is reserved for genuinely variable data. Reviews end with a blocking/should-fix note.
- Postgres IndexingEvery index justified by a plan, every drop by dataClaude designs the narrowest index that serves a named query: equality columns before range columns, partial predicates for queue and soft-delete tables, INCLUDE columns for index-only scans, trigram GIN for ILIKE search. Builds run CONCURRENTLY with a lock timeout and an invalid-index check, and a diagnostic SQL catalog finds unused, duplicate and FK-missing indexes before any drop.
- Zero-Downtime MigrationsChange live tables without a maintenance windowClaude splits risky schema changes into expand, backfill and contract phases that each work with old and new code running side by side. Every ALTER runs with lock_timeout, constraints go in NOT VALID and get validated separately, backfills run as resumable batches outside the DDL, and drops wait for a later deploy and your sign-off. You get a phase-by-phase plan with locks and rollback per step.
5 more PostgreSQLskills
Each card opens the full playbook, example prompts and install commands.
Postgres Row-Level Security
Tenant isolation the database enforces and tests prove
Claude sets up RLS so it cannot be bypassed by accident: a runtime role without BYPASSRLS that does not own the tables, ENABLE plus FORCE on every tenant table, and tenant context passed per transaction with set_config so poolers never leak it. It closes the side doors through views, SECURITY DEFINER functions and foreign keys, and writes SQL tests that fail when one tenant can see another.
Testcontainers
Real databases in tests, started once and reset fast
Claude replaces database mocks and H2 stand-ins with the production engine in a container, started once per run rather than per test. It runs the real migrations, picks rollback, truncation, template databases or snapshots for isolation, gives each parallel worker its own database, and sets up GitHub Actions or GitLab Docker-in-Docker so the suite passes cold, shuffled and in parallel.
AWS RDS and Aurora
Right engine, tested failover, no surprise I/O bill
Guides Claude through running PostgreSQL and MySQL on AWS from measured load: choosing RDS, Aurora, or Serverless v2, sizing for the working set, testing failover, and keeping settings in custom parameter groups. It plans major upgrades as blue/green deployments with the logical-replication and PITR caveats, reduces RDS Proxy pinning, and runs a script that compares Aurora Standard and I/O-Optimized from your bill.
Connection Pooling
Pools sized to database cores, not request counts
Claude writes down every process that connects and sums its maximum connections against the database limit at full autoscale before touching a setting. Pools are sized from database parallelism, PgBouncer transaction mode is configured with its session-state caveats and prepared statement support, serverless platforms get a proxy, and exhaustion is diagnosed from pg_stat_activity and SHOW POOLS.
SQLAlchemy ORM
Typed models, owned sessions, loads you chose on purpose
Makes Claude write SQLAlchemy 2.x the way it is meant to be used: Mapped and mapped_column models with named constraints, one Session per request or task with short transactions, select() queries with deliberate selectinload or joinedload, and lazy="raise" to catch accidental lazy loads. It also reviews Alembic autogenerate output for the renames and enum changes it misses, and sets up rollback-per-test fixtures.
General skills with PostgreSQL guidance
Not built around PostgreSQL, but they include PostgreSQL-specific tools or steps. Not part of the install-all command.
Install
Every PostgreSQL skill in one command
Installs these 8 skills into ~/.claude/skills/. Add --project after -- to install into the current repository instead.
The installer is a 101-line POSIX shell script. It downloads each skill you name from claudeskills.page and unpacks it into your skills folder, nothing else: no sudo, no telemetry. Every skill page shows the full SKILL.md, so you can read what you install first. Read install.sh
curl -fsSL claudeskills.page/install.sh \| sh -s -- postgres-schema-designpostgres-indexingschema-migrationsrow-level-securitytestcontainersaws-rds-auroraconnection-poolingsqlalchemy-ormPostgreSQL skills FAQ
Answers drawn from the skills themselves, including what they don't cover.
Which Postgres versions do the skills target?
No single version is pinned. The skills flag version-gated features as they go: Postgres Schema Design notes uuidv7() ships in PostgreSQL 18, Postgres Indexing covers the PG18 B-tree skip scan, Backup and Restore covers PostgreSQL 17 incremental backups, and Postgres JSONB covers JSON_TABLE in PG17. Older caveats, such as PG11 and PG12 behavior, appear in Zero-Downtime Migrations.
Do they cover zero-downtime migrations?
Yes. Zero-Downtime Migrations splits changes into expand, migrate data and contract phases, sets lock_timeout on every DDL statement, uses CREATE INDEX CONCURRENTLY and NOT VALID then VALIDATE for constraints, and runs backfills in throttled batches outside the DDL transaction. It also orders code and schema deploys, writes a rollback or forward-fix plan, and holds destructive steps until you confirm.
Is there help for managed Postgres like RDS or Supabase?
Yes. AWS RDS and Aurora covers choosing RDS vs Aurora vs Serverless v2, parameter groups, RDS Proxy pinning, PITR, blue/green major upgrades and cost traps like Extended Support. Supabase Backend covers the Supabase CLI, migrations, Row Level Security on every exposed table and Edge Functions. Connection Pooling handles PgBouncer, RDS Proxy, Supavisor and Neon for serverless setups.
How do I install all 8 PostgreSQL skills at once?
Pass every name to the installer in one command: curl -fsSL https://claudeskills.page/install.sh | sh -s -- postgres-schema-design postgres-indexing schema-migrations row-level-security testcontainers aws-rds-aurora connection-pooling sqlalchemy-orm. Add --project after -- to install them into the current repository's .claude/skills/ folder so your team gets them too.