/postgres:postgresfrom postgres
Diagnoses and changes PostgreSQL by measurement: EXPLAIN and pg_stat_statements, index choice, statistics, locks, vacuum, isolation retries, online DDL, partitioning, RLS cost, Postgres types and table design, and pgvector. Use for slow queries, lock stalls, bloat, Postgres-specific schema choices, or vector search.
Ships in postgres. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Not for portable schema modeling or migration staging (db-schema-design), MySQL and MariaDB (mysql), or caches and queues on Redis (redis), each if installed.
Make a measured PostgreSQL change or investigation. Establish the workload and failure mode before changing SQL, config, indexes, layout, or maintenance. Prefer the smallest reversible change that improves an observed outcome.
For portable tables, keys, constraints, relationships, and migration staging, use db-schema-design. Never assume Postgres is deployed, what version it runs, or that an extension, replica, superuser, or production access exists. Verify each fact on the target. Behavior and syntax vary by major version, so check the Postgres docs for that version through Context7.
SELECT version()), the topology (managed or self-hosted, replicas, pooler), the owner, the maintenance window, the privileges you have, data sensitivity, the rollback path, and whether the target is production.pg_cancel_backend/pg_terminate_backend, or load-generating probes against production or any other shared database (anything that isn't localhost, a container you started, or a disposable copy) without explicit authorization and a recovery plan.pg_stat_statements if installed, pg_stat_activity, pg_stat_user_tables, pg_stat_user_indexes, and pg_locks. Record the collection time, since stats can be cached or lagging.EXPLAIN. Compare estimated rows, access paths, joins, sorts, and aggregates with the real parameters. EXPLAIN (ANALYZE, BUFFERS) executes the statement, so use it only when that is safe and representative. For writes, run it only inside BEGIN … ROLLBACK on a disposable database. Read references/explain.md for how to read plan nodes, the pg_stat_statements and stats-view queries, and common query pitfalls.wait_event_type/wait_event, transaction age, blockers (pg_blocking_pids()), and lock modes before acting. A blocked session is not proof of the root cause. Find the application path that holds the lock.last_autovacuum/last_autoanalyze, and the workload that creates dead tuples. Don't call ordinary MVCC churn bloat without evidence.work_mem spills), I/O, and concurrency.Read references/remedies.md before proposing a fix. It covers queries, indexes, and statistics; locking, MVCC, and isolation; maintenance; partitioning; online DDL; row-level security; and advanced features, with the conditions each remedy requires.
Two further references apply only to their own branch:
CREATE INDEX CONCURRENTLY when its restrictions fit. It can't run inside a transaction block (many migration tools wrap one by default), it takes longer, and a failure leaves an INVALID index. Afterward, check pg_index.indisvalid, then drop or rebuild an invalid index explicitly.ALTER TABLE forms take ACCESS EXCLUSIVE, so set a lock_timeout for DDL. The online DDL section in references/remedies.md lists which column and constraint changes avoid a rewrite.unit-testing when an application contract changed.Stop when the completion condition and guardrails are met, or when missing evidence blocks a safe conclusion. Don't add indexes, partitions, tuning, extensions, or maintenance for hypothetical future scale.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin postgres