Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

migratemigrate 工具

Agent Skill

migrate 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

269

周安装

11

GitHub Stars

11

下载量

86
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:migrate(migrate 工具)
来源仓库:https://github.com/acedergren/agentic-tools
仓库路径:skills/migrate
安装命令:
npx skills add https://github.com/acedergren/agentic-tools --skill migrate
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/acedergren/agentic-tools --skill migrate

简介

migrate 用于协调 monorepo 中的路径变更、包重命名和模块迁移,支持批量脚本操作与原子提交。

  • 适用于需要系统性重构代码结构或统一资源引用的复杂项目场景。
  • 通过 grep | xargs sed 实现高效批量替换,避免逐文件编辑,并强制进行去重与类型检查。
  • 安装命令:npx skills add https://github.com/acedergren/agentic-tools --skill migrate。
  • 使用前需确认权限范围,避免误改未识别文件或跳过残留引用检查。

SKILL.md

Migrate

Orchestrates monorepo migrations: import path changes, package renames, module moves. Uses scripted bulk operations (never file-by-file edits), deduplicates against existing work, verifies types at each step, and commits atomically.

Do NOT load this skill when the change only touches one or two files, the user wants exploratory refactoring, or the package boundary decision is still unresolved.

NEVER

  • Never use the Edit tool file-by-file for bulk migrations — use grep | xargs sed instead (10x faster, no missed files).
  • Never start without a deduplication check — duplicate migrations cause import conflicts that are hard to debug.
  • Never commit without typecheck — silent import breakage is worse than a failed commit.
  • Never skip the residual check — 2 files left pointing to the old path cause subtle runtime errors.
  • Never migrate without a manifest — you must know the blast radius before touching anything.
  • Never run bulk sed without confirming the manifest count with the user if > 20 files or if packages/ is touched.

Decision Tree

Does the new import path already exist in the codebase?
├── Yes (many files) → Already migrated; verify or skip
├── Yes (some files) → Partial migration; check what's left
└── No → Proceed with full migration

How many files are affected?
├── 1-2 files → Don't use this skill; use Edit tool directly
├── 3-20 files → Proceed with manifest + scripted sed
└── > 20 files → Show manifest, get user confirmation before sed

Does the change touch packages/ (shared across workspaces)?
├── Yes → Get user confirmation before running sed
└── No → Proceed

Scripts

bash scripts/build-manifest.sh @old/pkg/name
bash scripts/replace-imports.sh @old/pkg/name @new/pkg/name /tmp/migration-manifest.txt

Pipeline

Step 1: Deduplication Check

git log --oneline -20
grep -r "<new-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -l | head -10

If migration is already complete or partial: report what exists, ask whether to verify/clean up or skip.

Step 2: Build Migration Manifest

grep -rl "<old-import-path>" apps/ packages/ --include="*.ts" --include="*.tsx" --include="*.svelte" > /tmp/migration-manifest.txt
echo "Files to migrate: $(wc -l < /tmp/migration-manifest.txt)"
cat /tmp/migration-manifest.txt

Print summary grouped by workspace. Ask user to confirm before proceeding if > 20 files or packages/ is affected.

Step 3: Scripted Bulk Replacement

grep -rl "@old/pkg" apps/api/ --include="*.ts" | \
  xargs sed -i '' "s|@old/pkg|@new/pkg|g"

grep -rl "@old/pkg" apps/frontend/ --include="*.ts" --include="*.svelte" | \
  xargs sed -i '' "s|@old/pkg|@new/pkg|g"

macOS note: sed -i '' (empty string required for in-place edit without backup). Linux uses sed -i without the empty string.

Step 4: Verification Gate

cd apps/api && npx tsc --noEmit 2>&1 | head -30
cd apps/frontend && npx svelte-check --threshold error 2>&1 | tail -20
cd packages/server && npx tsc --noEmit 2>&1 | head -20

Common causes of type errors after migration:

  • Import path changed but exported symbol name also differs → check the actual export
  • Package not yet built → pnpm --filter @portal/server build
  • Circular dependency introduced → pnpm run check:circular

Step 5: Residual Check

grep -r "<old-import-path>" apps/ packages/ --include="*.ts" --include="*.svelte" -l

Remaining occurrences may be in:

  • Dynamically constructed import strings → manual inspection required
  • Test fixture data (strings, not imports) → may be intentional
  • Comments or docs → update if they describe the API

Step 6: Run Tests

npx vitest run apps/api --reporter=dot
npx vitest run apps/frontend --reporter=dot

If tests fail: check if mock paths still point to the old module path (common missed case in test files).

Step 7: Atomic Commit

git commit -m "refactor(imports): migrate @old/pkg → @new/pkg

Affects N files across apps/api, apps/frontend, packages/server.
All typechecks pass. Full test suite green.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"

Stage only migrated files — never git add -A.

Common Migration Patterns

PatternFromTo
Package rename@company/old-pkg@company/new-pkg
Path restructure@app/shared/utils@app/core/utils
Index consolidation./auth/helpers./auth/index
Framework alias$lib/server/*src/lib/server/*

Arguments

  • $ARGUMENTS: Migration description

- "@old/pkg/utils → @new/pkg/utils" — import path migration - "move packages/server/src/auth.ts to packages/server/src/auth/index.ts" — file move - "rename @company/old-shared → @company/core" — package rename - If empty: ask for source and target

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.21%
按下载量换算29

Claude

29.78%
按下载量换算26

Cursor

20.91%
按下载量换算18

Gemini CLI

10.59%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills