agentsclimarketplace

Migration safety

Skill saifoelloh/golang-best-practices-skill/migration-safety

Production-ready Go code review skill for AI agents based on authoritative sources

Install
npx -y skills add saifoelloh/golang-best-practices-skill --skill migration-safety

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 16 stars16 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Database migration safety review for GORM + PostgreSQL. Use when writing or reviewing schema changes, AutoMigrate usage, ALTER TABLE statements, or index creation. Covers zero-downtime patterns, NOT NULL backfill, CONCURRENTLY indexes, idempotency, and rollback files.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.8 KB, as published. Nobody here has run it

Migration Safety

Expert-level review of database migration safety for production PostgreSQL deployments. Ensures zero-downtime schema changes, correct rollback capability, and idempotent migrations.

When to Apply

Use this skill when:

  • Writing new migration files (*.up.sql, *.down.sql)
  • Using GORM AutoMigrate
  • Adding columns, indexes, or constraints to existing tables
  • Dropping columns or tables
  • Reviewing migrations before deploying to production

Zero-Downtime Migration Checklist

Before any production migration:

  • NOT NULL column has DEFAULT or backfill migration first
  • Indexes use CONCURRENTLY
  • Migration is idempotent (IF NOT EXISTS / IF EXISTS)
  • down.sql rollback file exists and is tested
  • DROP COLUMN is in a separate deploy after code references removed
  • AutoMigrate is not in the application startup path

Rule Categories

PriorityCountFocus
Critical3AutoMigrate in production, NOT NULL backfill, missing rollback
High2CONCURRENTLY indexes, idempotent migrations
Medium1DROP COLUMN deprecation period

Rules Covered (6 total)

Critical Issues (3)

  • critical-no-automigrate-production — Never run AutoMigrate in production startup path
  • critical-not-null-backfill — NOT NULL column addition requires 3-step migration
  • critical-always-provide-rollback — Every migration must have a paired down.sql

High-Impact Patterns (2)

  • high-create-index-concurrently — Use CREATE INDEX CONCURRENTLY to avoid write locks
  • high-idempotent-migration — Use IF NOT EXISTS / IF EXISTS for safe re-runs

Medium Improvements (1)

  • medium-drop-column-deprecation — Deprecate before dropping — never drop in same deploy as code changes

Trigger Phrases

  • "Review this migration"
  • "Is this migration safe?"
  • "ALTER TABLE"
  • "ADD COLUMN / DROP COLUMN"
  • "CREATE INDEX"
  • "AutoMigrate"
  • "Schema change"
  • "Zero-downtime migration"

Related Skills

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.