Engineering Advanced MigrationPlanningRollback

Migration Architect

Migration planning, compatibility checking, and rollback generation.

$skillfish add ~skills/migration-architect

Real Conversations

See how the Migration Architect skill responds to actual requests. These are representative examples of what your AI agent will produce.

You

We need to add a NOT NULL column tenant_id UUID to our orders table which has 8.2 million rows. We're on PostgreSQL 14 on RDS. We can't have more than 30 seconds of downtime. What's the migration strategy?

Agent

Adding a NOT NULL column directly to a large table will lock it for the full backfill — at 8.2M rows that's likely 10–20 minutes on RDS. You need a three-phase expand-contract migration.

Phase 1 — Expand (deploy now, no downtime):

-- Add column as nullable first — instant, no lock
ALTER TABLE orders ADD COLUMN tenant_id UUID;
-- Add index concurrently (no table lock)
CREATE INDEX CONCURRENTLY idx_orders_tenant_id ON orders(tenant_id);

Deploy app code that writes tenant_id on all new orders.

Phase 2 — Backfill (run during off-hours):

-- Batch update to avoid long transactions
DO $$ 
DECLARE batch_size INT := 10000;
BEGIN
  LOOP
    UPDATE orders SET tenant_id = resolve_tenant(account_id)
    WHERE tenant_id IS NULL
    LIMIT batch_size;
    EXIT WHEN NOT FOUND;
    PERFORM pg_sleep(0.1); -- brief pause between batches
  END LOOP;
END $$;

Monitor with: SELECT count(*) FROM orders WHERE tenant_id IS NULL;

Phase 3 — Contract (after backfill complete):

-- Add NOT NULL constraint — fast if no NULLs remain
ALTER TABLE orders ALTER COLUMN tenant_id SET NOT NULL;

Rollback plan: If Phase 3 fails, the column stays nullable — no data loss, app code continues writing it. Rollback Phase 1 only if Phase 2 is still pending.

Risk assessment: MEDIUM. Main risk is backfill taking longer than expected if resolve_tenant() is slow. Run on a staging copy of prod data first to time it.

Get Started

How to install and use this skill in your preferred environment.

Skills are designed for AI coding agents (Claude Code, Cursor, Windsurf) and IDE-based workflows where the agent can read files, run scripts, and act on your codebase. Web-based AI can use the knowledge and frameworks, but won't have tool access.

Models & Context

Which AI models and context windows work best with this skill.

Recommended Models

Best
Claude Opus 4 Claude Sonnet 4 GPT-4.1 Gemini 2.5 Pro Grok 3 Kimi K2
Good
Claude Haiku 4.5 GPT-4.1 mini Gemini 2.5 Flash Grok 3 mini

Larger models produce more detailed, production-ready outputs.

Context Window

This skill's SKILL.md is typically 3–10 KB — fits in any modern context window.

8K Skill only
32K+ Skill + conversation
100K+ Skill + references + codebase

All current frontier models (Claude, GPT, Gemini) support 100K+ context. Use the full window for complex multi-service work.

Pro tips for best results

1

Be specific

Include numbers — users, budget, RPS — so the skill can size the architecture.

2

Share constraints

Compliance needs, team size, and existing stack all improve the output.

3

Iterate

Start with a high-level design, then ask follow-ups for IaC, cost analysis, or security review.

4

Combine skills

Pair with companion skills below for end-to-end coverage.

Ready to try Migration Architect?

Install the skill and start getting expert-level guidance in your workflow — any agent, any IDE.

$skillfish add ~skills/migration-architect
← Browse all 169 skills