alembic-migration

alembic-migration is a skill for Claude Code from vstorm-co/full-stack-ai-agent-template. It costs 56 tokens per session (552 once invoked), scanned A, original, MIT.

A guide for managing PostgreSQL database structure changes with Alembic, a tool used with SQLAlchemy. It covers creating, checking, and applying numbered migration files.

In plain words
What is it for?
Use it when changing SQLAlchemy models, updating the PostgreSQL schema, or backfilling existing data. It helps generate migrations, review upgrade and rollback steps, and verify the database reaches the latest version.
Why use it?
It helps keep changes to tables, columns, indexes, constraints, and stored data deliberate and reversible. It also reduces the risk of applying an autogenerated change that does something unexpected.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when changing SQLAlchemy models, updating the PostgreSQL schema, or backfilling…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vstorm-co/full-stack-ai-agent-template/alembic-migration
About the project

Full-Stack AI Agent Template generates full-stack AI applications with a FastAPI backend and Next.js frontend, including agents, retrieval-augmented generation, streaming, authentication, and integrations. It is for building AI products with features such as chat, conversation sharing, administration, and multiple agent or vector-database choices. Catalogue add-ons support the generated applications and their agent workflows.

vstorm-co/full-stack-ai-agent-template · 1,879 stars · on GitHub · vstorm-co.github.io

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 vstorm-co/full-stack-ai-agent-template --skill alembic-migration
Clone the repo
git clone --depth 1 https://github.com/vstorm-co/full-stack-ai-agent-template

Made for: Claude Code.

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 alembic-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/vstorm-co/full-stack-ai-agent-template/alembic-migration.svg)](https://agentmods.dev/skills/vstorm-co/full-stack-ai-agent-template/alembic-migration)
Your own site
<a href="https://agentmods.dev/skills/vstorm-co/full-stack-ai-agent-template/alembic-migration"><img src="https://agentmods.dev/badge/skills/vstorm-co/full-stack-ai-agent-template/alembic-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 552 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.00056 $0.00552
Opus 5 $0.00028 $0.00276
Sonnet 5 $0.00011 $0.00110
Haiku 4.5 $0.00006 $0.00055

Measured 7d ago against content hash db4fedbdf500, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

alembic-migration 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 7d 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.

template/{{cookiecutter.project_slug}}/.claude/skills/alembic-migration/SKILL.md · 42 lines

What it actually says

Alembic Migrations

This project uses async SQLAlchemy 2.0 + Alembic on PostgreSQL. Migrations live in backend/alembic/versions/ and are numbered (0001_…, 0002_…).

Workflow

  1. Change the model first in backend/app/db/models/ (Mapped[...] + mapped_column(), __repr__, relationships with ondelete="CASCADE"). Make sure the model is imported in backend/app/db/models/__init__.py so autogenerate sees it.

  2. Autogenerate the migration:

    cd backend && uv run alembic revision --autogenerate -m "add <thing>"
    # or: make db-migrate
    
  3. ALWAYS review the generated file. Autogenerate is a draft, not the truth:

    • Confirm upgrade() matches your intent and downgrade() actually reverses it.
    • Check the down_revision chains onto the current head (uv run alembic heads).
    • Watch for dropped columns/tables you didn't intend, server defaults, enum changes, and JSON/array types.
    • Name the revision file with the next sequential prefix to match the existing convention.
  4. Apply and verify:

    cd backend && uv run alembic upgrade head   # or: make db-upgrade
    uv run alembic current                       # confirm at head
    

    Then round-trip once to prove downgrade() works: alembic downgrade -1 && alembic upgrade head.

Data migrations / backfills

For backfills, add explicit op.execute(...) or a small data-loop in upgrade() (see the existing *_backfill_*.py migrations for the pattern). Keep schema and data changes in separate, well-named revisions when practical.

Rules

  • Never edit a migration that has already been applied in shared environments — add a new one.
  • make dev / make bootstrap run alembic upgrade head automatically; you don't need a separate step in dev.
  • Keep models and migrations in sync — a model change without a migration will pass tests (sessions are mocked) but break on real Postgres.
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. 7d ago First seen · 42 lines · 56 tokens per session scan A db4fedbdf500

Subscribe to this mod's changes

alembic-migration is a skill published in the GitHub repository vstorm-co/full-stack-ai-agent-template (1,879 stars, last pushed 3d ago), licensed MIT. It adds 56 tokens to every session and 552 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

sqlalchemy-models

Create or modify SQLAlchemy models, queries, and Alembic migrations. Use when: defining new database tables, writing queries, creating migrations, checking model conventions, or understanding the database layer.

tedivm/robs_awesome_python_template · 44 tokens

后端编码

A backend coding guide covering web APIs, databases, error handling, logging, and endpoint tests. Backend code runs on servers and handles data and application operations.

jianchen08/Agent-os-open · 49 tokens

database-management

Standards for SQLAlchemy async models, PostgreSQL indexing, UTC datetimes, and Alembic migrations.

aps08/fullstack-clean-architecture · 25 tokens

SQLAlchemy ORM Expert

Comprehensive SQLAlchemy skill for customer support tech enablement, covering ORM patterns, session management, query optimization, async operations, and PostgreSQL integration.

manutej/luxor-claude-marketplace · 34 tokens

postgres-patterns

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Quick reference for common patterns, index types, data types, and anti-pattern detection. Based on Supabase best practices.

affaan-m/ECC · 45 tokens

stripe-projects

Use when the user wants to provision infrastructure or third-party services using Stripe Projects. Triggers: "I need a database", "set up auth", "add caching", "give me a Postgres", "provision Redis", "I need hosting", "add a vector DB", "get me an API key for X", "get credentials for X", "sign up for a service", "set…

stripe/ai · 213 tokens