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.
npx agentmods add skills/arbazkhan971/godmode/postgresnpx skills add arbazkhan971/godmode --skill postgresgit clone --depth 1 https://github.com/arbazkhan971/godmodeWrote 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.
[](https://agentmods.dev/skills/arbazkhan971/godmode/postgres)<a href="https://agentmods.dev/skills/arbazkhan971/godmode/postgres"><img src="https://agentmods.dev/badge/skills/arbazkhan971/godmode/postgres.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00020 | $0.01524 |
| Opus 5 | $0.00010 | $0.00762 |
| Sonnet 5 | $0.00004 | $0.00305 |
| Haiku 4.5 | $0.00002 | $0.00152 |
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 yesterday.
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 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)
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.
- yesterday First seen · 197 lines · 20 tokens per session scan A 48418a033877
postgres is a skill published in the GitHub repository arbazkhan971/godmode (26 stars, last pushed 7d ago), licensed MIT. It adds 20 tokens to every session and 1,524 once invoked, about $0.0001 per session on Opus 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.
Other skills, from other repositories
cloud-sql-postgres-vectorassist
Use these skills to set up and optimize production-ready vector workloads by simply expressing your intent and performance requirements.
pgvector-semantic-search
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…
postgres-hybrid-text-search
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…
database-patterns
DB schema design and query tuning: normalization, indexing, N+1, transactions, EXPLAIN. Triggers: schema, index, slow query, N+1, PostgreSQL, MySQL, EXPLAIN, deadlock, query plan.
ai-vector-brain
Builds vector-brain implementations for repos, docs hubs, and compliance corpora. Use when creating pgvector retrieval brains with scripts, SQL, manifests, and evals.
postgres-semantic-search
PostgreSQL-based semantic and hybrid search with pgvector and ParadeDB. Use when implementing vector search, semantic search, hybrid search, or full-text search in PostgreSQL. Covers pgvector indexing, hybrid FTS/BM25 + RRF, ParadeDB, reranking, halfvec, multilingual search, query translation, and domain evals.…