postgres-pro

postgres-pro is a skill for Claude Code, Codex from zacklecon/claude-skills. It costs 41 tokens per session (854 once invoked), scanned A, original, MIT.

A set of guidelines for working with PostgreSQL, a database system used to store and query application data. It covers query speed, replication, JSON data, extensions, and database maintenance.

In plain words
What is it for?
Use it to analyze EXPLAIN output, design indexes, optimize queries, configure replication, work with JSONB, tune VACUUM and autovacuum, and monitor database health.
Why use it?
It helps diagnose slow queries and maintain reliable PostgreSQL databases without overlooking indexes, statistics, backups between servers, or routine cleanup.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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.

agentmods
npx agentmods add skills/zacklecon/claude-skills/postgres-pro
Any agent
npx skills add zacklecon/claude-skills --skill postgres-pro
Clone the repo
git clone --depth 1 https://github.com/zacklecon/claude-skills

Made for: Claude Code, Codex.

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 postgres-pro

README.md
[![agentmods](https://agentmods.dev/badge/skills/zacklecon/claude-skills/postgres-pro.svg)](https://agentmods.dev/skills/zacklecon/claude-skills/postgres-pro)
Your own site
<a href="https://agentmods.dev/skills/zacklecon/claude-skills/postgres-pro"><img src="https://agentmods.dev/badge/skills/zacklecon/claude-skills/postgres-pro.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 854 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00041 $0.00854
Opus 5 $0.00020 $0.00427
Sonnet 5 $0.00008 $0.00171
Haiku 4.5 $0.00004 $0.00085

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

Security

Grade A, and why

postgres-pro 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 5d 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/postgres-pro/SKILL.md · 88 lines

How it starts

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

PostgreSQL Pro

Senior PostgreSQL expert with deep expertise in database administration, performance optimization, and advanced PostgreSQL features.

Role Definition

You are a senior PostgreSQL DBA with 10+ years of production experience. You specialize in query optimization, replication strategies, JSONB operations, extension usage, and database maintenance. You build reliable, high-performance PostgreSQL systems that scale.

When to Use This Skill

  • Analyzing and optimizing slow queries with EXPLAIN
  • Implementing JSONB storage and indexing strategies
  • Setting up streaming or logical replication
  • Configuring and using PostgreSQL extensions
  • Tuning VACUUM, ANALYZE, and autovacuum
  • Monitoring database health with pg_stat views
  • Designing indexes for optimal performance

Core Workflow

  1. Analyze performance - Use EXPLAIN ANALYZE, pg_stat_statements
  2. Design indexes - B-tree, GIN, GiST, BRIN based on workload
  3. Optimize queries - Rewrite inefficient queries, update statistics
  4. Setup replication - Streaming or logical based on requirements
  5. Monitor and maintain - VACUUM, ANALYZE, bloat tracking

Reference Guide

Load detailed guidance based on context:

Topic Reference Load When
Performance references/performance.md EXPLAIN ANALYZE, indexes, statistics, query tuning
JSONB references/jsonb.md JSONB operators, indexing, GIN indexes, containment
Extensions references/extensions.md PostGIS, pg_trgm, pgvector, uuid-ossp, pg_stat_statements
Replication references/replication.md Streaming replication, logical replication, failover
Maintenance references/maintenance.md VACUUM, ANALYZE, pg_stat views, monitoring, bloat

Constraints

MUST DO

  • Use EXPLAIN ANALYZE for query optimization
  • Create appropriate indexes (B-tree, GIN, GiST, BRIN)
  • Update statistics with ANALYZE after bulk changes
  • Monitor autovacuum and tune if needed
  • Use connection pooling (pgBouncer, pgPool)
  • Setup replication for high availability
  • Monitor with pg_stat_statements, pg_stat_user_tables
  • Use prepared statements to prevent SQL injection

Read the full file on GitHub · 88 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 88 lines · 41 tokens per session scan A 5ec3b2978dc2

Subscribe to this mod's changes

postgres-pro is a skill published in the GitHub repository zacklecon/claude-skills (3 stars, last pushed 2d ago), licensed MIT. It adds 41 tokens to every session and 854 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

sql-insight

Translate natural language to SQL, optimize query performance, and interpret EXPLAIN plans for SQLite and PostgreSQL. Triggered when users ask to convert questions into SQL, improve slow queries, tune indexes, analyze execution plans, or mention keywords like NL2SQL, query tuning, or full table scan.

zebbern/claude-code-guide · 64 tokens

database-scout

Explore SQLite and PostgreSQL databases: list tables, inspect schemas (columns/types/constraints), preview data, generate Mermaid ER diagrams, and run safe read-only queries. Triggered by requests to explore a database, view table structures, describe tables, generate diagrams, or query data, and by keywords like…

zebbern/claude-code-guide · 76 tokens

database-expert

Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.

travisjneuman/.claude · 36 tokens

azure-database-postgresql

Expert knowledge for Azure Database for PostgreSQL development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using flexible server, replicas, PgBouncer/Query Store, vector…

MicrosoftDocs/Agent-Skills · 134 tokens

azure-horizondb

Expert knowledge for Azure Horizondb development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when tuning pgvector, azureai SQL functions, LangChain vector stores, Apache AGE…

MicrosoftDocs/Agent-Skills · 112 tokens

neon

Neon separates compute and storage, allowing instant database branching and autoscaling. For most Node.js applications, use the @neondatabase/serverless driver over standard pg to leverage WebSocket connections, which bypass serverless environment connection limits.

ashish7802/awesome-api-skills · 0 tokens