db-migrate

db-migrate is a skill for Claude Code, Codex from Benja-Pauls/SerpentStack. It costs 37 tokens per session (855 once invoked), scanned A, original, MIT.

A database-migration helper for managing schema changes with Alembic. A migration is a tracked change to database tables, columns, indexes, or starting data that can be applied or reversed in order.

In plain words
What is it for?
Use it to create migrations after changing SQLAlchemy models, apply pending changes, inspect migration status and history, roll changes back, and seed data.
Why use it?
It reduces the risk of changing a database manually and losing track of which version is running. It helps check generated changes and confirm that rollback steps undo them correctly.

Skill for Claude CodeCodex

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

Good fit Use it to create migrations after changing SQLAlchemy models, apply pending changes, inspect migration status and history, roll changes back, and seed data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/benja-pauls/serpentstack/db-migrate
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 Benja-Pauls/SerpentStack --skill db-migrate
Clone the repo
git clone --depth 1 https://github.com/Benja-Pauls/SerpentStack

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 db-migrate

README.md
[![agentmods](https://agentmods.dev/badge/skills/benja-pauls/serpentstack/db-migrate/github.svg)](https://agentmods.dev/skills/benja-pauls/serpentstack/db-migrate)
Your own site
<a href="https://agentmods.dev/skills/benja-pauls/serpentstack/db-migrate"><img src="https://agentmods.dev/badge/skills/benja-pauls/serpentstack/db-migrate/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 db-migrate

Your own site · 80×15
<a href="https://agentmods.dev/skills/benja-pauls/serpentstack/db-migrate"><img src="https://agentmods.dev/badge/skills/benja-pauls/serpentstack/db-migrate.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 855 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.00855
Opus 5.5 $0.00015 $0.00342
Sonnet 5.5 $0.00007 $0.00171
Haiku 4.5 $0.00004 $0.00085

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

Security

Grade A, and why

db-migrate 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 1mo 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/db-migrate/SKILL.md · 112 lines

How it starts

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

Database Migrations

Manage database schema changes with Alembic in SerpentStack.

Prerequisites

  • Postgres running: docker compose up -d postgres
  • Backend dependencies installed: cd backend && uv sync

Creating a New Migration

After modifying or adding a SQLAlchemy model:

cd backend && uv run alembic revision --autogenerate -m "describe the change"

The migration description should be concise and specific, e.g., "add projects table", "add email column to users", "create index on tasks.status".

Review the generated file in backend/migrations/versions/. Verify:

  • The upgrade() function contains the expected op.create_table, op.add_column, or op.create_index calls.
  • The downgrade() function is the inverse of upgrade.
  • No unintended changes are included (Alembic sometimes detects phantom diffs).

Running Migrations

Apply all pending migrations:

cd backend && uv run alembic upgrade head

Apply only the next migration:

cd backend && uv run alembic upgrade +1

Checking Migration Status

See the current revision:

cd backend && uv run alembic current

See full migration history:

cd backend && uv run alembic history --verbose

Downgrading

Roll back the last migration:

cd backend && uv run alembic downgrade -1

Roll back to a specific revision:

cd backend && uv run alembic downgrade <revision_id>

Adding a New Table

Full workflow:

  1. Create the model file at backend/app/models/{name}.py — inherit from Base (provides id, created_at, updated_at).
  2. Import the model in backend/app/models/__init__.py so Alembic detects it.
  3. Generate the migration: cd backend && uv run alembic revision --autogenerate -m "add {name}s table".
  4. Review the generated migration file.
  5. Apply: cd backend && uv run alembic upgrade head.
  6. Verify: connect to the database and confirm the table exists.

Adding a Column to an Existing Table

  1. Edit the model in backend/app/models/{name}.py -- add the new column.
  2. Generate: cd backend && uv run alembic revision --autogenerate -m "add {column} to {name}s".
  3. Review: ensure only the expected op.add_column is present.
  4. Apply: cd backend && uv run alembic upgrade head.

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

Subscribe to this mod's changes

db-migrate is a skill published in the GitHub repository Benja-Pauls/SerpentStack (2 stars, last pushed 6mo ago), licensed MIT. It adds 37 tokens to every session and 855 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

Other skills, from other repositories

obsidian-bases

Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

kepano/obsidian-skills · 63 tokens

x-osv

CLI for Google OSV database. Query vulnerabilities for packages, scan local projects for vulnerable dependencies. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill). Required Tool: Install osv-scanner for project scanning (see https://github.com/google/osv-scanner).

x-cmd/x-cmd · 72 tokens

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens

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…

ericrisco/rsc-harness · 91 tokens

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…

ericrisco/rsc-harness · 90 tokens

firebase

Use when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like a database open to the internet, a query rejected by rules, or a doc stuck at 1 write/sec. NOT managed-Postgres BaaS with SQL and RLS (that…

ericrisco/rsc-harness · 77 tokens