Migrate

parcadei/continuous-claude-v3/.claude/skills/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 从公开仓库中收录这些内容。

举报或申请下架