Migration Safety Check

Assess Alembic migration files for risky operations and revision chain issues.

1|1|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/btabaska/simpler-grants-documentation-automation --skill migration-safety-check
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Migration Safety Check
Source: https://github.com/btabaska/simpler-grants-documentation-automation/tree/main/.cursor/skills/skill-migration-safety-check
Command: npx skills add https://github.com/btabaska/simpler-grants-documentation-automation --skill migration-safety-check

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Catch migration foot-guns before they reach a production deploy. Simpler-grants-gov runs FedRAMP-Moderate Postgres with online deploys; certain Alembic operations either lock tables, break older app revisions still in flight, or violate audit-log requirements.

Core Features & Use Cases

  • Deterministic risk rules for Alembic migrations.
  • Verification of revision chains and compliance with audit requirements.
  • Guidance on safe patterns and multi-step deploys.

Quick Start

Provide the Alembic migration file path under api/src/db/migrations/versions/ to run a safety assessment.

Frequently Asked Questions about Migration Safety Check

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

FAQPage Schema
How do I check Alembic migrations for unsafe operations before a production deploy?

You can check Alembic migrations for unsafe operations by applying deterministic risk rules to migration files, which flags risky database changes like table drops or adding NOT NULL columns without defaults before they impact production.

What Alembic migration operations are considered unsafe for Postgres production deployments?

Unsafe Alembic migration operations include table drops, adding NOT NULL constraints without defaults, and broken downgrade paths, all of which can lock tables or break older application revisions still in flight during online deploys.

How do I validate Alembic revision chains and ensure FedRAMP audit compliance?

To validate Alembic revision chains and ensure FedRAMP audit compliance, run a safety assessment that cross-references migration files with project documentation and verifies the integrity of the revision chain.

Can I automate migration safety audits for files added or modified under api/src/db/migrations/versions/?

Yes, you can automate migration safety audits by triggering risk assessments whenever files are added or modified under the api/src/db/migrations/versions/ directory, surfacing deployment risks automatically.

Why does my Alembic migration break older application revisions during an online deploy?

Your Alembic migration likely breaks older application revisions during an online deploy because it introduces incompatible schema changes, such as dropping columns or tables that the running application still expects to exist.

What is the best way to identify Alembic migrations that violate audit log requirements?

The best way to identify Alembic migrations that violate audit log requirements is to enforce consistent safety rules that cross-reference migration operations with project documentation and FedRAMP compliance standards.