Skip to content
Agent Orchestration
Skill

/migration-review

SQLite migration assessment for items with the needs-migration-review trait. Evaluates schema changes, table recreation patterns, data migration strategy, and Flyway migration correctness. Invoked via skillPointer when filling migration-assessment notes.

From plugin
task-orchestrator
21430 skills5 agents2 commands

Claude Code

$ npx -y skills add jpicklyk/task-orchestrator --skill migration-review --agent claude-code

SKILL.md

migration-review.SKILL.md
name: migration-review
description: SQLite migration assessment for items with the needs-migration-review trait. Evaluates schema changes, table recreation patterns, data migration strategy, and Flyway migration correctness. Invoked via skillPointer when filling migration-assessment notes.
user-invocable: false

Migration Review Framework

Evaluate database migration safety for SQLite-specific constraints. This project uses Flyway migrations with SQLite, which has significant limitations compared to PostgreSQL/MySQL.

Step 1: Identify Schema Changes

This runs at queue phase, as a planner, before code exists. Derive the needed changes from the spec note, the existing migrations in `current/src/main/resources/db/migration/sqlite/` and the Exposed table objects, to determine:

  • **New columns** — `ALTER TABLE ADD COLUMN` works in SQLite
  • **Modified columns** — SQLite has NO `ALTER COLUMN`. Requires table recreation:

1. Create new table with desired schema 2. Copy data from old table 3. Drop old table 4. Rename new table

  • **New tables** - the migration defines the table; the Exposed table object and its `schema/snapshot/<table>.txt` change with it, and `SchemaParityTest` checks both (root `CLAUDE.md` "Flyway is the only schema path")
  • **Index changes** — `CREATE INDEX` / `DROP INDEX` work normally

Step 2: SQLite Constraint Check

Verify against known SQLite limitations:

  • [ ] No `ALTER COLUMN` — if modifying existing columns, table recreation pattern is used
  • [ ] No `DROP COLUMN` in older SQLite versions — check if the Docker image's SQLite supports it
  • [ ] Foreign key constraints — Flyway's connection runs with `foreign_keys = OFF` (see the template below), so a `DROP TABLE` does not cascade; the application connection runs with it ON
  • [ ] `TEXT` affinity — SQLite stores all strings as TEXT regardless of declared type
  • [ ] No concurrent write transactions — migrations must be sequential

Step 3: Data Migration Strategy

For migrations that modify existing data:

  • [ ] Existing rows handled — default values for new columns, or explicit data migration
  • [ ] Null safety — new NOT NULL columns require a DEFAULT or data backfill
  • [ ] Large table performance — SQLite locks the entire database during writes
  • [ ] Runtime-dependent guarantees are probed, not assumed — see below

**Guarantees that rest on engine runtime behavior need a multi-row probe.** When the assessment claims an at-rest, security, or data-integrity guarantee that depends on a specific runtime/engine behavior (e.g. SQLite `PRAGMA secure_delete`, `VACUUM` page reuse, WAL checkpoint timing, FTS5 shadow-table residue), the assessment MUST specify a multi-row/multi-write empirical probe as part of the required test strategy — not a single-row assertion, which can read clean whether or not the mechanism works. It MUST NOT phrase the guarantee as absolute ("scrubbed", "removed") when only a probabilistic or partial mechanism is available ("reduces residue", "partial scrub"); once the probe exists, state the measured bound (e.g. "3–14 of 200 rows survive with the pragma, 200+ without").

Step 4: Flyway Integration

  • [ ] The planned migration file follows naming: `V{N}__{Description}.sql`
  • [ ] The planned version number is sequential (no gaps, no conflicts with existing migrations)
  • [ ] Migration is idempotent where possible
  • [ ] Migration files stay byte-identical once released: Flyway's checksum covers every line including comments, so never edit one (V9's header comment, lines 12-14, says FK enforcement is off by default in this project; in fact the application connection runs `foreign_keys=ON` (DatabaseManager) and only Flyway's own connection runs with it OFF. That correction lives here, not in the file, because Flyway checksums comment lines)
  • [ ] Expand/contract: ship additive changes first and remove the old shape in a later release; flag any table-recreating migration in the release notes
  • [ ] Upgrade harness seed planned: `upgrade/seeds/SeedV{N}.kt` extends `MigrationSeed({N})`, declares the exact expected values of any column it rewrites in `expected(table, row)`, seeds rows the migration transforms, and asserts the result in `verify`; any new column also needs a seeded value in `BaselineDataset` (`BaselineColumnCoverageTest`). The harness migrates a populated database from N-1 and checks rows, foreign keys, FTS counts and integrity, the trigger inventory and `foreign_keys = 0` on Flyway's connection; it fails for a V18-or-later migration without a seed

Table-recreation template

Migrations live in `current/src/main/resources/db/migration/sqlite/`. A migration that recreates a table (SQLite has no `ALTER COLUMN`) must: 1. Run on Flyway's connection, which has `foreign_keys = OFF` and `busy_timeout` set (do not rely on cascades; re-check child rows after). 2. Create the new table, then `INSERT INTO new_t(rowid, c1, ...) SELECT rowid, c1, ... FROM t` to PRESERVE rowids (without the explicit column list the rowid lands in the first declared column): external-content FTS5 tables join on `rowid`. 3. Drop the old table, rename the new one, recreate its indexes. 4. Recreate every trigger the dropped table owned, since dropping a table drops its triggers. There are six FTS tables (`work_items`, `notes` and `documents`, each in a trigram and a text form; `StartupIntegrity` FTS_BACKING). For `work_items`, 6 FTS sync triggers (`work_items_fts_trigram_ai/_ad/_au`, `work_items_fts_text_ai/_ad/_au`) plus 2 cycle triggers (`work_items_cycle_check`, `work_items_cycle_check_update`); for `notes`, 6 FTS sync triggers (`notes_fts_trigram_ai/_ad/_au`, `notes_fts_text_ai/_ad/_au`); for `documents`, 6 FTS sync triggers (`documents_fts_trigram_ai/_ad/_au`, `documents_fts_text_ai/_ad/_au`, V24). Each `_au` trigger uses its LATEST form, restricted to the indexed columns: notes V8, documents V24 (`AFTER UPDATE OF title, body`), work_items V26 (`AFTER UPDATE OF title, summary, description`); the two cycl

Read more
@jpicklyk
Ships withtask-orchestrator

Server-enforced workflow discipline for AI agents. Prompt-based frameworks hope the LLM follows instructions. This one blocks the call if it doesn't.

21430 skills5 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
214
Star history of jpicklyk/task-orchestrator on GitHub, a chart by star-history.com

Other skills on task-orchestrator.

implement

implement

End-to-end workflow for taking MCP work items from backlog to merged PR. Handles git branching, schema-driven planning,…

perf-review

perf-review

Performance impact assessment for items with the needs-perf-review trait. Evaluates hot paths, query patterns, and measurement…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw5d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca3d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip4d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about migration-review.

Which coding agents can use migration-review?
migration-review installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.