eddiebelaval/squire/migrate
Claude Code and agent skill by eddiebelaval/squire
- community
Checking that the SKILL.md file is still in the repository.
Execute a multi-step infrastructure migration with rollback safety, automatic config updates, full verification, and det
Install
npx vskill@latest install eddiebelaval/squire/migrateSKILL.md
Migrate — Autonomous Infrastructure Migration Pipeline
Core Workflows
Workflow 1: Primary Action
- Analyze the input and context
- Validate prerequisites are met
- Execute the core operation
- Verify the output meets expectations
- Report results
Execute a multi-step infrastructure migration with rollback safety, automatic config updates, full verification, and detailed logging. No confirmation prompts — runs end-to-end and reports results.
Usage
The argument is a plain-English description of the migration. Be specific about source, destination, and what's moving.
Instructions
When invoked with a migration description:
Step 0: Initialize
- Identify the project(s) involved from the current directory and the migration description.
- State: "Migration: [DESCRIPTION] | Project: [PROJECT] | Branch: [BRANCH]"
- Create
MIGRATION_LOG.mdin the project root:
```markdown # Migration Log — {date}
Goal: {migration description} Started: {timestamp} Status: IN PROGRESS
```
- Every action taken from this point forward gets logged to MIGRATION_LOG.md with a timestamp and result.
Step 1: Audit Current State
Before touching anything, build a complete picture:
- Find all env files across the repo:
`` .env, .env.local, .env.development, .env.production, .env.test ` Also check: vercel.json, next.config.js/ts, docker-compose.yml`, CI/CD configs.
- Catalog every connection string, API key, and URL that relates to the migration:
- Database URLs (Supabase, Postgres, Redis)
- API keys and service tokens
- Webhook URLs
- CDN or storage bucket references
- Check active connections:
- Can we reach the source? (curl, pg_isready, or equivalent)
- Can we reach the destination? (same checks)
- Are there active sessions or locks?
- Map dependencies:
- Which source files import or reference the affected services?
- Which config files need updating?
- Are there migration files, seed scripts, or schema definitions?
- Log the complete audit to MIGRATION_LOG.md under
## Step 1: Audit.
Output to the user:
If source or destination is unreachable, log the error and attempt to diagnose (wrong URL, missing credentials, network issue). Fix if possible. If not fixable, STOP and report — do not proceed with a broken connection.
Step 2: Create Rollback Safety Net
Before making any changes:
- Dump the source schema (if database migration):
``bash # For Supabase/Postgres pg_dump --schema-only -d "{SOURCE_URL}" > migration_rollback_schema.sql pg_dump -d "{SOURCE_URL}" > migration_rollback_full.sql # if data too ` If pg_dump` is not available, use Supabase CLI or MCP to export.
- Snapshot all env files:
``bash mkdir -p .migration-backup cp .env* .migration-backup/ 2>/dev/null cp vercel.json .migration-backup/ 2>/dev/null ``
- Create a git stash or checkpoint:
``bash git stash push -m "pre-migration checkpoint" ` Or if working tree is clean, tag the current commit: `bash git tag pre-migration-{timestamp} ``
- Log all backup locations to MIGRATION_LOG.md under
## Step 2: Rollback Safety.
Step 3: Execute Migration
This step varies by migration type. Apply the appropriate sub-procedure:
Database Migration (Supabase/Postgres)
- Apply schema to destination (use dumped schema or Supabase migrations)
- Migrate data if required (pg_dump/pg_restore, or INSERT...SELECT via dblink)
- Verify row counts match between source and destination
- Verify foreign keys and constraints are intact
- Run any seed scripts if needed
Service Migration (Redis, Storage, CDN)
- Export data from source service
- Import data to destination service
- Verify data integrity (key counts, checksums)
Config-Only Migration (URL/key swap)
- Skip directly to Step 4
For each action: Log to MIGRATION_LOG.md with result (success/failure).
On failure: Diagnose the issue. Common fixes:
- Permission denied → Check service role vs anon key
- Schema conflict → Drop and recreate (destination only, NEVER source)
- Data type mismatch → ALTER column or cast during transfer
- Timeout → Retry with smaller batch size
If a fix is applied, log it and continue. Do NOT stop unless data loss is possible.
Step 4: Update All Config Files
For every connection string, API key, or URL identified in the audit:
- Replace old values with new values in all env files.
- Update source code that hard-codes connection details (find with Grep).
- Update infrastructure configs: vercel.json, docker-compose, CI/CD.
- Update Vercel environment variables if the project deploys to Vercel:
``bash # Read new value, update Vercel vercel env rm {VAR_NAME} production vercel env add {VAR_NAME} production < <(echo "{NEW_VALUE}") `` Only do this if user has Vercel CLI configured and the project uses Vercel.
- Log every file changed to MIGRATION_LOG.md under
## Step 4: Config Updates.
CRITICAL: Never log actual secrets to MIGRATION_LOG.md. Use placeholders:
Step 5: Verify Everything Works
Run the full verification suite:
- Type check:
npx tsc --noEmit - Build:
npm run build - Unit tests:
npm test - E2E tests:
npx playwright test(if available) - Connectivity check: Verify the app can reach the new service:
- Start dev server briefly and check a health endpoint, OR
- Run a simple connection test script
If any check fails:
- Diagnose the root cause
- Fix it (update config, fix import, adjust type)
- Re-run the failing check
- Log the fix to MIGRATION_LOG.md
- Maximum 3 fix attempts per failure before marking as unresolved
Step 6: Commit and Report
- Clean up backup files (remove .migration-backup directory — it's in git stash already).
- Stage all changed files.
- Commit:
``` feat: migrate {source} to {destination}
- Schema migrated: {yes/no}
- Data migrated: {yes/no}
- Config files updated: {N}
- Tests: {PASS/FAIL}
- Build: {PASS/FAIL}
See MIGRATION_LOG.md for full details.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> ```
- Finalize MIGRATION_LOG.md:
```markdown
Completed: {timestamp} Status: COMPLETE (or COMPLETE WITH WARNINGS) Duration: {time}
## Summary
- Files modified: {list}
- Services migrated: {list}
- Tests: PASS/FAIL
- Build: PASS/FAIL
- Unresolved issues: {list or "None"}
## Rollback Instructions To revert this migration:
- git stash pop (or git revert {commit})
- Restore .env files from .migration-backup
- {any service-specific rollback steps}
```
- Output summary to user:
``` Migration Complete ================== Goal: {description} Duration: {time}
Schema: {migrated/skipped} Data: {migrated/skipped} Config files updated: {N} Type check: PASS/FAIL Build: PASS/FAIL Tests: PASS/FAIL
Rollback: git stash pop OR git revert HEAD Full log: MIGRATION_LOG.md ```
- Do NOT push to remote. Do NOT delete the git tag/stash.
Safety Rules
| Rule | Why | |
|---|---|---|
| Never modify source database destructively | Source is the fallback if destination fails | |
| Never log secrets to MIGRATION_LOG.md | Log files get committed | |
| Always create rollback checkpoint first | One command to undo everything | |
| Verify destination connectivity before writing | Don't write config pointing to unreachable service | |
| Never push to remote | User decides when migration is ready to ship | |
| Stop if data loss is possible | Ask user instead of risking irreversible damage |
What This Skill Does NOT Do
- Delete source databases or services (you decommission manually)
- Push to remote or deploy
- Modify production environment variables without Vercel CLI confirmation
- Migrate data larger than what fits in a single pg_dump (flag and ask)
- Handle multi-region or distributed system migrations (too complex for autonomous execution)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/migrate/skill.md
Popularity
- Repository stars
- 17
- Repository forks
- 6
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 May 2026, 5 months ago.
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
[](https://verified-skill.com/skills/eddiebelaval/squire/migrate)