What problem does it solve? On-device Flutter apps with no server must rebuild all state from a single local SQLite database, so schema mistakes, torn backups, leaked ORM types, and lost transactions cause silent data corruption. This Skill enforces a disciplined Drift/SQLite data layer where invariants live in the schema and every mutation is one durable transaction. ## Core Features & Use Cases - Layer confinement: Restricts package:drift and package:sqlite3 imports to lib/data/ behind DAOs and repositories that map rows to immutable value objects, verified by grep-based check scripts. - Schema invariants: Enforces STRICT tables, CHECK constraints, foreign keys, partial UNIQUE indexes, canonical integer storage (minor-unit money, UTC epoch millis, serial-day integers), and keyset pagination instead of OFFSET. - Safe backups and pragmas: Re-asserts foreign_keys/WAL/synchronous pragmas on every open and backs up via wal_checkpoint(TRUNCATE) + VACUUM INTO with verify-by-reopen, never File.copy of a live WAL database. - Use Case: When adding a new Drift table or reviewing a data-layer diff in a Flutter app, apply this Skill to define the table with audit columns and CHECK constraints, wire the repository transaction, and run the confinement and ban scripts before the PR. ## Quick Start Use the persistence-drift skill to review my new Drift table and repository transaction in lib/data/ for schema invariants and confinement violations.