claude-scaffold: Skill for Claude Code

.claude/skills/database-migration-safety/SKILL.md

database-migration-safety is a skill for Claude Code from pyramidheadshark/claude-scaffold. It costs 0 tokens per session (729 once invoked), scanned A, original, MIT.

A skill for handling database migrations, which are changes to a database's structure or data, such as adding a column or changing a table. It applies to Alembic, SQL migration files, schema changes, and related work.

In plain words
What is it for?
Use it when creating or reviewing migrations, upgrades, downgrades, schema changes, ALTER TABLE statements, or SQL files.
Why use it?
It checks for reversibility, staging tests, backups, possible data loss, and safer handling of large tables before changes reach production.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is pyramidheadshark/claude-scaffold's own configuration. It tells Claude Code how to work on claude-scaffold itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-scaffold configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pyramidheadshark/claude-scaffold. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/pyramidheadshark/claude-scaffold/main/.claude/skills/database-migration-safety/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/pyramidheadshark/claude-scaffold

Made for: Claude Code.

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 database-migration-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/database-migration-safety/github.svg)](https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/database-migration-safety)
Your own site
<a href="https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/database-migration-safety"><img src="https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/database-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 database-migration-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/pyramidheadshark/claude-scaffold/database-migration-safety"><img src="https://agentmods.dev/badge/skills/pyramidheadshark/claude-scaffold/database-migration-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 729 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.00000 $0.00729
Opus 5 $0.00000 $0.00365
Sonnet 5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

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

Security

Grade A, and why

database-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 9d 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.

.claude/skills/database-migration-safety/SKILL.md · 72 lines

How it starts

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

Skill: Database Migration Safety

When to Load

Auto-load when: working with Alembic, raw SQL migrations, schema changes, migrations/ directory, or *.sql files. Triggers on alembic, migration, upgrade, downgrade, schema, ALTER TABLE (≥2 keywords).

Core Rules

Every migration must satisfy these requirements before alembic upgrade head runs:

  1. Reversibledowngrade() must be implemented and tested. pass is not acceptable.
  2. Staged — run against a staging/dev database before production.
  3. Piloted — for data migrations over 1M rows, run on a 1% sample first.
  4. Snapshotted — take a DB snapshot/backup before any destructive operation (DROP, ALTER with data loss risk).

Pre-Migration Checklist

Before proposing or executing any migration:

[ ] downgrade() is implemented (not pass)
[ ] Migration tested on staging DB
[ ] For tables > 100k rows: migration is non-locking (CONCURRENT index, batched updates)
[ ] No data loss without explicit acknowledgment: DROP COLUMN, TRUNCATE, type narrowing
[ ] --autogenerate output reviewed manually (it misses: renames, indexes, check constraints)
[ ] Rollback plan documented: "If this fails in prod, run: alembic downgrade -1"

Anti-Patterns — Block on Detection

Anti-Pattern Risk Required Action
downgrade() is pass Irreversible migration Implement downgrade or get explicit sign-off
DROP COLUMN without nullable grace period Data loss on rollback Add nullable=True first, drop in next release
--autogenerate applied without review Silent schema drift Always diff before apply
alembic upgrade head in prod without staging Broken prod schema Require staging run first
Locking ALTER TABLE on large table Table lock, downtime Use CREATE INDEX CONCURRENTLY, batched UPDATE
Migration touches multiple unrelated models Hard to rollback atomically Split into separate migrations

Alembic-Specific Guidance

Read the full file on GitHub · 72 lines

Files

What ships with it

1 file 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. 9d ago First seen · 72 lines · 0 tokens per session scan A b07e0fb5d70f

Subscribe to this mod's changes

database-migration-safety is a skill published in the GitHub repository pyramidheadshark/claude-scaffold (4 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 729 tokens. 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-31.

Related

Other skills, from other repositories

benchling-integration

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

synthetic-sciences/openscience · 44 tokens

wordpress-plugin-fundamentals

Modern WordPress plugin development with PHP 8.3+, OOP architecture, hooks system, database interactions, and Settings API.

bobmatnyc/claude-mpm-skills · 32 tokens

lamindb

This skill should be used when working with LaminDB, an open-source data framework for biology that makes data queryable, traceable, reproducible, and FAIR. Use when managing biological datasets (scRNA-seq, spatial, flow cytometry, etc.), tracking computational workflows, curating and validating data with biological…

synthetic-sciences/openscience · 135 tokens

kubernetes-storage

Covers persistent data in the cluster — PersistentVolumes/Claims, StorageClasses and dynamic provisioning, access modes, StatefulSets, volume lifecycle, and reclaim policy so data survives rescheduling. Use this whenever the user is provisioning a PVC, choosing a StorageClass or access mode, running a stateful…

arjunprabhulal/devops-skills · 98 tokens

Vector Databases

Guides retrieval-store design, indexing, and query behavior for embedding-backed systems without confusing storage with application truth.

agentic-in/elephant-agent · 26 tokens

mle-workflow

Production ML engineering workflow — data contracts, reproducible training, evaluation gates, deployment, and monitoring. Use when building, reviewing, or hardening ML systems beyond notebooks.

chandrudp29/skillhub · 39 tokens