skills/practices/migration-safety/SKILL.md
Zero-downtime database migration patterns — safe column additions, index creation, data backfills, and rollback strategies. Use when writing or reviewing database migrations for production systems.
npx skillsauth add devjarus/coding-agent migration-safetyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| What you want to do | How to do it safely | |---|---| | Add nullable column | Single migration, safe | | Add NOT NULL column | Add nullable → backfill → add constraint | | Rename column | Add new → copy data → update code → drop old | | Drop column | Stop reading in code → deploy → drop column | | Add index | CREATE INDEX CONCURRENTLY | | Change column type | Add new column with new type → migrate data → swap code → drop old | | Add enum value | ALTER TYPE ADD VALUE (safe in Postgres) | | Remove enum value | Never (create new enum type instead) |
testing
Multi-source research method — decompose a question, fan out parallel investigators, interleaved-think each result, verify claims adversarially, synthesize a cited answer. Use for breadth-heavy research, stack comparisons, "which approach wins" questions.
testing
Decide when to use unit vs integration vs e2e tests, and when to mock vs use the real thing per dependency. Dependency injection is the enabler — without it you end up monkey-patching imports. Apply when writing tests of any kind.
development
Test-driven development process — write failing test, implement to pass, refactor. Use when implementing any feature or fixing bugs.
development
Patterns for sharing types, API contracts, and validation schemas between frontend and backend. Use when multiple domains consume the same data shapes to prevent contract drift.