postgres

postgres is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 41 tokens per session (1,306 once invoked), scanned A, original, MIT.

A guide for designing, tuning, and operating PostgreSQL, an open-source database used to store application data. It covers PostgreSQL-specific behavior such as how it handles updates, indexes, connections, and replication.

In plain words
What is it for?
Use it to design schemas and indexes, investigate bloat and lock contention, tune vacuuming and connection pooling, configure replication, and plan large-table migrations with brief locks.
Why use it?
It helps explain slow queries, table growth, lock conflicts, overloaded connections, and risky changes to large tables. It avoids applying generic SQL advice where PostgreSQL needs different treatment.

Skill for Claude CodeCodex

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

Good fit Use it to design schemas and indexes, investigate bloat and lock contention, tune vacuuming and connection pooling, configure replication, and plan large-table migrations with brief locks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/postgres
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 nimadorostkar/Claude-Skills-collection --skill postgres
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/postgres/github.svg)](https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/postgres)
Your own site
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/postgres"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/postgres/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/postgres"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/postgres.svg" alt="Reviewed on agentmods" width="80" 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 1,306 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.01306
Opus 5 $0.00020 $0.00653
Sonnet 5 $0.00008 $0.00261
Haiku 4.5 $0.00004 $0.00131

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

Security

Grade A, and why

postgres 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 11d 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/data/postgres/SKILL.md · 116 lines

How it starts

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

PostgreSQL

Purpose

Operate PostgreSQL well: understand what MVCC costs you, why the table is bloated, why the connection count matters more than you think, and how to change a large table without locking it.

When to Use

  • Designing schemas or indexes for Postgres.
  • Diagnosing bloat, slow queries, or lock contention.
  • Configuring connection pooling and replication.
  • Running a migration on a large table without downtime.

Capabilities

  • Index types: B-tree, GIN, GiST, BRIN, partial, expression, covering.
  • MVCC, dead tuples, autovacuum tuning, and transaction ID wraparound.
  • Connection pooling with PgBouncer and the pooling modes.
  • Partitioning: declarative range and list partitions.
  • JSONB indexing and query patterns.
  • Streaming replication, replicas, and replication lag.

Inputs

  • The schema, the table sizes, and the query patterns.
  • pg_stat_statements output for the slow-query question.
  • Server configuration and Postgres version.

Outputs

  • Indexes that match the access patterns, with no unused ones.
  • Autovacuum settings appropriate to the write volume.
  • Migrations that acquire only brief locks.

Workflow

  1. Find the real slow queriespg_stat_statements ordered by total time, not by mean. A 30ms query executed a million times costs more than a 4-second query run once.
  2. Index for the access pattern — Equality columns first in a composite index, then the range or sort column. Add partial indexes for the filters that dominate.
  3. Watch the dead tuples — Every UPDATE writes a new row version and leaves the old one dead. A hot table with default autovacuum settings will bloat and slow down.
  4. Pool the connections — Each Postgres connection is a process with real memory cost. Beyond a few hundred, performance degrades. PgBouncer in transaction mode is the standard answer.
  5. Migrate without lockingCREATE INDEX CONCURRENTLY. Add columns nullable, backfill in batches, then set defaults and constraints with NOT VALID followed by VALIDATE.
  6. Set a lock timeout — Before any DDL: SET lock_timeout = '3s'. A migration that waits behind a long transaction will queue every subsequent query behind itself.

Read the full file on GitHub · 116 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. 11d ago First seen · 116 lines · 41 tokens per session scan A 7f1b6a8dbb5e

Subscribe to this mod's changes

postgres is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 23d ago), licensed MIT. It adds 41 tokens to every session and 1,306 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-30.

Related

Other skills, from other repositories

database-inspector

A read-only explorer for SQLite and PostgreSQL databases. It lists tables, shows their columns and relationships, previews records, draws Mermaid ER diagrams, and runs safe queries without changing data.

serejaris/kimi-skills · 91 tokens

backend-setup-stack

Bootstraps a local Node.js backend development stack with Docker, PostgreSQL, and an ORM (Prisma or Sequelize). Use this skill whenever the user wants to: initialize a new backend project, set up a Dockerized database locally, wire up an ORM with automated migrations, scaffold an Express server with a health endpoint…

WESTsyre21/setup-backend-stack · 155 tokens

backend-setup-stack

Use this skill when the user wants to initialize a local development environment using Docker, PostgreSQL, an npm server, and an ORM (Prisma/Sequelize) with automated migration workflows, including detection of existing migration metadata and database readiness checks.

WESTsyre21/setup-backend-stack · 54 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…

serejaris/kimi-skills · 76 tokens

database-architecture

MANDATORY when designing schemas, writing migrations, creating indexes, or making architectural database decisions - enforces PostgreSQL 18 best practices including AIO, UUIDv7, temporal constraints, and modern indexing strategies.

troykelly/claude-skills · 45 tokens

postgis

MANDATORY when working with geographic data, spatial queries, geometry operations, or location-based features - enforces PostGIS 3.6.1 best practices including STCoverageClean, SFCGAL 3D functions, and bigint topology.

troykelly/claude-skills · 52 tokens