OpenParable
Skip to content
← Back to skills

Migration Writer

Development
migration-writer

Migration Writer is an Agent Skill for development published in the Archive228/loopkit repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Write safe, reversible database migrations for this repo's conventions. Use for any schema change.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/Archive228/loopkit/blob/HEAD/skills/migration-writer/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/migration-writer, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Migration Writer

  1. Read the current schema first. Match the repo's migration tool and naming (NNN_<verb>_<noun>).
  2. Write BOTH up and down. A migration you can't reverse is a migration you can't deploy safely.
  3. Live-safe: on a hot table, adding a NOT NULL column with no default, or an index without CONCURRENTLY, takes a blocking lock. Split into steps: add nullable → backfill → add constraint.
  4. Backfill large tables in batches, not one statement.
  5. Never edit an already-merged migration — add a new one. Test with a dry-run before committing. Output the migration + the exact deploy order.