run-migration

run-migration is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 197 tokens per session (4,018 once invoked), scanned A, original, MIT.

A careful procedure for changing the structure of a local Drift/SQLite database. SQLite is a file-based database, and Drift is a Flutter library for working with it.

In plain words
What is it for?
Use it to snapshot the database, apply an ordered forward-only migration, test it, and restore the snapshot if something fails.
Why use it?
It protects data stored only on a device, where a failed schema change could permanently destroy records with no server copy to restore them.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the flutter plugin — 40 skills shipped together

Good fit Use it to snapshot the database, apply an ordered forward-only migration, test it, and restore the snapshot if something fails.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/run-migration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zakariaf/Flutter-Skills --skill run-migration
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

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 run-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/run-migration.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/run-migration)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/run-migration"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/run-migration.svg" alt="Measured on agentmods" height="20"></a>
Per session 197 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,018 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.00197 $0.04018
Opus 5 $0.00098 $0.02009
Sonnet 5 $0.00039 $0.00804
Haiku 4.5 $0.00020 $0.00402

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

Security

Grade A, and why

run-migration 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 7d 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.

skills/run-migration/SKILL.md · 332 lines

How it starts

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

Run migration (forward-only Drift schema migration)

Apply a schema change to a local Drift/SQLite database by following the exact ordered ritual below. In an offline-first app there is no server and no re-sync path, so the on-device DB is the single source of truth: a migration that drops or corrupts a column permanently destroys hand-entered records that exist nowhere else, and with no telemetry nobody ever reports it — the user just uninstalls. This is a manual, low-freedom, human-run workflow. Execute the steps in order; do not improvise, reorder, or skip.

Non-negotiable rules

  1. Take the pre-migration snapshot FIRST — before the database is opened. Do it at the composition boundary that opens AppDatabase, never inside onUpgrade: PRAGMA wal_checkpoint(TRUNCATE) any live handle so the -wal is folded into the main file, then copy the DB file and its -wal/-shm sidecars while nothing holds the file open. Opening the database is what triggers the migration. Never copy or overwrite bytes under a live connection. The snapshot is the only "rollback" SQLite has; restore it on any failure.
  2. Forward-only. Never write a down migration. SQLite has no true down migration and you must not pretend to. "Rollback" means restore the snapshot, nothing else.
  3. Steps are append-only — NEVER edit a shipped step. Editing a released step corrupts data for every user who skips versions. To fix a bug in a prior step, add a new step and bump schemaVersion — never back-edit history.
  4. Bump schemaVersion by exactly one per shipped schema change, and add the matching fromNToM branch. A schema changed without a version bump means no migration runs at all on the user's device — a CI gate must catch it.
  5. Commit the versioned schema snapshot. Run drift_dev make-migrations (or schema dump), commit the exported snapshot under drift_schemas/, and commit schema_versions.dart. The delta becomes a reviewable diff and the test suite diffs live schema against it.
  6. The open is wrapped in try/restore, entirely outside any connection. If opening the database throws, the migration failed and that connection is dead: close it, restore the snapshot file(s) taken before the open, and rethrow. All file operations happen while nothing has the DB open — never overwrite the live file from inside onUpgrade.
  7. A green shape check is necessary, never sufficient. migrateAndValidate compares CREATE statements only — it never reads a row. A migration that rebuilds a table perfectly and copies zero rows passes it, green. The content test is the deliverable, not the shape test.
  8. No migration merges without the full test suite green — every from → to path (including multi-version jumps), a content test per new pair, PRAGMA integrity_check == ok, PRAGMA foreign_key_check empty, and a forced mid-migration throw that restores the snapshot.
  9. Store canonical values only in any new column (integer minor units for money keyed to the ISO-4217 exponent, SI integers for quantities, UTC epoch millis for instants, a local serial-day integer for a calendar date). Never add a float-money, display-string, or localized-numeral column.

Read the full file on GitHub · 332 lines

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. 7d ago First seen · 332 lines · 197 tokens per session scan A ae44cb44f0d5

Subscribe to this mod's changes

run-migration is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 9d ago), licensed MIT. It adds 197 tokens to every session and 4,018 once invoked, about $0.0010 per session on Opus 5. 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

system-design-data-architecture

Choose and scale the data layer: SQL versus NoSQL per access pattern, single data ownership, replication and read scaling, partition key choice, hot partition and celebrity key mitigation. Use when selecting a store, planning sharding, or fixing a data-tier bottleneck.

HoangNguyen0403/agent-skills-standard · 59 tokens

database-hana

Apply SAP HANA database standards for SQL parameterization, in-memory engine optimization, dynamic IN query chunking, column aliasing on joins, and datatype casting. Use when writing SQL for SAP HANA, optimizing HANA queries, or diagnosing HANA driver errors.

HoangNguyen0403/agent-skills-standard · 57 tokens

database-postgresql

Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or query-performance work for PostgreSQL.

HoangNguyen0403/agent-skills-standard · 40 tokens

database-redis

Optimize Redis as cache and coordination infrastructure with TTL, eviction, and latency-aware key design. Use when implementing Redis caching, key invalidation, or Redis performance work.

HoangNguyen0403/agent-skills-standard · 37 tokens

database-mongodb

Apply MongoDB data-modeling, indexing, and query rules from access patterns. Use when designing schemas, choosing embed vs reference, or tuning MongoDB query behavior.

HoangNguyen0403/agent-skills-standard · 37 tokens

database-schema-design

Design relational or document schemas from access patterns, cardinality, and lifecycle. Use when modeling entities, choosing embed vs normalize, or shaping schema boundaries before implementation.

HoangNguyen0403/agent-skills-standard · 36 tokens