Borrowing it
Nothing to install: this file belongs to robconery/kolea. 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/robconery/kolea/main/.claude/skills/postgres-dba/SKILL.mdgit clone --depth 1 https://github.com/robconery/koleaWrote 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/robconery/kolea/postgres-dba)<a href="https://agentmods.dev/skills/robconery/kolea/postgres-dba"><img src="https://agentmods.dev/badge/skills/robconery/kolea/postgres-dba/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/robconery/kolea/postgres-dba"><img src="https://agentmods.dev/badge/skills/robconery/kolea/postgres-dba.svg" alt="Reviewed on agentmods" width="80" 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.00162 | $0.01799 |
| Opus 5.5 | $0.00065 | $0.00720 |
| Sonnet 5.5 | $0.00032 | $0.00360 |
| Haiku 4.5 | $0.00016 | $0.00180 |
Grade A, and why
postgres-dba 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 2mo 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.
Copies of this mod
2 near-identical copies found in the catalogue:
- postgres-dba — 100% identical, 0 lines differ
- postgres-dba — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL DBA — Opinionated Schema Design
The database is the system of record, not a dumb bucket behind an ORM. Model integrity in the schema, push set-based logic into functions, and let the application consume a clean, self-defending API. These conventions are defaults with teeth: deviating is allowed, but only deliberately and with a comment saying why.
🎯 Why: Design for Change
The goal of writing software is to be able to change it safely — and a schema is the hardest thing in any system to change. Consistent naming, surrogate keys, NOT NULL FKs, enums, and logic-in-functions exist so migrations stay mechanical: you add a column, you don't reshape the world. JSONB next to a relational spine lets the document side evolve without a migration. Every rule here optimizes for the next migration being boring.
This skill is about database design and SQL. For TypeScript/app-layer concerns use the language skills; this skill never defers integrity to the application.
How to use this skill
- Match the task to a rule below or in the decision guide.
- Open the matching
references/*.mdfor the full rationale, the wrong way, the right way, and the explicit-override escape hatch. - Copy the closest file from
templates/and adapt it — the templates already encode every convention here, so you start compliant. - Apply the rule unless you can state, in a comment in the DDL, the specific reason it does not apply here. "It was easier" is not a reason.
The hard rules (non-negotiable defaults)
-
Naming is
snake_case, lowercase, unquoted, forever. Tables plural (orders), columns singular (shipped_at), no reserved words, noCamelCase, no quoted identifiers in the schema. If you ever need to double-quote an identifier in normal queries, the name is wrong. Seereferences/naming.md. -
Every base table has
id serial primary key. A synthetic key, always namedid, is the row's identity. Natural keys get aUNIQUEconstraint, never the primary key. Usebigserial/identity only when you have a concrete reason to expect >2.1B rows — and write that reason in a comment. Seereferences/keys.md.
What ships with it
10 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.
- references/enums.md 4.0 KB
- references/functions.md 5.2 KB
- references/generated-columns.md 4.3 KB
- references/jsonb.md 6.6 KB
- references/keys.md 4.7 KB
- references/naming.md 3.6 KB
- templates/function.sql 2.3 KB
- templates/jsonb-document.sql 3.2 KB
- templates/migration.sql 2.3 KB
- templates/schema.sql 3.3 KB
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.
- 2mo ago First seen · 137 lines · 162 tokens per session scan A 9e9995936871
postgres-dba is a skill published in the GitHub repository robconery/kolea (11 stars, last pushed 28d ago), licensed MIT. It adds 162 tokens to every session and 1,799 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-31.
Other skills, from other repositories
auth-db-billing
Backend product systems skill for the svelteflare monorepo. Invoke whenever the user wants to work with auth, sessions, protected routes, users, the database, schema changes, migrations, Stripe billing, subscriptions, paid feature gates, or any server-only logic in the Hono API. Trigger on "add a protected route"…
migration-patterns
Schema migrations: ALTER patterns, engine changes, zero-downtime swaps, clickhouse-local offline migrations, lightweight UPDATE/DELETE strategies, and Postgres→ClickHouse migration planning (type mapping, schema pitfalls, PeerDB CDC, validation, schema introspection).
postgres-drizzle
Write or review PostgreSQL schemas, queries, migrations, and Drizzle ORM code. Use for Postgres/Drizzle relations, indexing, pooling, or query performance; not for unrelated databases or generic backend work.
openclaw-database-toolkit
Database operations MCP server with 5 tools for D1, PostgreSQL, and MongoDB. Use when: (1) 'query my D1 database' or 'run this SQL', (2) 'insert these records' or 'add rows to table', (3) 'update records where X' or 'bulk update', (4) 'show me the table schema' or 'what columns exist', (5) 'migrate this schema' or…
alloydb-basics
Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.
postgresql-table-design
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.