
SQL Migration Safety Doctor
Catch the dangerous migration before it locks or wrecks your production database. Scans SQL migration files for destructive and risky operations: DROP and TRUNCATE, drops without IF EXISTS, lossy column-type changes, NOT NULL added without a default, DELETE or UPDATE with no WHERE, non-concurrent index builds, dropped constraints, renames, and data backfills mixed into schema changes. Each finding is ranked by severity with a safer rewrite. Postgres, MySQL, and SQLite.
- Prevent production downtime caused by long-running table locks
- Identify destructive DROP and TRUNCATE statements before execution
- Detect lossy column type changes that could lead to data corruption
$12
· or 60 creditsSecure checkout via Stripe
Included in download
- Prevent production downtime caused by long-running table locks
- Identify destructive DROP and TRUNCATE statements before execution
- terminal, file_read automation included
- Ready for Works with Claude Code
Sample input
Check the new migration in migrations/20231024_add_user_index.sql for any safety issues.
Sample output
⚠️ High Risk: Non-Concurrent Index
- File:
migrations/20231024_add_user_index.sql - Line: 4
- Evidence:
CREATE INDEX idx_user_email ON users(email); - Impact: Will lock the
userstable for writes. - Remediation: Use
CREATE INDEX CONCURRENTLYin a separate transaction.
Catch the dangerous migration before it locks or wrecks your production database. Scans SQL migration files for destructive and risky operations: DROP and TRUNCATE, drops without IF EXISTS, lossy column-type changes, NOT NULL added without a default, DELETE or UPDATE with no WHERE, non-concurrent index builds, dropped constraints, renames, and data backfills mixed into schema changes. Each finding is ranked by severity with a safer rewrite. Postgres, MySQL, and SQLite.
$12
· or 60 creditsSecure checkout via Stripe
Included in download
- Prevent production downtime caused by long-running table locks
- Identify destructive DROP and TRUNCATE statements before execution
- terminal, file_read automation included
- Ready for Works with Claude Code
- Instant install
Sample input
Check the new migration in migrations/20231024_add_user_index.sql for any safety issues.
Sample output
⚠️ High Risk: Non-Concurrent Index
- File:
migrations/20231024_add_user_index.sql - Line: 4
- Evidence:
CREATE INDEX idx_user_email ON users(email); - Impact: Will lock the
userstable for writes. - Remediation: Use
CREATE INDEX CONCURRENTLYin a separate transaction.
About This Skill
What it does
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.
Why use this skill
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.
Supported tools and workflows
- SQL Dialects: Optimized for Postgres, MySQL, and standard SQL patterns.
- Framework Agnostic: Works with migrations from Rails, Django, Prisma, Flyway, Liquibase, or raw SQL files.
- DevOps Integration: Ideal for pre-commit hooks or CI/CD pipeline simulations.
Output format
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.
,sample_input:Use Cases
- Prevent production downtime caused by long-running table locks
- Identify destructive DROP and TRUNCATE statements before execution
- Detect lossy column type changes that could lead to data corruption
- Ensure all UPDATE and DELETE statements include safe WHERE clauses
Known Limitations
- Heuristic static scan; it does not connect to or run against your database and cannot measure real lock duration on your data.
- Lock impact and rollback strategy on large tables still need human judgment.
- Dialect coverage focuses on Postgres, MySQL, and SQLite patterns.
How to Install
mkdir -p ~/.claude/skills && curl -sL https://www.agensi.io/api/install/sql-migration-safety-doctor -o /tmp/sql-migration-safety-doctor.zip && unzip -o /tmp/sql-migration-safety-doctor.zip -d ~/.claude/skills && rm /tmp/sql-migration-safety-doctor.zipFree skills install directly. Paid skills require purchase - use the download button above after buying.
Reviews
No reviews yet - be the first to share your experience.
Only users who have downloaded or purchased this skill can leave a review.
Early access skill
Be the first to review this skill.
Only users who have downloaded or purchased this skill can leave a review.
Security Scanned
Passed automated security review
Permissions
File Scopes
Read-only inspection first. The bundled scanner reads matching .sql files and prints markdown or JSON findings. It installs nothing, transmits nothing, modifies nothing, and never connects to a database. Any write, install, deploy, or live-account action requires explicit user confirmation.
Works with Claude Code, Codex CLI, Cursor, OpenCode/OpenClaw, Gemini CLI, and other agents that load SKILL.md folders. The bundled scanner uses the Python 3 standard library only and degrades to manual checklist mode when Python or matching files are unavailable.
Creator
JustHandled Labs creates focused agent skills and workflow packs for Claude, Codex, Cursor, and AI-assisted builders. Each tool is designed around a real repeatable task: cleaner commits, better PRs, stronger handoffs, safer repo hygiene, clearer documentation, and less copy-paste chaos. The goal is not generic AI productivity. The goal is specific workflows that are easier to run, review, and repeat. Maintained by H.J. Westerfield, with a background in communications, editing, project coordination, customer support, and practical AI systems. JustHandled Labs builds tools for people who want useful automation without theatrical complexity.
Frequently Asked Questions
Learn More About AI Agent Skills
More Premium Skills
Multi-Agent Orchestration Master Library
Transform Claude Code into a coordinated multi-agent system. Battle-tested tmux orchestration patterns, YAML task queues, event-driven communication, and parallel worker management for 8+ agents.

inline-comment
Best way to steer your agents, effortlessly.
designing-hybrid-context-layers
Architects the right retrieval strategy for every query — teaching your agent when to use RAG, a knowledge graph, or a temporal index instead of defaulting to vector search for everything.
consumer-motivation-analyzer
Go beyond surface-level feedback to uncover the psychological drivers and hidden motivations behind buyer behavior.