# alembic

A skill that walks your agent through Alembic migrations on SQLAlchemy projects, from alembic init to production rollout and rollback.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 644 installs · ★ 62
- Author: Customer Support Tech Enablement Team
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/manutej/luxor-claude-marketplace/tree/HEAD/plugins/luxor-database-pro/skills/alembic/SKILL.md
- Updated: 2026-06-13
- HTML: https://affpapa.org/en/nevibecode/skills/alembic

## What it does

The skill covers the whole Alembic loop: hand-written revisions and `--autogenerate`, data migrations during schema changes, and the path from dev to staging to production. It ships code samples for `env.py`, pulling `DATABASE_URL` from environment variables, and adding columns and indexes to a `tickets` table.

Autogenerate gets its own section. The agent will flag that the output needs a human pass: a renamed column shows up as a drop plus an add, a type change needs data conversion, and complex constraints and data migrations never make it into the generated file. That is the reason not to run `alembic upgrade head` right after generating.

Dependencies are `alembic>=1.13.0`, `sqlalchemy>=2.0.0`, `psycopg2-binary>=2.9.0` and `pytest>=7.0.0`. The examples assume PostgreSQL and support-desk tables: tickets, satisfaction ratings, schema versioning. On another database engine you will rewrite the connection setup.

## Requirements
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill alembic -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/alembic/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/alembic/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill alembic -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/alembic/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill alembic -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/alembic/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install manutej/luxor-claude-marketplace alembic
```

2. **Manually: put the files in place**
- File: `.github/skills/alembic/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill alembic -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/manutej/luxor-claude-marketplace --path plugins/luxor-database-pro/skills/alembic
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/alembic/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add manutej/luxor-claude-marketplace --skill alembic -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/manutej/luxor-claude-marketplace/tree/HEAD/plugins/luxor-database-pro/skills/alembic/SKILL.md

## When to use it
- write an Alembic revision for a new column on the tickets table
- backfill data when a column type or value set changes
- roll back a failed migration in production
- read the connection string from environment variables
- review an autogenerated revision before deploy

## Example prompts
- create an Alembic migration for a priority column on tickets
- write a data migration that maps old ticket statuses to the new enum
- review this autogenerated revision and tell me what it missed

## Similar
- [neon-postgres](https://affpapa.org/en/nevibecode/skills/neondatabase-neon-postgres.md) — skill · 281100 installs
- [databases](https://affpapa.org/en/nevibecode/skills/databases.md) — skill · 435 installs
- [neon-postgres-branches](https://affpapa.org/en/nevibecode/skills/neon-postgres-branches.md) — skill · 31200 installs
- [database-migrations](https://affpapa.org/en/nevibecode/skills/database-migrations.md) — skill · 5200 installs
- [planetscale-schema-recommendations-agent-loop](https://affpapa.org/en/nevibecode/skills/planetscale-schema-recommendations-agent-loop.md) — skill · 1800 installs

From the same set: [manutej/luxor-claude-marketplace](https://affpapa.org/en/nevibecode/by/manutej/luxor-claude-marketplace.md) — 31 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
