Skill

migrate

Install
1
Install the plugin
$
npx claudepluginhub xmgrex/ccx-arsenal --plugin agent-core

Want just this skill?

Add to a custom plugin, then install with one command.

Description

コードベース全体のシンボル名・パターンを一括移行する。影響範囲の事前スキャン、並列置換、検証を含む。Trigger - "リネーム", "移行", "一括置換", "名前変更", "migrate", "rename all", "batch replace"

Tool Access

This skill uses the workspace's default tool permissions.

Skill Content

Migrate — 一括リネーム・パターン移行

旧パターンを新パターンに、コードベース全体で安全に移行する。

Usage

/migrate                                        # 対話的に旧→新を指定
/migrate OldClassName → NewClassName            # 直接指定
/migrate foo_bar → fooBar, baz_qux → bazQux    # 複数ペア

$ARGUMENTS旧 → 新 のペアを指定。複数ペアはカンマ区切り。省略時は AskUserQuestion で確認。

Workflow

1. 移行ペアの確定

$ARGUMENTS から旧→新のペアを抽出。不明確な場合は AskUserQuestion で確認:

  • 「クラス名だけですか、ファイル名も含みますか?」
  • 「コメントやドキュメント内の記述も置換しますか?」
## 移行計画

| # | 旧パターン | 新パターン | 種別 |
|---|----------|----------|------|
| 1 | `旧名` | `新名` | クラス名 / 関数名 / 変数名 / ファイル名 / リテラル / コメント |

2. 影響範囲スキャン

各ペアについて Grep で影響範囲を調査し、ユーザーに提示する:

### 影響範囲

| パターン | ファイル数 | 出現数 | 主な場所 |
|---------|----------|-------|---------|
| `旧名A` | N | M | dir1/, dir2/ |

**合計: Nファイル, M箇所**

承認を得てから実行する。

3. 実行戦略の決定

影響ファイル数?
    │
    ├─ ≤10 ──────► 直列実行
    ├─ 11-30 ────► 並列実行(ディレクトリ単位でグループ化)
    └─ 31+ ──────► 段階的並列(Wave 1: 定義元 → Wave 2: 参照元)

並列時は complex-orchestrator を使用。各サブエージェントに担当ファイルリストと「担当外は変更しない」制約を渡す。

4. 置換を実行

以下の順序で行う:

  1. ファイル名のリネーム(該当する場合)
  2. ファイル内容の置換
  3. 他ファイルからの参照(import パス等)を修正

定義元を先に、参照元を後に。 逆だとビルドが壊れる。

5. 検証

  1. 残留チェック: 旧パターンが残っていないことを Grep で確認
  2. ビルド検証: プロジェクトの検証コマンドを実行
  3. テスト実行: 既存テストが通ることを確認

残留や失敗があれば修正し、再検証。

6. 完了報告

変更ファイル数・変更箇所数を表で報告する。

原則

  • 影響範囲を見せてから実行 — 想定外のファイルが含まれていないか確認
  • 定義元を先に、参照元を後に — 依存の順序を守る
  • コメント・リテラルも対象 — ドキュメントやログの旧名も移行
  • テストファイルを忘れない — テスト内の旧パターンも置換
  • 曖昧なスコープはユーザーに聞く — AskUserQuestion で置換範囲を確認

Integration

  • complex-orchestrator: 11+ファイルの並列置換に使用
  • investigate: 移行後のビルドエラー調査に連携
  • local-code-review: 移行後のレビューに使用
Stats
Stars1
Forks0
Last CommitMar 9, 2026
Actions

Similar Skills

cache-components

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

138.4k