alembic-patterns

alembic-patterns is a skill for Claude Code, Codex from ruslan-korneev/claude-plugins. It costs 0 tokens per session (743 once invoked), scanned A, original, MIT.

A set of guidelines for writing and repairing Alembic database migrations. Alembic is a tool that records changes to a database structure, and an enum is a field limited to named values such as pending or active.

In plain words
What is it for?
Use it when creating migrations or investigating migration errors involving enums, arrays, nullable columns, or foreign keys.
Why use it?
It helps avoid migration errors involving enum fields, nullable values, and foreign-key operation order, especially when reversing a change.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the fastapi plugin — 2 skills, 5 commands, 1 agent shipped together

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.

agentmods
npx agentmods add skills/ruslan-korneev/claude-plugins/alembic-patterns
Any agent
npx skills add ruslan-korneev/claude-plugins --skill alembic-patterns
Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Made for: Claude Code, Codex.

Or install fastapi, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 1 agent.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/ruslan-korneev/claude-plugins/alembic-patterns.svg)](https://agentmods.dev/skills/ruslan-korneev/claude-plugins/alembic-patterns)
Your own site
<a href="https://agentmods.dev/skills/ruslan-korneev/claude-plugins/alembic-patterns"><img src="https://agentmods.dev/badge/skills/ruslan-korneev/claude-plugins/alembic-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 743 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.00743
Opus 5 $0.00000 $0.00371
Sonnet 5 $0.00000 $0.00149
Haiku 4.5 $0.00000 $0.00074

Measured 5d ago against content hash 6cc8b50f8846, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

alembic-patterns 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 5d 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.

plugins/fastapi/skills/alembic-patterns/SKILL.md · 132 lines

How it starts

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

Alembic Patterns

Alembic migration patterns with automatic handling of problematic types.

Triggers

Use this skill when the user:

  • Creates an Alembic migration
  • Gets errors during migration
  • Works with enum, array, nullable changes

Main principle: Automatic fixing

Alembic does not always correctly generate downgrade. The plugin automatically:

  • Adds enum deletion in downgrade
  • Warns about nullable changes without data migration
  • Checks the order of FK operations

Enum types

More details: ${CLAUDE_PLUGIN_ROOT}/skills/alembic-patterns/references/enum-handling.md

Creating table with enum

status_type = sa.Enum("pending", "active", "inactive", name="status_type")

def upgrade() -> None:
    op.create_table(
        "orders",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("status", status_type, nullable=False),
        sa.PrimaryKeyConstraint("id"),
    )

def downgrade() -> None:
    op.drop_table("orders")
    status_type.drop(op.get_bind(), checkfirst=False)  # IMPORTANT!

Adding column with enum

def upgrade() -> None:
    status_type = sa.Enum("pending", "active", name="status_type")
    status_type.create(op.get_bind(), checkfirst=True)
    op.add_column("orders", sa.Column("status", status_type))

def downgrade() -> None:
    op.drop_column("orders", "status")
    # Delete only if enum is not used elsewhere
    # sa.Enum(name="status_type").drop(op.get_bind(), checkfirst=True)

Nullable changes

# Changing NULL -> NOT NULL
def upgrade() -> None:
    # First update data
    op.execute("UPDATE users SET name = 'Unknown' WHERE name IS NULL")
    # Then change constraint
    op.alter_column("users", "name", nullable=False)

def downgrade() -> None:
    op.alter_column("users", "name", nullable=True)

Foreign Keys

# Correct order in downgrade
def downgrade() -> None:
    # First delete FK
    op.drop_constraint("fk_orders_user_id", "orders", type_="foreignkey")
    # Then table
    op.drop_table("users")

Read the full file on GitHub · 132 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 132 lines · 0 tokens per session scan A 6cc8b50f8846

Subscribe to this mod's changes

alembic-patterns is a skill published in the GitHub repository ruslan-korneev/claude-plugins (4 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 743 tokens. 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

lyric-writer

Writes or reviews lyrics with professional prosody, rhyme craft, and quality checks. Use when writing new lyrics, revising existing lyrics, or when the user says 'let's work on a track.'.

bitwize-music-studio/claude-ai-music-skills · 45 tokens

suno-engineer

Constructs technical Suno V5/V5.5 style prompts, selects genres, and optimizes generation settings. Use when creating or refining Suno prompts for track generation.

bitwize-music-studio/claude-ai-music-skills · 40 tokens

album-conceptualizer

Designs album concepts, tracklist architecture, and thematic planning through 7 structured phases. Use when planning a new album or reworking an existing album concept.

bitwize-music-studio/claude-ai-music-skills · 38 tokens

lyric-refiner

Autonomous multi-pass lyric refinement for tightening, cohesion, and album unity. Use after lyrics are written to polish a track or entire album through iterative passes.

bitwize-music-studio/claude-ai-music-skills · 36 tokens

mastering-engineer

Guides audio mastering for streaming platforms including loudness optimization and tonal balance. Use when the user has approved tracks and wants to master audio files.

bitwize-music-studio/claude-ai-music-skills · 34 tokens

mix-engineer

Polishes raw Suno audio by processing per-stem WAVs (vocals, backingvocals, drums, bass, guitar, keyboard, strings, brass, woodwinds, percussion, synth, other) with targeted cleanup, EQ, and compression, then remixing into a polished stereo WAV ready for mastering. Use after audio import and before mastering.

bitwize-music-studio/claude-ai-music-skills · 76 tokens