Borrowing it
Nothing to install: this file belongs to irahardianto/awesome-agv. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/irahardianto/awesome-agv/main/.agents/skills/postgres-idioms/SKILL.mdgit clone --depth 1 https://github.com/irahardianto/awesome-agvWrote 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/irahardianto/awesome-agv/postgres-idioms)<a href="https://agentmods.dev/skills/irahardianto/awesome-agv/postgres-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/awesome-agv/postgres-idioms/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.
<a href="https://agentmods.dev/skills/irahardianto/awesome-agv/postgres-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/awesome-agv/postgres-idioms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.1 | $0.00046 | $0.04189 |
| Opus 5 | $0.00023 | $0.02094 |
| Sonnet 5 | $0.00009 | $0.00838 |
| Haiku 4.5 | $0.00005 | $0.00419 |
Grade A, and why
postgres-idioms 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 549 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Idioms and Best Practices
PostgreSQL rewards set-based thinking, explicit joins, and query plan awareness. Idiomatic PostgreSQL = readable, performant, migration-safe, secure.
Scope: PostgreSQL-specific patterns. For database design principles (normalization, naming, migration strategy), see
@.agents/rules/database-design-principles.md. For deep-dive references on individual topics, seereferences/in this skill directory.
Priority Guide
| Priority | Category | Impact |
|---|---|---|
| 1 | Query Performance & Indexing | CRITICAL |
| 2 | Connection Management | CRITICAL |
| 3 | Security & RLS | CRITICAL |
| 4 | Schema Design | HIGH |
| 5 | Concurrency & Locking | MEDIUM-HIGH |
| 6 | Data Access Patterns | MEDIUM |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM |
| 8 | Advanced Features | LOW |
1. Query Performance & Indexing (CRITICAL)
Always EXPLAIN Before Optimizing
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) SELECT ...;
Red flags in query plans:
Seq Scanon large table → missing indexRows Removed by Filter→ poor selectivity or wrong indexread >> hitin Buffers → data not cached, cold querySort Method: external merge→work_memtoo lowNested Loopwith high row count → considerHash Join
Index Strategy
Choose the right index type:
| Type | Use When | Operators |
|---|---|---|
| B-tree (default) | General sorted data | =, <, >, BETWEEN, IN, IS NULL |
| GIN | JSONB, arrays, full-text search | @>, ?, ?&, @@ |
| GiST | Geometric, range, nearest-neighbor | &&, @>, <-> (KNN) |
| BRIN | Large time-series, naturally ordered | Range queries on ordered columns |
| Hash | Equality-only (marginal B-tree improvement) | = |
Composite indexes — column order matters (leftmost prefix rule):
-- ✅ Equality columns first, range columns last
CREATE INDEX idx_orders_status_date ON orders (status, created_at);
-- Works: WHERE status = 'pending'
-- Works: WHERE status = 'pending' AND created_at > '2024-01-01'
-- FAILS: WHERE created_at > '2024-01-01' (alone — no leftmost match)
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.
- 6d ago First seen · 549 lines · 46 tokens per session scan A a383377b8427
postgres-idioms is a skill published in the GitHub repository irahardianto/awesome-agv (156 stars, last pushed 19d ago), licensed MIT. It adds 46 tokens to every session and 4,189 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-09-03.
Other skills, from other repositories
postgresql-expert
Design, optimize, and administer PostgreSQL databases. Covers advanced indexing, partitioning, full-text search, JSON operations, replication, and performance tuning.
postgres-database-migration
Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases. Trigger when user asks to: Test a schema migration before applying it to production Add, remove, or rename columns safely on a live table Change a column's data…
design-postgis-tables
Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications.
migrate-postgres-tables-to-hypertables
Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation. Trigger when user asks to: Migrate or convert PostgreSQL tables to hypertables Execute hypertable migration with minimal downtime Plan blue-green migration for large tables Validate…
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…
setup-timescaledb-hypertables
Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any insert-heavy table. Trigger when user asks to: Create or design SQL schemas/tables AND…