postgres

postgres is a skill for Claude Code from arbazkhan971/godmode. It costs 20 tokens per session (1,524 once invoked), scanned A, original, MIT.

A guide to advanced PostgreSQL features, database design, performance tuning, replication, partitioning, connection pooling, and extensions. PostgreSQL is a relational database that stores structured data in tables.

In plain words
What is it for?
Use it to design PostgreSQL schemas, write migrations, tune databases, configure replication or pooling, analyze statistics, and add features such as pgvector search.
Why use it?
It helps diagnose database performance and make informed choices about indexes, schemas, queries, maintenance, and scaling. It also explains features such as JSONB, full-text search, and vector search.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the godmode plugin — 132 skills, 1 command, 7 agents, 3 MCP servers shipped together

Good fit Use it to design PostgreSQL schemas, write migrations, tune databases, configure replication or pooling, analyze statistics, and add features such as pgvector search.

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

Made for: Claude Code.

Or install godmode, the plugin that ships this one along with the rest of its 132 skills, 1 command, 7 agents, 3 MCP servers.

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/arbazkhan971/godmode/postgres/github.svg)](https://agentmods.dev/skills/arbazkhan971/godmode/postgres)
Your own site
<a href="https://agentmods.dev/skills/arbazkhan971/godmode/postgres"><img src="https://agentmods.dev/badge/skills/arbazkhan971/godmode/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/arbazkhan971/godmode/postgres"><img src="https://agentmods.dev/badge/skills/arbazkhan971/godmode/postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 186
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.00020 $0.01524
Opus 5.5 $0.00008 $0.00610
Sonnet 5.5 $0.00004 $0.00305
Haiku 4.5 $0.00002 $0.00152

Measured 3mo ago against content hash 48418a033877, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres scanned grade A with 1 finding 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 3mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:8080/health/db
skills/postgres/SKILL.md · 197 lines

How it starts

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

Activate When

  • /godmode:postgres, "postgres performance"
  • "tune postgres", "replication", "partition table"
  • "pgbouncer", "pgvector", "full-text search"
  • "VACUUM", "ANALYZE", "bloat", "pg_stat"
  • "postgres migration", "write a migration", "postgres schema"

Workflow

1. Environment Assessment

SELECT version();
SHOW shared_buffers;
SHOW work_mem;
SHOW max_connections;
Version: PostgreSQL 14|15|16|17
Hosting: self-managed|RDS|Aurora|Supabase|Neon
Workload: OLTP|OLAP|mixed
Size: <total GB>, Tables: <N>, Largest: <N rows>

2. Advanced Features

CTEs: recursive for hierarchies, materialized for repeated subqueries (PG 12+ auto-optimizes).

Window Functions: ROW_NUMBER, RANK, LAG/LEAD, running totals with SUM() OVER().

JSONB: GIN index for containment (@>), use jsonb_path_query for complex extraction. Keep structured data in columns, metadata in JSONB.

Full-Text Search: tsvector + GIN index. to_tsvector('english', col) with @@ operator. IF FTS sufficient: skip Elasticsearch.

3. Extensions

  • pgvector: vector similarity (RAG, embeddings). Use ivfflat (fast, approximate) or hnsw (accurate). IF <1M vectors: pgvector over Pinecone.
  • PostGIS: geospatial. ST_DWithin for proximity.
  • TimescaleDB: time-series. Hypertables with automatic partitioning by time.
  • pg_stat_statements: ALWAYS install. Non-negotiable for understanding query performance.

4. Replication

Streaming (physical): byte-for-byte copy. Use for HA failover + read replicas. wal_level=replica.

Logical: table-level, selective. Use for cross- version upgrades, specific table replication, CDC. Requires wal_level=logical.

IF HA failover needed: streaming replication. IF selective table sync: logical replication.

5. Partitioning

CREATE TABLE events (
  id bigserial, created_at timestamptz, data jsonb
) PARTITION BY RANGE (created_at);
CREATE TABLE events_2024_q1 PARTITION OF events
  FOR VALUES FROM ('2024-01-01') TO ('2024-04-01');
  • Range: time-series, logs (partition by month/quarter)
  • List: known categories (partition by region/status)
  • Hash: uniform distribution (partition by user_id)

Read the full file on GitHub · 197 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. 3mo ago First seen · 197 lines · 20 tokens per session scan A 48418a033877

Subscribe to this mod's changes

postgres is a skill published in the GitHub repository arbazkhan971/godmode (35 stars, last pushed 3mo ago), licensed MIT. It adds 20 tokens to every session and 1,524 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

postgres compared with skills from other repositories

postgres next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
postgresarbazkhan971/godmodeSkill353mo agoMITA20Claude Code
pgvector-semantic-searchtimescale/pg-aiguideSkill1.9k2d agoApache-2.0A190Cursor
postgres-hybrid-text-searchtimescale/pg-aiguideSkill1.9k2d agoApache-2.0A162Cursor
vector-db-rag-expertroedyrustam/vibes-plugSkill132todayMITA47Cursor
postgres-semantic-searchlaguagu/claude-code-nextjs-skillsSkill757d agoMITA90Claude Code
managing-databasesrileyhilliard/claude-essentialsSkill1333d agoMITA61Claude Code
pgvector-knowledge-patchNevaberry/nevaberry-pluginsSkill253d agoMITA9Claude Code