/mattpocock-skills:safe-migrationsfrom mattpocock-skills
Disciplined zero-downtime database schema migrations and data evolution. Use when modifying database schemas, writing SQL or ORM migrations (Prisma, Drizzle, TypeORM), running ALTER TABLE, adding or dropping columns, renaming fields, altering column types, or adding indexes without table locks.
Ships in mattpocock-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Zero-downtime database schema evolution and data migration discipline.
Applying schema changes in production environments with live web traffic and concurrent workers requires strict backward compatibility. A direct destructive change (dropping a column, renaming a field, changing a type in-place) triggers immediate failures: running application instances crash when querying obsolete columns, or long table locks stall transaction pools.
This skill governs schema changes during /to-tickets and /implement.
Never execute destructive or blocking DDL in a single deployment:
DROP COLUMN directly: Old application workers still running during a rolling deployment will fail when selecting or writing to the dropped column.RENAME COLUMN directly: Renaming is a drop and re-add in disguise. It instantly breaks all currently running code.ALTER COLUMN TYPE in place: Changing a type requires a full table rewrite and an exclusive table lock in most engines (such as PostgreSQL or MySQL).NOT NULL without a safe default: Adding a NOT NULL constraint to an existing table without a default forces a full-table validation scan under an exclusive lock.CREATE INDEX CONCURRENTLY. Never create indexes or foreign key constraints without non-blocking options on high-traffic tables.SET lock_timeout = '3s';) so migration transactions abort quickly instead of queueing behind long-running queries and starving web traffic.Any breaking schema modification (renaming a column, splitting data, changing data types, or introducing mandatory relationships) must be decomposed into three separate deployment phases across tickets:
nullable (or with a safe default value).Keep schema mechanics and dual-write logic inside persistence adapters (repositories or stores). Never leak dual-write concerns into core domain entities or UI layers:
/to-ticketsWhen /to-tickets processes a feature requiring database schema evolution, it must verify:
CREATE INDEX CONCURRENTLY or appropriate non-blocking options?lock_timeout configured in the migration runner?What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub op3616windows/superskills --plugin mattpocock-skills50 skills in this plugin
/ask-mattAsk which skill or flow fits your situation. A router over the skills in this repo./brownfield-onboardSurvey an existing brownfield codebase, detect conflicting domain terminology, and bootstrap GLOSSARY.md and foundational ADRs./chief-of-staffPursue a long-running goal in a single session by co-ordinating subagents./claude-handoffHand the current conversation off to a fresh background agent that picks up the work immediately.