postgres-dba

A set of conventions for designing PostgreSQL databases and writing SQL. PostgreSQL is a relational database that stores structured data in tables and supports SQL queries.

In plain words
What is it for?
Use it to design tables, keys, relationships, enums, JSONB fields, generated columns, indexes, functions, and database migrations. It is aimed at database and SQL decisions rather than TypeScript application code.
Why use it?
It helps keep data rules in the database itself, so invalid relationships and inconsistent values are blocked close to where data is stored. Consistent naming and migration rules also make future schema changes easier to manage.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/robconery/cassini-workshop/postgres-dba
Any agent
npx skills add robconery/cassini-workshop --skill postgres-dba
Clone the repo
git clone --depth 1 https://github.com/robconery/cassini-workshop

Made for: Claude Code, Codex.

Per session 162 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,799 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00162 $0.01799
Opus 5 $0.00081 $0.00899
Sonnet 5 $0.00032 $0.00360
Haiku 4.5 $0.00016 $0.00180

Measured yesterday against content hash 9e9995936871, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 yesterday.

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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/skills/postgres-dba/SKILL.md · 137 lines

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

  1. Match the task to a rule below or in the decision guide.
  2. Open the matching references/*.md for the full rationale, the wrong way, the right way, and the explicit-override escape hatch.
  3. Copy the closest file from templates/ and adapt it — the templates already encode every convention here, so you start compliant.
  4. 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)

  1. Naming is snake_case, lowercase, unquoted, forever. Tables plural (orders), columns singular (shipped_at), no reserved words, no CamelCase, no quoted identifiers in the schema. If you ever need to double-quote an identifier in normal queries, the name is wrong. See references/naming.md.

  2. Every base table has id serial primary key. A synthetic key, always named id, is the row's identity. Natural keys get a UNIQUE constraint, never the primary key. Use bigserial/identity only when you have a concrete reason to expect >2.1B rows — and write that reason in a comment. See references/keys.md.

Read the full file on GitHub · 137 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. yesterday First seen · 137 lines · 162 tokens per session scan A 9e9995936871

Subscribe to this mod's changes

postgres-dba is a skill published in the GitHub repository robconery/cassini-workshop (1 stars, last pushed 2mo ago), licensed MIT. It adds 162 tokens to every session and 1,799 once invoked, about $0.0008 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-08-31.

Related

Other skills, from other repositories

agent-teams

How to orchestrate Claude Code's experimental Agent Teams — spawning teammates as separate sessions, delegating work to them, and waiting for results instead of doing the work yourself in the main thread. Use whenever a task should run as parallel/independent workstreams: multi-file refactors, reviewing or auditing…

opagani/cassini-workshop · 161 tokens

bdd-specs

Behavior-driven design: write executable specifications BEFORE any implementation code. Reads /docs/PLAN.md for the build plan and /docs/STORIES.md for user stories, and stops to ask for either if it is missing. Generates TypeScript spec files in nested blocks — Feature > Scenario > Specification — where each Scenario…

opagani/cassini-workshop · 183 tokens

github

GitHub workflow conventions: writing clear conventional commits, opening detailed issues and PRs via the gh CLI, and choosing trunk-based vs short-lived branch flow based on the size of the change. Use whenever the user wants to commit, branch, push, open an issue, open a PR, or asks how to structure any of those.…

opagani/cassini-workshop · 83 tokens

tdd

Test-driven development with bun:test, written for clarity. Produces failing tests FIRST — before any implementation — that read as the executable spec a builder agent implements against. Each test names a single behavior in plain language, follows Arrange–Act–Assert, asserts one thing, and uses real types with no…

opagani/cassini-workshop · 145 tokens

user-stories

Write, split, and refine agile/scrum user stories and acceptance criteria. Produces /docs/STORIES.md as the canonical backlog, formatted to feed directly into the bdd-specs skill (Story → Feature, Given/When/Then acceptance criteria → Scenario/Specification). Use this whenever the user wants to write a user story…

opagani/cassini-workshop · 147 tokens

security-web

Web application security review for TypeScript/JavaScript stacks, frontend and backend: XSS and output encoding, CSRF, clickjacking, secrets leaking into client bundles, authn/authz and IDOR, injection (SQL/command/NoSQL/ template), SSRF, mass assignment, insecure deserialization, file upload, path traversal, security…

opagani/cassini-workshop · 207 tokens