Migrate

作者 parcadeid07ff4b06b62無授權條款3.9K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫8 個月前更新

Migration workflow - research → analyze → plan → implement → review

AI 產生的概覽

指導框架、語言、資料庫與基礎架構遷移的五階段工作流程。

功能
此技能定義一套遷移工作流程,用於將專案從一個框架、語言版本、資料庫或基礎架構遷移到另一個。它依序安排五個階段:研究目標、分析目前程式碼庫、產出分階段遷移計畫、實作變更並審查結果。每個階段都以委派任務的形式描述,並說明產出,例如研究報告、影響分析、遷移計畫、程式碼變更或審查報告。它也說明了遷移類型、逐階段增量執行,以及 dry-run、rollback、parallel 等旗標。
適用情境
當被要求遷移或升級框架、語言版本、資料庫或基礎架構時使用,例如從 Express 遷移到 Fastify,或從 Python 3.9 升級到 3.12。它適合高風險遷移,也就是需要額外研究與審查關卡來應對破壞性變更、相依性衝突或資料格式變化的情況。對於大型程式碼庫,也可以一次只執行一個階段。
執行需求
僅為指示性內容,未隨附指令碼。它假定所指名的子代理(oracle、phoenix、plan-agent、kraken、surveyor)可用以執行各階段。

/migrate - Migration Workflow

Safe migrations for frameworks, languages, and infrastructure.

When to Use

  • "Migrate to X"
  • "Upgrade framework"
  • "Move from X to Y"
  • "Upgrade Python/Node/etc."
  • "Migrate database"
  • Framework version upgrades
  • Language migrations
  • Infrastructure changes

Workflow Overview

┌──────────┐    ┌──────────┐    ┌────────────┐    ┌──────────┐    ┌───────────┐│  oracle  │───▶│ phoenix  │───▶│   plan-    │───▶│  kraken  │───▶│ surveyor  ││          │    │          │    │   agent    │    │          │    │           │└──────────┘    └──────────┘    └────────────┘    └──────────┘    └───────────┘  Research       Analyze          Plan             Implement       Review  target         current          migration        changes         migration

Agent Sequence

#AgentRoleOutput
1oracleResearch target framework/versionResearch report
2phoenixAnalyze current codebase for migration impactImpact analysis
3plan-agentCreate phased migration planMigration plan
4krakenImplement migration changesCode changes
5surveyorReview migration for completenessMigration review

Why Extra Gates?

Migrations are high-risk:

  • Breaking changes between versions
  • Dependency conflicts
  • Data format changes
  • API deprecations

The extra research and review phases catch issues early.

Execution

Phase 1: Research Target

Task(  subagent_type="oracle",  prompt="""  Research migration target: [TARGET]
  Investigate:  - Breaking changes from current version  - New APIs and patterns  - Deprecated features we use  - Migration guides from official docs  - Common pitfalls and solutions
  Output: Migration research report  """)

Phase 2: Analyze Current State

Task(  subagent_type="phoenix",  prompt="""  Analyze codebase for migration: [FROM] → [TO]
  Identify:  - Files using deprecated APIs  - Dependency conflicts  - Patterns that need updating  - Test coverage of affected areas  - Risk areas (critical paths)
  Output: Impact analysis with affected files  """)

Phase 3: Plan Migration

Task(  subagent_type="plan-agent",  prompt="""  Create migration plan: [FROM] → [TO]
  Research: [from oracle]  Impact: [from phoenix]
  Plan should:  - Be phased (incremental if possible)  - Each phase independently testable  - Include rollback strategy  - Prioritize critical path stability
  Output: Phased migration plan  """)

Phase 4: Implement

Task(  subagent_type="kraken",  prompt="""  Implement migration phase: [PHASE_N]
  Plan: [from plan-agent]
  Requirements:  - Follow plan exactly  - Run tests after each change  - Document any deviations  - Stop if tests fail
  Output: Completed phase with test results  """)

Phase 5: Review Migration

Task(  subagent_type="surveyor",  prompt="""  Review migration: [FROM] → [TO]
  Check:  - All deprecated APIs replaced  - No remaining compatibility shims  - Tests passing  - Performance acceptable  - No security regressions
  Output: Migration review report  """)

Migration Types

Framework Upgrade

User: /migrate React 17 → 18→ Full workflow with hooks/concurrent mode changes

Language Version

User: /migrate Python 3.9 → 3.12→ Focus on new syntax, removed features

Database Migration

User: /migrate MongoDB → PostgreSQL→ Schema design, data transformation, query rewrite

Infrastructure

User: /migrate AWS → GCP→ Service mapping, config translation

Example

User: /migrate from Express to Fastify
Claude: Starting /migrate workflow: Express → Fastify
Phase 1: Researching Fastify...[Spawns oracle]Key differences:- Schema-based validation (vs middleware)- Plugin architecture- Async/await native- Different middleware pattern
Phase 2: Analyzing current Express usage...[Spawns phoenix]Impact analysis:- 23 route files to update- 8 middleware to convert- 3 plugins need Fastify equivalents- Test coverage: 78%
Phase 3: Creating migration plan...[Spawns plan-agent]
Migration Plan: Express → Fastify━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Phase 1: Setup & Core- Add Fastify alongside Express- Migrate core server setup- Run both in parallel
Phase 2: Routes (by domain)- Migrate auth routes- Migrate user routes- Migrate product routes- ...
Phase 3: Middleware- Convert error handler- Convert auth middleware- Convert logging
Phase 4: Cleanup- Remove Express- Remove compatibility layer- Final testing
Rollback: Keep Express until Phase 4 complete
Phase 4: Implementing Phase 1...[Spawns kraken]✅ Fastify server running alongside Express✅ Core routes migrated✅ Tests passing
[Continues through phases...]
Phase 5: Reviewing migration...[Spawns surveyor]✅ All Express code removed✅ 23/23 routes migrated✅ Performance improved (2.1x faster)✅ No security regressions
Migration complete! Express → Fastify

Incremental Migration

For large codebases, run one phase at a time:

User: /migrate React 17 → 18 --phase 1[Runs only Phase 1]
User: /migrate React 17 → 18 --phase 2[Runs Phase 2, reads previous handoff]

Flags

  • --phase N: Run specific phase only
  • --dry-run: Plan without implementing
  • --rollback: Execute rollback plan
  • --parallel: Run new alongside old (strangler fig)

來源與署名

來源:parcadei/continuous-claude-v3位於.claude/skills/migrate提交d07ff4b

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架