.claude/skills/ts-alembic/SKILL.md
Manage database migrations with Alembic. Use when a user asks to version database schemas, create migration scripts, handle schema changes in production, or manage SQLAlchemy model migrations.
npx skillsauth add eliferjunior/Claude alembicInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Alembic is the migration tool for SQLAlchemy. It tracks database schema changes as versioned Python scripts — like Git for your database. Supports autogeneration from model changes, branching, and data migrations.
pip install alembic
alembic init alembic
# alembic/env.py — Configure with async SQLAlchemy
from alembic import context
from sqlalchemy.ext.asyncio import create_async_engine
from models import Base
import asyncio
config = context.config
target_metadata = Base.metadata
def run_migrations_online():
connectable = create_async_engine(config.get_main_option("sqlalchemy.url"))
async def do_run():
async with connectable.connect() as connection:
await connection.run_sync(do_migrations)
def do_migrations(connection):
context.configure(connection=connection, target_metadata=target_metadata)
with context.begin_transaction():
context.run_migrations()
asyncio.run(do_run())
run_migrations_online()
# Auto-generate from model changes
alembic revision --autogenerate -m "add projects table"
# Create empty migration (for data migrations)
alembic revision -m "backfill user roles"
# alembic/versions/001_add_projects.py — Generated migration
def upgrade():
op.create_table('projects',
sa.Column('id', sa.String(36), primary_key=True),
sa.Column('name', sa.String(100), nullable=False),
sa.Column('owner_id', sa.String(36), sa.ForeignKey('users.id')),
sa.Column('created_at', sa.DateTime, server_default=sa.func.now()),
)
op.create_index('ix_projects_owner_id', 'projects', ['owner_id'])
def downgrade():
op.drop_index('ix_projects_owner_id')
op.drop_table('projects')
# alembic/versions/002_backfill_roles.py — Data migration
from alembic import op
import sqlalchemy as sa
def upgrade():
# Add column
op.add_column('users', sa.Column('role', sa.String(20), server_default='member'))
# Backfill existing rows
conn = op.get_bind()
conn.execute(sa.text("UPDATE users SET role = 'admin' WHERE email LIKE '%@mycompany.com'"))
def downgrade():
op.drop_column('users', 'role')
alembic upgrade head # apply all pending migrations
alembic downgrade -1 # rollback one migration
alembic history # show migration history
alembic current # show current revision
alembic upgrade +1 # apply next migration only
op.batch_alter_table() for SQLite (which doesn't support ALTER TABLE well).development
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.