Back to Skills

postgres-pro

verified

Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.

View on GitHub

Marketplace

fullstack-dev-skills

Jeffallan/claude-skills

Plugin

fullstack-dev-skills

development

Repository

Jeffallan/claude-skills
94stars

skills/postgres-pro/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/Jeffallan/claude-skills/blob/main/skills/postgres-pro/SKILL.md -a claude-code --skill postgres-pro

Installation paths:

Claude
.claude/skills/postgres-pro/
Powered by add-skill CLI

Instructions

# 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
- Us

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3251 chars