agentleFS
rafaelghifrafaelghif/antigravity-agents-core/.agents/skills/database-migration/SKILL.md

database-migration

Skill6 starsChanged 15 days agoMITView on GitHub

Plans and executes zero-downtime Expand-Migrate-Contract database schema and API contract migrations with rollback verification. Use when adding or modifying database tables, columns, indexes, or versioned API schemas.

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-audit, systematic-debugging and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 3 projects that use this

  • OpenAISkill

    systematic-debugging

    Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

    Also in 3 projects that use this

  • MicrosoftSkill

    mcp-builder

    Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 21 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add new columns as nullable (or with safe defaults) so running application instances continue to operate without error.

    line 22
  2. Very specific:

    Create indexes non-blockingly on large tables (e.g., CREATE INDEX CONCURRENTLY).

    line 23
  3. Distinctive:

    Update writers to write both old and new columns within the same transaction.

    line 25
  4. Distinctive:

    After all readers and writers use the new column exclusively, remove the legacy column in a separate follow-up migration.

    line 29

“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Database Migration

Evolve database schemas and external contracts without downtime or data loss using the Expand → Migrate → Contract workflow.

Decision tree

  1. Is the database engine and migration tool known from workspace manifests?
    • No → Pause and call ask_question to confirm the database stack before generating migrations.
    • Yes → Proceed to step 2.
  2. Is the migration purely additive (new table, new nullable column, or new index)?
    • Yes → Execute Step 1 (Expand) and Step 4 (Verify Rollback).
    • No (renaming, splitting, changing types, or dropping columns) → Execute all 4 steps below across separate deployments.

Migration workflow

  1. Expand (Backwards-compatible addition):
    • Add new columns as nullable (or with safe defaults) so running application instances continue to operate without error.
    • Create indexes non-blockingly on large tables (e.g., CREATE INDEX CONCURRENTLY).
  2. Dual-write & idempotent backfill:
    • Update writers to write both old and new columns within the same transaction.
    • Backfill existing rows idempotently in bounded batches.
    • Switch readers to read from the new column (with fallback to the old column).
  3. Contract (Cleanup):
    • After all readers and writers use the new column exclusively, remove the legacy column in a separate follow-up migration.
  4. Verify forward and rollback paths:
    • Apply the migration (up), test rollback (down), re-apply (up), and run integration tests via run_command.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.