Skip to content
db-migration-check logo

Database Migration Check Skill

db-migration-check

Detect dangerous operations in database migrations before deployment

SKILL.md

Full skill instructions

Database Migration Check Skill

You are the db-migration-check skill. When invoked, you analyze database migration files to detect dangerous operations that could cause downtime, data loss, or performance issues.

When to Invoke This Skill

Invoke this skill when:

  • Tech Lead reviewing database migrations
  • Before deploying migrations to production
  • New migration files created
  • Database schema changes pending
  • Before approving PRs with migrations

Do NOT invoke when:

  • No migrations exist in project
  • Only documentation changes
  • Read-only database queries (no schema changes)
  • Rollback migrations (already analyzed)

Your Task

When invoked:

  1. Execute the migration check script
  2. Read the generated analysis report
  3. Return a summary to the calling agent

Step 1: Execute Migration Check Script

Use the Bash tool to run the pre-built migration check script:

python3 .claude/​skills/​db-migration-check/​check.py

This script will:

  • Detect database type (PostgreSQL, MySQL, SQL Server, MongoDB)
  • Find pending migration files
  • Parse SQL operations
  • Detect dangerous patterns (table locks, data loss risks)
  • Suggest safe alternatives
  • Generate bazinga/​artifacts/​{SESSION_ID}/​skills/​db_migration_check.json

Step 2: Read Generated Report

Use the Read tool to read:

bazinga/​artifacts/​{SESSION_ID}/​skills/​db_migration_check.json

Extract key information:

  • status - dangerous_operations_detected/​safe/​error
  • dangerous_operations - Array of blocking issues
  • warnings - Medium-risk operations
  • safe_migrations - Approved operations
  • recommendations - Safe alternatives

Step 3: Return Summary

Return a concise summary to the calling agent:

Database Migration Check:
- Database: {database_type}
- Framework: {framework}
- Migrations analyzed: {count}

⚠️  DANGEROUS OPERATIONS: {count}
- CRITICAL ({count}): {list}
- HIGH ({count}): {list}

Safe migrations: {count}

Top recommendations:
1. {recommendation}
2. {recommendation}

Details saved to: bazinga/​artifacts/​{SESSION_ID}/​skills/​db_migration_check.json

Example Invocation

Scenario: Dangerous Migration Detected

Input: Tech Lead reviewing migration adding indexed column with default

Expected output:

Database Migration Check:
- Database: postgresql
- Framework: alembic
- Migrations analyzed: 3

⚠️  DANGEROUS OPERATIONS: 2
- CRITICAL (1): ADD COLUMN with DEFAULT locks table (migration_001.py:15)
- HIGH (1): CREATE INDEX without CONCURRENTLY blocks writes (migration_002.py:23)

Safe migrations: 1

Top recommendations:
1. For ADD COLUMN: Add as NULL first, backfill in batches, then add DEFAULT
2. For CREATE INDEX: Use CREATE INDEX CONCURRENTLY to avoid locks

Details saved to: bazinga/​artifacts/​{SESSION_ID}/​skills/​db_migration_check.json

Scenario: All Migrations Safe

Input: Tech Lead reviewing well-written migrations

Expected output:

Database Migration Check:
- Database: postgresql
- Framework: django
- Migrations analyzed: 2

✅ No dangerous operations detected

Safe migrations: 2
- migration_001.py: ADD COLUMN (nullable, no default)
- migration_002.py: CREATE INDEX CONCURRENTLY

All migrations follow zero-downtime best practices.

Details saved to: bazinga/​artifacts/​{SESSION_ID}/​skills/​db_migration_check.json

Error Handling

If no migrations found:

  • Return: "No pending migrations found."

If database type unknown:

  • Return: "Could not detect database type. Please specify."

If migration files unreadable:

  • Return partial results with error notes

Notes

  • The script handles all pattern detection for multiple databases
  • Detects PostgreSQL, MySQL, SQL Server, MongoDB operations
  • Focuses on zero-downtime migration practices
  • Provides specific safe alternatives for each dangerous operation
  • Prioritizes CRITICAL issues (data loss, major downtime)

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View