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/magnus919/agent-skills/postgresnpx skills add magnus919/agent-skills --skill postgresgit clone --depth 1 https://github.com/magnus919/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/magnus919/agent-skills/postgres)<a href="https://agentmods.dev/skills/magnus919/agent-skills/postgres"><img src="https://agentmods.dev/badge/skills/magnus919/agent-skills/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.1 | $0.00107 | $0.03654 |
| Opus 5 | $0.00053 | $0.01827 |
| Sonnet 5 | $0.00021 | $0.00731 |
| Haiku 4.5 | $0.00011 | $0.00365 |
Grade A, and why
postgres 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 2d 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 — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Operations
Use this skill to operate PostgreSQL safely as the database engine it is: review configuration against workload, find index and query-plan problems, manage vacuum and bloat, set up and verify WAL archiving and point-in-time recovery, run replication with a defensible failover plan, handle extensions, plan major-version upgrades, and diagnose incidents with evidence. This is a tool skill for one named tool (PostgreSQL). Database methodology — backup strategy across engines, migration patterns, SQL analytical patterns — lives in data-engineering; application-level data access patterns belong to backend-engineering; schema and data modeling belong to data-architect and data-engineering. Supabase platform administration is supabase.
Operating contract
- Read-only discovery before any mutation. Inspect configuration, catalog statistics, and logs first. The bundled
pgdiagscript collects read-only evidence and opens every session withdefault_transaction_read_only=on. - Confirm the target, scope, and rollback path before acting. Read-only discovery may proceed without confirmation. Mutations — a
pg_ctlstop, a promotion, an extension install, apg_upgraderun — require an explicit human directive naming the instance. - A backup is not recovery evidence. Verify restore on a scratch instance on a schedule; never claim recoverability from a backup log alone.
- Keep evidence bounded. Summarize catalog queries and log excerpts; never dump full logs,
postgresql.conf, or connection strings with passwords into chat. - Verify at the delivery boundary. A
SELECT 1answer proves connectivity, not health; a replayedpg_basebackupproves recoverability, not that today's WAL is being archived.
The pgdiag script
scripts/pgdiag is an agent-first, read-only diagnostic collector. It shells out to psql, opens every session with default_transaction_read_only=on, and emits bounded JSON. --help works with no server and no psql installed.
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- evals/evals.json 11 KB
- README.md 4.0 KB
- references/00-source-index.md 2.9 KB
- references/01-configuration.md 3.8 KB
- references/02-indexes-and-query-plans.md 3.5 KB
- references/03-vacuum-and-bloat.md 3.2 KB
- references/04-backups-wal-pitr.md 3.9 KB
- references/05-replication-and-failover.md 3.6 KB
- references/06-extensions.md 2.8 KB
- references/07-upgrades.md 3.3 KB
- references/08-diagnostics.md 3.6 KB
- scripts/pgdiag 15 KB
- tests/test_pgdiag.py 7.3 KB runs code
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.
- 2d ago First seen · 169 lines · 107 tokens per session scan A 006b67269046
postgres is a skill published in the GitHub repository magnus919/agent-skills (67 stars, last pushed yesterday), licensed MIT. It adds 107 tokens to every session and 3,654 once invoked, about $0.0005 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
postgres-patterns
PostgreSQL database patterns for query optimization, schema design, indexing, and security. Quick reference for common patterns, index types, data types, and anti-pattern detection. Based on Supabase best practices.
alembic-migration
Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.
postgresql-table-design
Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.
postgres-expert
PostgreSQL expert for query optimization, indexing, extensions, and database administration.
sql-analyst
SQL query expert for optimization, schema design, and data analysis.
wisdom-index
Build or refresh CocoWisdom's local lexical index over existing session JSONL transcripts.