migrate について
migrateは、フレームワーク、言語、データベース、インフラの移行を進めるワークフロースキルです。調査、コードベース分析、計画、実装、レビューを順に行い、フェーズ指定やドライランにも対応します。
主な機能
- 01移行先の調査
- 02コードベースへの影響分析
- 03段階的な移行計画の作成
- 04移行変更の実装
- 05移行内容の完全性レビュー
- 06フェーズ指定やドライランでの実行
活用シーン
- 01フレームワークのバージョンアップ
- 02コードベースの言語バージョン移行
- 03データ変換を伴うデータベース移行
- 04クラウド間のインフラ変更計画
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ parcadei/ continuous-claude-v3 --skill migrateインストール後、Claude Code で/migrateを入力して読み込まれたか確認します。
詳細
/migrate - 移行ワークフロー
フレームワーク、言語、インフラストラクチャの安全な移行です。
使用する場面
- 「X に移行」
- 「フレームワークをアップグレード」
- 「X から Y に移行」
- 「Python/Node などをアップグレード」
- 「データベースを移行」
- フレームワークのバージョンアップグレード
- 言語の移行
- インフラストラクチャの変更
ワークフローの概要
┌──────────┐ ┌──────────┐ ┌────────────┐ ┌──────────┐ ┌───────────┐
│ oracle │───▶│ phoenix │───▶│ plan- │───▶│ kraken │───▶│ surveyor │
│ │ │ │ │ agent │ │ │ │ │
└──────────┘ └──────────┘ └────────────┘ └──────────┘ └───────────┘
Research Analyze Plan Implement Review
target current migration changes migration
エージェントの順序
| # | エージェント | 役割 | 出力 |
|---|---|---|---|
| 1 | oracle | 移行先のフレームワーク/バージョンを調査 | 調査レポート |
| 2 | phoenix | 現在のコードベースに対する移行の影響を分析 | 影響分析 |
| 3 | plan-agent | 段階的な移行計画を作成 | 移行計画 |
| 4 | kraken | 移行に伴う変更を実装 | コードの変更 |
| 5 | surveyor | 移行に漏れがないかレビュー | 移行レビュー |
なぜ追加のゲートが必要なのか?
移行には大きなリスクが伴います。
- バージョン間の破壊的変更
- 依存関係の競合
- データ形式の変更
- API の非推奨化
調査とレビューの追加フェーズにより、問題を早期に発見できます。
実行
フェーズ 1:移行先を調査
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
"""
)
フェーズ 2:現在の状態を分析
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
"""
)
フェーズ 3:移行を計画
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
"""
)
フェーズ 4:実装
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
"""
)
フェーズ 5:移行をレビュー
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
"""
)
移行の種類
フレームワークのアップグレード
User: /migrate React 17 → 18
→ Full workflow with hooks/concurrent mode changes
言語のバージョン
User: /migrate Python 3.9 → 3.12
→ Focus on new syntax, removed features
データベースの移行
User: /migrate MongoDB → PostgreSQL
→ Schema design, data transformation, query rewrite
インフラストラクチャ
User: /migrate AWS → GCP
→ Service mapping, config translation
例
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
段階的な移行
大規模なコードベースでは、各フェーズを個別に実行します。
User: /migrate React 17 → 18 --phase 1
[Runs only Phase 1]
User: /migrate React 17 → 18 --phase 2
[Runs Phase 2, reads previous handoff]
フラグ
--phase N: 特定のフェーズのみを実行--dry-run: 実装せずに計画を作成--rollback: ロールバック計画を実行--parallel: 新旧を並行して実行(ストラングラーパターン)
コメント
Markdown 対応