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/jaycheng113/skill-retrieval-mcp/postgres-migrationsnpx skills add JayCheng113/skill-retrieval-mcp --skill postgres-migrationsgit clone --depth 1 https://github.com/JayCheng113/skill-retrieval-mcpWrote 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/jaycheng113/skill-retrieval-mcp/postgres-migrations)<a href="https://agentmods.dev/skills/jaycheng113/skill-retrieval-mcp/postgres-migrations"><img src="https://agentmods.dev/badge/skills/jaycheng113/skill-retrieval-mcp/postgres-migrations.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.00021 | $0.00221 |
| Opus 5 | $0.00010 | $0.00111 |
| Sonnet 5 | $0.00004 | $0.00044 |
| Haiku 4.5 | $0.00002 | $0.00022 |
Grade A, and why
postgres-migrations 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 6d 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.
What it actually says
PostgreSQL migrations without downtime
Adding a NOT NULL column to a large table rewrites it under an ACCESS EXCLUSIVE
lock, which blocks every reader and writer for the duration. Split it instead:
- Add the column as nullable with no default.
- Backfill in batches, committing between batches so the lock is never held long.
- Add a
NOT VALIDcheck constraint, thenVALIDATE CONSTRAINTseparately — validation takes only aSHARE UPDATE EXCLUSIVElock.
Dropping a column is metadata-only and safe. Renaming one is not: the old and new name cannot both be live, so deploy a read-both/write-both shim first.
Always set lock_timeout before DDL. Without it a migration that cannot acquire
its lock will queue behind a long transaction and block everything behind it too.
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.
- 6d ago First seen · 23 lines · 21 tokens per session scan A 87c47f7ae7b0
postgres-migrations is a skill published in the GitHub repository JayCheng113/skill-retrieval-mcp (119 stars, last pushed 9d ago), licensed MIT. It adds 21 tokens to every session and 221 once invoked, about $0.0001 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-30.
Other skills, from other repositories
database-patterns
Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.
postgresdb
Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…
Drizzle ORM Testing
Testing patterns for Drizzle ORM covering migration testing, query builder testing, transaction testing, and database integration testing with PostgreSQL, SQLite, and MySQL.
srtd-cli
This skill should be used when the user mentions "srtd", "sql templates", "migrations-templates", "live reload sql", "supabase functions", when working with files in supabase/migrations-templates/, when .buildlog.json or srtd.config.json is detected, or when writing Postgres functions/views/triggers for Supabase.
db-migrations
Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is postgresdb), NOT drizzle-kit mechanics (that is…
drizzle-orm
Use when modeling data or querying with Drizzle ORM in TypeScript — pgTable schema in .ts, type-safe select/insert/relational queries, drizzle-kit migrations. NOT Prisma Client or schema.prisma (that is prisma-orm), NOT ORM-agnostic migration strategy (that is db-migrations), NOT Postgres engine tuning or EXPLAIN…