postgres-migrations

postgres-migrations is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 43 tokens per session (2,067 once invoked), scanned A, original, Apache-2.0.

A guide to changing PostgreSQL database structure with migration files. Migrations are versioned steps that apply the same schema changes across development, testing, and production.

In plain words
What is it for?
Use it when adding or changing tables, columns, indexes, or other PostgreSQL schema elements, after identifying the repository's migration tool.
Why use it?
It prevents environments from drifting apart and avoids changing a migration that has already been applied. It also calls out schema changes that could lock a live table for too long.

Skill for Claude CodeCodex

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

Good fit Use it when adding or changing tables, columns, indexes, or other PostgreSQL schema elements, after identifying the repository's migration tool.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/postgres-migrations
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 makifbaysal/tasktrooper --skill postgres-migrations
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

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-migrations

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/postgres-migrations"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/postgres-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,067 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.00043 $0.02067
Opus 5.5 $0.00017 $0.00827
Sonnet 5.5 $0.00009 $0.00413
Haiku 4.5 $0.00004 $0.00207

Measured 8d ago against content hash 4daf31b8d84f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 8d 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.

catalog/agents/backend-developer/skills/postgres-migrations/SKILL.md · 106 lines

How it starts

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

PostgreSQL Migrations

Overview

Migrations are append-only history that must replay identically on every environment, forever. The cardinal sin is editing a migration that has already run somewhere — it makes environments diverge silently. The second most common mistake is DDL that locks a live table for longer than the app can tolerate.

Core principle: a wrong migration is fixed by a NEW migration, never by editing the old one; and rollback_release reverts code only, so the schema your migration leaves behind must keep working with the previous release's code until a later task removes what it replaced.

Detect the repo's migration tool first

Tool How to recognise it Down migration Outside a transaction
golang-migrate *.up.sql / *.down.sql pairs its own .down.sql file each CONCURRENTLY statement needs its own migration file (no implicit transaction wrapping across files)
goose -- +goose Up / -- +goose Down in one file same file, Down section -- +goose NO TRANSACTION directive
Flyway V<n>__name.sql none in the open-source edition follow Flyway's own non-transactional DDL rules
Liquibase changesets (XML/YAML/SQL) rollback block per changeset runInTransaction
Atlas atlas.hcl + versioned migrations — —
Up-only numbered SQL plain numbered .sql files, no down files (e.g. this repo's own server/migrations/) none exists — don't invent one —

Never introduce a different migration tool into a repo that already has one, and never add down files to a repo that has none — follow what's there (rule repo-conventions-win).

Rules

  • Never edit an applied migration. History replays; a divergent edit corrupts environments that already ran it. A wrong migration gets a new one that corrects it.
  • Never rely on Hibernate/JPA auto-DDL (hbm2ddl=update, Quarkus schema generation) outside tests — schema comes from migrations only (java-persistence).
  • Idempotent where it matters: IF NOT EXISTS, ON CONFLICT, WHERE guards on backfills so a re-run does no harm.
  • Add an explicit index for every new query path the code introduces — Postgres does not auto-index foreign-key columns.
  • Start DDL in a live-table migration with SET lock_timeout = '5s'; so a blocked ALTER fails fast and visibly instead of queueing behind other locks and blocking every other statement on the table.

Read the full file on GitHub · 106 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. 8d ago First seen · 106 lines · 43 tokens per session scan A 4daf31b8d84f

Subscribe to this mod's changes

postgres-migrations is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 43 tokens to every session and 2,067 once invoked, about $0.0002 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-10-05.

Related

Other skills, from other repositories

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.

wshobson/agents · 37 tokens

prisma-postgres-setup

Set up a new Prisma Postgres database and connect it to a local project using the Management API. Use when asked to "set up a database", "create a Prisma Postgres project", "get a connection string", "connect my app to Prisma Postgres", or "provision a database".

nitrocloudofficial/nitrostack · 67 tokens

prisma-postgres

Prisma Postgres setup and operations guidance across Console, create-db CLI, Management API, and Management API SDK. Use when creating Prisma Postgres databases, working in Prisma Console, provisioning with create-db/create-pg/create-postgres, or integrating programmatic provisioning with service tokens or OAuth.

nitrocloudofficial/nitrostack · 63 tokens

dsql

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…

awslabs/agent-plugins · 246 tokens

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens

sql-optimizer

Analyzes SQL queries for missing indexes, N+1 patterns, suboptimal joins, and full table scans. Interprets EXPLAIN, detects anti-patterns, rewrites queries. Triggers on: "optimize this query", "slow query", "add indexes", "explain plan", "N+1 query", "why is this query slow".

Mathews-Tom/armory · 78 tokens