plugin/skills/migrate/SKILL.md
Use this skill when planning database schema changes with rollback, framework version upgrades, or library replacements — a planned migration with rollback plan across schema, library, version, and framework, run as a multi-agent pipeline with RALF on validation. Not for refactors without external contract change (use /refactor) or small bug-fix releases (use /develop).
npx skillsauth add avav25/ai-assets migrateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Plan + execute + validate a migration with a documented + tested rollback procedure. RALF loop on data-integrity validation ensures the migration is safe AND reversible.
/refactor/develop/infra-change/migrate "Postgres 13 → 14"
/migrate "React class → functional components" --staged
/migrate "Django 3.2 → 4.0"
| Flag | Default | Effect |
|---|---|---|
| <migration> (positional) | required | Source → target description |
| --staged | off | Use blue-green or canary pattern (requires ops sign-off) |
<repo>/.ai-skills-memory/migrate/<run-id>/MIGRATION-PLAN.md — detailed steps + rollback + risk matrix<repo>/.ai-skills-memory/migrate/<run-id>/VALIDATION.md — test results + data integrity checks| Agent | Model | Effort | Tools | Role |
|---|---|---|---|---|
| team-lead (feature-design-lead) | Opus | xhigh | Task | Plans migration, risk assessment, rollback strategy |
| devops-engineer | inherit | high | Bash, Read, Write, Edit | Infrastructure migration (DB schema, deploy config) |
| developer (per-stack) | inherit | high | Read, Write, Edit, Bash | Application-level migration (code, compatibility shims) |
| qa-engineer | inherit | high | Bash, Read, Grep | Data integrity validation, rollback testing |
┌─ PLAN:
│ └─ Lead: research target version, compatibility matrix, rollback strategy
│ PLAN MUST classify the migration: (a) additive-only (single safe step),
│ (b) requires expand-contract (multi-phase per
│ `references/expand-contract.md`), or (c) blue-green data migration.
│ Detect target stack to pick migration tool from
│ `references/migration-tools-by-stack.md`.
│ Generates MIGRATION-PLAN.md with:
│ - Pre-flight checklist (dependencies, backups)
│ - Step-by-step migration procedure (one phase per deploy if expand-contract)
│ - Rollback procedure (TESTED, not theoretical)
│ - Risk matrix (data loss, compatibility, performance)
│
├─ Gate: USER APPROVAL of rollback procedure (not just migration plan)
│
├─ EXECUTE (sequential per `subagent-isolation.md`):
│ ├─ devops-engineer: DB schema migration (if applicable)
│ │ - Create migration scripts (forward + rollback)
│ │ - Test on replica
│ │ - Document data transformation
│ │
│ └─ developer: application-level changes
│ - Update deps, compatibility shims, feature flags
│ - Parallel-run mode (old + new API, use new)
│
├─ VALIDATE (sequential):
│ │ - Run full test suite via /run-tests
│ │ - Data integrity checks (row counts, checksums, foreign key constraints)
│ │ - Performance baseline (query times, throughput)
│ └─ If rollback needed: execute rollback procedure, validate revert
│
├─ RALF (validation loop):
│ │ Oracle: python:./validate-migration.py (custom validation script, exit 0 = pass)
│ │ Kill-on: oracle-pass OR no-progress:2
│ │ Caps: 5 iter / 300K tokens / 90 min
│ └─ (loop back to VALIDATE)
│
└─ Lead sign-off on migration safety
Memory write: L4 (committed) migration decision + rollback proof
All spawns use structured G7 payloads per plugin/schemas/spawn-payload.schema.json. Lead validates returns against plugin/schemas/return-contract.schema.json.
Pointer: plugin/eval/judge-rubrics/migrate.md (B10).
Dimensions:
Pass: avg ≥ 4.0, no dimension < 3.
python:./validate-migration.py (custom validation script, exit 0 = pass)oracle-pass (happy stop) OR no-progress:2 (two iterations with no change → escalate)| Layer | When | Shape |
|---|---|---|
| L4 (committed) | After plan approved | .ai-skills-memory/.committed/migrations/<name>/plan.md — strategy for team review (versioned in git) |
| L4 (committed) | After validation pass | .ai-skills-memory/.committed/migrations/<name>/validation-report.md — data integrity proof (versioned) |
Both committed paths must match committed-allowlist.txt patterns — pre-tool-use-committed-write.py hook enforces.
/env-analyze; surface to user with RUNBOOK-EMERGENCY reference--staged selected but no canary infrastructure: Lead detects absence; refuses with "no canary deployment infrastructure detected; use --staged with manual canary or proceed without"workflow_start — migrate + source→targetplan_approved — user gate passedvalidation_start — data integrity checks beginralf_iter — validation loopsworkflow_end — COMPLETE or ROLLBACK_EXECUTED or ESCALATEDfeature-design-lead (Opus, tools: Task)plugin/schemas/spawn-payload.schema.json, plugin/schemas/return-contract.schema.json/run-tests (test suite verification), /env-analyze (pre-flight environment check)/ralph (validation RALF), /subagent-spawn (G7 payload), /create-pr (after completion)subagent-isolation (Sequential Code-Modification Gate), ralph-budget (validation caps), untrusted-content-wrapping (G1 wrap on subagent returns + project file reads), memory-discipline (committed writes via allowlist)pre-tool-use-committed-write.py (validates .committed/ paths against allowlist), tool-output-normalize.py (G2 on validation script output)development
Use this skill when running the recurring (daily) knowledge-base rescan for a repo that already has knowledge/.knowledge-sync.yml — the main-thread dispatcher that reads the config, computes the git delta since last_scanned_sha, maps changed paths to affected doc areas, early-exits cheaply when nothing changed, then fans out one Agent(content-writer) per affected area, applies the propose/direct update policy, advances the baseline only on success, and writes an L4 run log — all with the G1 untrusted-content choke-point, secret-scan, deny-list, and budget controls woven in. For first-time setup use /knowledge-sync-init.
development
Use this skill when bootstrapping scheduled knowledge-base sync for a repo that has no knowledge/.knowledge-sync.yml yet — to run one-time setup that detects the knowledge_root from CLAUDE.md/AGENTS.md, maps doc areas to source globs, records opt-in external sources (Linear/Notion/WebFetch, all disabled by default), captures a baseline last_scanned_sha, sets the per-area update policy, generates or seeds knowledge/CONVENTIONS.md, provisions the L4 memory dir, and offers to register the daily routine. Routes ongoing recurring sync operations to /knowledge-sync.
tools
Use this skill when bootstrapping a target repository to be ai-skills-aware — on the first run of any ai-skills workflow in a fresh repo, when adopting the ai-skills plugin in an existing repo, or after upgrading to a plugin version that adds new memory paths or templates, including when the user does not say "init" but asks to "set up" or "onboard" the repo — to detect codebase type, create CLAUDE.md + AGENTS.md scaffolding, initialize the .ai-skills-memory/ directory tree from L1 templates, and configure .gitignore. Idempotent — safe to re-run. Accepts `--codebase-type <type>` and `--overwrite`. Not for re-initializing only memory — use `/memory-init` instead.
tools
Use this skill when extending, repairing, or improving plugin assets, when ingesting a `/feedback` report as a fix-cycle backlog, or when you do not remember which lower-level command is right for the job — the umbrella workflow for ai-skills plugin-asset authoring and maintenance: creating, auditing, fixing, improving, refactoring, and migrating skills, agents, rules, hooks, prompts, schemas, and rubrics inside the plugin. Auto-classifies the request, loads the right knowledge skills (`@prompt-engineering`, `@context-engineering`, `@team-protocols`), and spawns the right subagents (`prompt-engineer`, `system-architect`, `python-engineer`, `software-engineer`, `qa-engineer`, `eval-judge`) via the `Agent` tool.