buchananwill/ue-claude-scaffold/expand-contract-migration

Claude Code and agent skill by buchananwill/ue-claude-scaffold

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Zero-downtime database migration protocol. Framework-agnostic process for safely evolving schemas in production.

Install

npx vskill@latest install buchananwill/ue-claude-scaffold/expand-contract-migration

SKILL.md

The same SKILL.md was published earlier as buchananwill/ue-claude-scaffold/expand-contract-migration.

Expand-Contract Migration Protocol

Zero-downtime schema evolution for production databases.

When to Activate

  • Renaming, removing, or restructuring columns/tables in a live system
  • Any schema change where the old and new shapes must coexist during deployment

The Three Phases

Phase 1: EXPAND
- Add new column/table (nullable or with default)
- Deploy: application writes to BOTH old and new
- Backfill existing data in a separate migration
Phase 2: MIGRATE
- Deploy: application reads from NEW, writes to BOTH
- Verify data consistency between old and new
Phase 3: CONTRACT
- Deploy: application only uses NEW
- Drop old column/table in a separate migration

Rules

  1. Every change is a migration file -- never alter production databases manually
  2. Migrations are forward-only in production -- rollbacks use new forward migrations
  3. Schema and data migrations are separate -- never mix DDL and DML in one migration
  4. Migrations are immutable once deployed -- never edit a migration that has run in production
  5. Test against production-sized data -- a migration that works on 100 rows may lock on 10M

Timeline Example

Day 1: Migration adds new_status column (nullable)
Day 1: Deploy app v2 -- writes to both status and new_status
Day 2: Run backfill migration for existing rows
Day 3: Deploy app v3 -- reads from new_status only
Day 7: Migration drops old status column

Anti-Patterns

Anti-PatternWhy It FailsBetter Approach
Manual SQL in productionNo audit trail, unrepeatableAlways use migration files
Editing deployed migrationsCauses drift between environmentsCreate new migration instead
Schema + data in one migrationHard to rollback, long transactionsSeparate migrations
Dropping column before removing codeApplication errors on missing columnRemove code first, drop column next deploy

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/buchananwill/ue-claude-scaffold/expand-contract-migration/badge)](https://verified-skill.com/skills/buchananwill/ue-claude-scaffold/expand-contract-migration)

Something wrong with this skill or its page? Tell us.