Sql Migration Safety Doctor

Catch the dangerous migration before it locks or wrecks your production database.

Install
cmdop skills install agensi-sql-migration-safety-doctor

The SQL Migration Safety Doctor is a specialized security and stability auditor for database migrations. It scans SQL files for destructive operations, heavy lock risks, and data integrity gaps before they ever hit your production environment. By identifying risky patterns like WHERE-less updates, lossy column changes, and non-concurrent index creation, it acts as a gatekeeper for your data layer. Prompting a generic AI for SQL reviews often misses subtle database-specific locking behaviors or platform-specific risks (like Postgres table locks). This skill uses a dedicated Python-based heuristic scanner combined with a rigorous audit checklist to provide evidence-based findings. It categorizes risks by severity—Critical to Info—and provides battle-tested remediation snippets to fix issues immediately. You receive a structured report detailing confirmed findings with file/line citations, a manual review checklist for complex logic, and specific SQL snippets to remediate the identified risks safely.