gorm-sql-migration-safety

gorm-sql-migration-safety is a skill for Claude Code, Codex from saifoelloh/golang-best-practices-skill. It costs 65 tokens per session (688 once invoked), scanned A, original, MIT.

A review guide for database schema changes in GORM and PostgreSQL. A migration is a controlled change to a database's tables, columns, indexes, or constraints.

In plain words
What is it for?
Use it when writing or reviewing SQL migrations, GORM AutoMigrate use, new columns or indexes, constraints, table changes, and rollback files.
Why use it?
It helps prevent downtime, incomplete rollbacks, unsafe required columns, and migration problems during production deployments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or reviewing SQL migrations, GORM AutoMigrate use, new columns or indexes, constraints, table changes, and rollback files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saifoelloh/golang-best-practices-skill/migration-safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add saifoelloh/golang-best-practices-skill --skill migration-safety
Clone the repo
git clone --depth 1 https://github.com/saifoelloh/golang-best-practices-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gorm-sql-migration-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/migration-safety/github.svg)](https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/migration-safety)
Your own site
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/migration-safety"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/migration-safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gorm-sql-migration-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/migration-safety"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/migration-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 688 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00065 $0.00688
Opus 5 $0.00032 $0.00344
Sonnet 5 $0.00013 $0.00138
Haiku 4.5 $0.00006 $0.00069

Measured 12d ago against content hash b57dd3513477, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

gorm-sql-migration-safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

migration-safety/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Priority Count Focus
Critical 3 AutoMigrate in production, NOT NULL backfill, missing rollback
High 2 CONCURRENTLY indexes, idempotent migrations
Medium 1 DROP 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"

Read the full file on GitHub · 76 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 76 lines · 65 tokens per session scan A b57dd3513477

Subscribe to this mod's changes

gorm-sql-migration-safety is a skill published in the GitHub repository saifoelloh/golang-best-practices-skill (15 stars, last pushed 6mo ago), licensed MIT. It adds 65 tokens to every session and 688 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

multitenant

Architecture multitenant avec approche tiered (Shared/Dedicated Schema/DB), RBAC/ABAC, field-level encryption. Use when working with multitenant applications, tenant isolation, data segregation.

TheBeardedBearSAS/claude-craft · 0 tokens

postgres-drizzle

Proactively apply when creating APIs, backends, or data models. Triggers on PostgreSQL, Postgres, Drizzle, drizzle-orm, drizzle-kit, database, schema, pgTable, tables, columns, indexes, queries, migrations, ORM, relations, relational queries, joins, transactions, SQL, connection pooling, PgBouncer, N+1, JSONB, RLS…

ccheney/robust-skills · 119 tokens

testing-paperclip

Paperclip-Testing-Strategie — Vitest, Plugin-Test-Harness aus @paperclipai/plugin-sdk/testing, echte Postgres-Integration-Tests, Cross-Tenant-Isolation. Verwenden Sie dies beim Schreiben oder Reviewen von Paperclip-Tests.

TheBeardedBearSAS/claude-craft · 57 tokens

database-management

Standards for SQLAlchemy async models, PostgreSQL indexing, UTC datetimes, and Alembic migrations.

aps08/fullstack-clean-architecture · 25 tokens

postgres-patterns

PostgreSQL database patterns for query optimization, schema design, indexing, and security. Based on Supabase best practices.

emilioforrer/go-stack · 28 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens