architecture-postgresql-internals

architecture-postgresql-internals is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 145 tokens per session (2,108 once invoked), scanned A, original, MIT.

A technical guide to PostgreSQL, an open-source database that stores related information in tables. It explains how PostgreSQL handles concurrent reads and writes, change logging, cleanup, and performance.

In plain words
What is it for?
Investigating database performance, understanding MVCC and vacuuming, explaining write-ahead logging, and reasoning about replication and crash recovery.
Why use it?
It helps developers understand why old row versions and write logs exist, and how these internal processes affect storage, recovery, and speed.

Skill for Claude CodeCodex

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

Good fit Investigating database performance, understanding MVCC and vacuuming, explaining write-ahead logging, and reasoning about replication and crash recovery.

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

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 architecture-postgresql-internals

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/postgresql-internals/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/postgresql-internals)
Your own site
<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.

agentmods 80×15 button for architecture-postgresql-internals

Your own site · 80×15
<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>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,108 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.00145 $0.02108
Opus 5.5 $0.00058 $0.00843
Sonnet 5.5 $0.00029 $0.00422
Haiku 4.5 $0.00015 $0.00211

Measured today against content hash 2074e776a6c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

skills/architecture/databases/postgresql-internals/SKILL.md · 135 lines

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) and xmax (deleting/locking transaction).
  • UPDATE = insert a new version + set xmax on the old one. DELETE sets xmax. Old versions stay in the heap.
  • A snapshot decides visibility: a tuple is visible if xmin committed before the snapshot and xmax is 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.

Read the full file on GitHub · 135 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. today Changed · +89 lines · +145 tokens per session 2074e776a6c9
  2. 1mo ago First seen · 46 lines · 0 tokens per session scan A 5c18a44bcd91

Subscribe to this mod's changes

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.