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 skills add j4flmao/agent-skills --skill postgresql-internalsgit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote 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/j4flmao/agent-skills/postgresql-internals)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/postgresql-internals"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/postgresql-internals/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/j4flmao/agent-skills/postgresql-internals"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/postgresql-internals.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.00145 | $0.02108 |
| Opus 5.5 | $0.00058 | $0.00843 |
| Sonnet 5.5 | $0.00029 | $0.00422 |
| Haiku 4.5 | $0.00015 | $0.00211 |
Grade A, and why
architecture-postgresql-internals 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 today.
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 — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Internals
Purpose
Most PostgreSQL production issues (bloat, sudden slowdowns, replication lag, wraparound emergencies, bad plans) are direct consequences of how MVCC, VACUUM, WAL, and the planner work. This skill explains those mechanisms precisely and maps each one to the queries and settings used to diagnose and tune it.
Agent Protocol
Trigger
"MVCC", "bloat", "autovacuum", "VACUUM FULL", "dead tuples", "xid wraparound", "WAL", "checkpoint", "HOT update", "fillfactor", "shared_buffers", "EXPLAIN ANALYZE", "slow query".
Input Context
- PostgreSQL major version, hardware/managed service, workload (OLTP/analytics, write rate).
- Symptoms with timestamps;
pg_stat_*output; slow query plans. - Long-running transactions or replication slots in use.
Output Artifact
Diagnosis with evidence queries, root cause tied to the mechanism, and concrete setting/schema changes.
Response Format
Symptom: {what}
Mechanism: {MVCC|VACUUM|WAL|checkpoint|planner|buffer}
Evidence: {query + key numbers}
Fix: {setting/table option/query change} (reload|restart required)
Verify: {metric to watch}
Completion Criteria
- Root cause supported by catalog/statistics evidence.
- Changes state whether they need reload or restart.
- Long transactions, idle-in-transaction sessions, and stale replication slots checked.
MVCC
- Every row version (tuple) stores
xmin(creating transaction) andxmax(deleting/locking transaction). UPDATE= insert a new version + setxmaxon the old one.DELETEsetsxmax. Old versions stay in the heap.- A snapshot decides visibility: a tuple is visible if
xmincommitted before the snapshot andxmaxis unset, aborted, or not yet committed for that snapshot. Readers never block writers and vice versa; writers on the same row block each other. - HOT (heap-only tuple) updates: if no indexed column changes and the page has free space, the new version stays on the same page and indexes are not updated. Lower
fillfactor(e.g. 80-90) on update-heavy tables to leave room.
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.
- today Changed · +89 lines · +145 tokens per session 2074e776a6c9
- 1mo ago First seen · 46 lines · 0 tokens per session scan A 5c18a44bcd91
architecture-postgresql-internals is a skill published in the GitHub repository j4flmao/agent-skills (34 stars, last pushed today), licensed MIT. It adds 145 tokens to every session and 2,108 once invoked, about $0.0006 per session on Opus 5.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.
Other skills, from other repositories
postgresql-expert
Expert-level PostgreSQL database administration, advanced queries, performance tuning, and production operations. Use when the user mentions database, SQL, or performance, or when the task involves Advanced Data Types, Full-Text Search, Advanced Indexes, or Advanced Queries.
PostgreSQL
PostgreSQL 17.x — data types, DDL, DML, queries, indexes, full text search, concurrency, performance, functions.
PostgreSQL Performance Optimization
Production-grade PostgreSQL query optimization, indexing strategies, performance tuning, and modern features including pgvector for AI/ML workloads. Master EXPLAIN plans, query analysis, and database design for high-performance applications.
postgresql-expert
Design, optimize, and administer PostgreSQL databases. Covers advanced indexing, partitioning, full-text search, JSON operations, replication, and performance tuning.
database-advanced-optimization
Use SQL (PostgreSQL) when.
explorer
Build and modify Studio Explorer surfaces, including notebooks, chats, SQL snippets, query cells, and their shared toolbar patterns.