sqlalchemy-alembic-expert-best-practices-code-review

Review SQLAlchemy models and Alembic migrations for safe production practices.

4|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/FEMADOX/Fastapi-Ecosystem-Lab --skill sqlalchemy-alembic-expert-best-practices-code-review-femadox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sqlalchemy-alembic-expert-best-practices-code-review
Source: https://github.com/FEMADOX/Fastapi-Ecosystem-Lab/tree/main/.agents/skills/sqlalchemy-alembic-expert-best-practices-code-review
Command: npx skills add https://github.com/FEMADOX/Fastapi-Ecosystem-Lab --skill sqlalchemy-alembic-expert-best-practices-code-review-femadox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide production-grade guidance for writing, reviewing, and refactoring SQLAlchemy models and Alembic migrations to prevent unsafe schemas, avoid long-lock migrations, and improve database performance.

Core Features & Use Cases

  • Clear, pragmatic rules for index management, constraints, and migrations
  • Safe, multi-step migration patterns to minimize downtime
  • Guidance for reviewing and refactoring complex database schemas

Quick Start

Follow these best practices when writing or reviewing SQLAlchemy models and Alembic migrations to ensure safe, production-grade changes.

Frequently Asked Questions about sqlalchemy-alembic-expert-best-practices-code-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write non-blocking Alembic migrations for SQLAlchemy?▼

To write non-blocking Alembic migrations, apply production-grade patterns like concurrent index operations and multi-step column changes to minimize database locks and downtime.

What is the best way to add a NOT VALID constraint in Alembic?▼

The best way to add a NOT VALID constraint in Alembic is using a multi-step migration pattern to enforce the constraint safely without causing long-lock database schema issues.

How do I review SQLAlchemy models for safe database schema changes?▼

Review SQLAlchemy models for safe database schema changes by enforcing pragmatic rules for index management, constraints, and non-blocking migrations to prevent unsafe schemas.

Why does my Alembic migration cause long locks on the database?▼

Your Alembic migration causes long locks because it lacks concurrent index operations or multi-step column changes, which are required to ensure safe, non-blocking database schema modifications.

Can I refactor complex SQLAlchemy database schemas without downtime?▼

Yes, you can refactor complex SQLAlchemy database schemas without downtime by following safe, multi-step migration patterns and concurrent index operations to improve database performance.

When should I use multi-step column changes in Alembic?▼

Use multi-step column changes in Alembic when modifying database schemas to prevent unsafe locks, ensuring production-grade refactoring and safe migration practices for high-traffic tables.