od-code-migration
它能做什么
这个工具可以帮助你把代码从一个系统迁移到另一个系统。它会先分析旧代码,规划需要做的修改,然后不断测试新版本,直到一切运行正常。
适用场景
- ✓当你需要把项目更新到新技术时。
- ✓当你要把应用从一个平台迁移到另一个平台时。
- ✓当你想让过时的代码焕然一新时。
技能链接
https://github.com/nexu-io/open-design/blob/main/plugins/_official/scenarios/od-code-migration/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“把这段代码迁移到 Python 3,并确保所有测试都通过。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 首先会理解你现有的代码以及你想要做的改动。然后,它尝试进行修改,并自动进行测试。这个过程会反复进行,直到新代码运行良好为止。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
od-code-migration (scenario)
Spec §1 / §10.1 / §20.3 / §21.3.2 / §23.3.3: the canonical
code-migration flow. The pipeline cannot ship an accept decision
without a passing build — the patch-edit ↔ build-test devloop is
the convergence engine.
Default pipeline
{
"stages": [
{ "id": "import", "atoms": ["code-import"] },
{ "id": "tokens", "atoms": ["design-extract", "token-map"] },
{ "id": "plan", "atoms": ["rewrite-plan"] },
{
"id": "verify",
"atoms": ["patch-edit", "build-test"],
"repeat": true,
"until": "(build.passing && tests.passing) || iterations>=8"
},
{ "id": "review", "atoms": ["diff-review"] },
{ "id": "handoff", "atoms": ["handoff"] }
]
}
The scenario uses build.passing && tests.passing as the
convergence signal — promoted into the spec §22.4 vocabulary by
the build-test atom.
Required user inputs
A plugin built on this scenario typically declares od.inputs:
repoPath(string, required): pulled fromod project import.targetStack(form): collected byrewrite-plan.testCommand/buildCommand(string, optional): overrides the inferred package.json scripts in thebuild-testatom.
常见问题
“代码迁移”是什么意思?
就是让一个计算机程序适应新的运行环境,比如换成新的编程语言或新的操作系统。
什么是“测试”?
测试是一些自动检查,用来确认程序按预期运行,并且没有错误。
我需要会写代码才能使用它吗?
你不需要是专家。这个工具会一步步引导你完成流程,不过如果你对想要修改的内容有个基本概念,会更有帮助。
详情
作者的原始描述
Default reference pipeline for the code-migration taskKind — code-import → design-extract → token-map → rewrite-plan → patch-edit ↔ build-test devloop → diff-review → handoff.
repo: nexu-io/open-design
热度
- GitHub 星标
- 101k
- 排名
- #1065
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/15
评论
- …