postgres-safety

postgres-safety is a skill for Claude Code, Codex from Rohit-ATS/Airlock. It costs 37 tokens per session (1,779 once invoked), scanned A, original, MIT.

A safety guide for PostgreSQL database migrations. PostgreSQL is a database system, and a migration is a change to its tables or other database structure.

In plain words
What is it for?
Use it before writing or reviewing migrations to check the database version, reversibility, locks, and table rewrites.
Why use it?
It helps identify changes that cannot be undone, lock tables for a long time, or copy an entire table and interrupt production work.

Skill for Claude CodeCodex

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

Good fit Use it before writing or reviewing migrations to check the database version, reversibility, locks, and table rewrites.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rohit-ats/airlock/postgres-safety
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 Rohit-ATS/Airlock --skill postgres-safety
Clone the repo
git clone --depth 1 https://github.com/Rohit-ATS/Airlock

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 postgres-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/rohit-ats/airlock/postgres-safety/github.svg)](https://agentmods.dev/skills/rohit-ats/airlock/postgres-safety)
Your own site
<a href="https://agentmods.dev/skills/rohit-ats/airlock/postgres-safety"><img src="https://agentmods.dev/badge/skills/rohit-ats/airlock/postgres-safety/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 postgres-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/rohit-ats/airlock/postgres-safety"><img src="https://agentmods.dev/badge/skills/rohit-ats/airlock/postgres-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,779 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.
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.00037 $0.01779
Opus 5.5 $0.00015 $0.00712
Sonnet 5.5 $0.00007 $0.00356
Haiku 4.5 $0.00004 $0.00178

Measured 3mo ago against content hash 3ca6c98a5cd2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-safety 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 3mo 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.

skills/postgres-safety/SKILL.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL safety

The rules a migration must obey before AIRLOCK will let anyone see it. Version-specific behaviour is called out because getting it wrong is how a "safe" migration takes a production table offline.

Always establish the server version first (SHOW server_version). Do not reason from memory about lock behaviour; it changed materially at 11, 12 and 13.


1. The three questions

Answer these, in order, for every operation:

  1. Is it reversible? Can I write an inverse that restores the exact prior bytes?
  2. What lock does it take, and for how long? A lock held for 4 seconds on a 1.2M-row table is a 4-second outage for every writer.
  3. Does it rewrite the table? A rewrite means the lock is held for the duration of a full copy, not for a catalog update.

If (1) is no, the change needs a scope certificate, not an undo certificate.


2. Irreversible in principle

No rollback script restores these. Do not claim reversibility.

Operation Why it cannot be undone
DROP TABLE / DROP COLUMN The data is gone. Re-adding the column gives you nulls.
TRUNCATE No row versions retained.
DELETE without a retained copy Ditto, once vacuumed.
UPDATE that loses information See §3 — the important one.
ALTER TYPE narrowing (text→varchar(20), bigint→int) Truncation and overflow are lossy.
DROP of a constraint whose violations then land The violating rows now exist.

DROP COLUMN is logically irreversible even though Postgres only marks the column dropped in the catalog. The data is unreachable through SQL. Never present a re-ADD COLUMN as a rollback: it restores the schema, not the data.


3. Lossy arithmetic — the failure people miss

An UPDATE is only reversible if its function is injective (different inputs always give different outputs).

-- NOT reversible: ROUND collapses distinct values onto the same result
UPDATE invoices SET amount_minor = ROUND(amount_minor / 1.0871);

Read the full file on GitHub · 197 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. 3mo ago First seen · 197 lines · 37 tokens per session scan A 3ca6c98a5cd2

Subscribe to this mod's changes

postgres-safety is a skill published in the GitHub repository Rohit-ATS/Airlock (1 stars, last pushed 3d ago), licensed MIT. It adds 37 tokens to every session and 1,779 once invoked, about $0.0001 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.

Related

postgres-safety compared with skills from other repositories

postgres-safety next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
postgres-safetyRohit-ATS/AirlockSkill13d agoMITA37Claude Code, Codex
prisma-schema-conventionsJoaoEquer/OficinaSkill210d agoMITA76Claude Code
resonate-server-postgresresonatehq/resonate-skillsSkill73mo agoApache-2.0A112Claude Code, Codex
postgres-patternstranhieutt/software_development_departmentSkill756mo agoMITA53Claude Code
reweave-operatorvnmoorthy/reweaveSkill13mo agoMITA62Claude Code, Codex
postgres-patternsmturac/everything-openai-codexSkill773mo agoMITA45Kiro
alloydb-basicsgoogle/skillsSkill26kyesterdayApache-2.0A72Claude Code, Codex