What problem does it solve?
This Skill prevents AGH database schema drift by forcing every SQLite schema change to go through a numbered, registry-backed migration with transactional safety and idempotence.
Core Features & Use Cases
- Migration registry enforcement: Ensures schema changes are recorded and applied via the
schema_migrations mechanism instead of fragile EnsureSchema-style reconciliation.
- Transactional, idempotent DDL: Requires wrapping changes in
BEGIN IMMEDIATE, guarding against re-application, and making operations resume safely after partial runs.
- SQLite recovery hygiene: Verifies that when migrations touch SQLite recovery, the
-wal and -shm companion files are renamed alongside the .db to avoid corruption and missing-column failures after restarts.
- Test-driven migration correctness: Requires fresh-DB and reopen-after-restart tests to confirm schema expectations and data preservation/backfill behavior.
Quick Start
Use this skill when you are editing any AGH code path that issues SQLite DDL for persistent stores, and author a numbered migration that is registered, transactional, idempotent, recorded in schema_migrations, and covered by fresh DB and restart tests.