Codex Use Case

运行代码迁移

用受控检查点迁移遗留技术栈。 本页把官方 use case 的章节、工具、起步提示词和检查点整理成中文执行流程,便于直接对照落地。

Engineering Code
Run code migrations EngineeringCode

场景定位

用受控检查点迁移遗留技术栈。 本页把官方 use case 的章节、工具、起步提示词和检查点整理成中文执行流程,便于直接对照落地。

难度
中级
时间跨度
约 15-30 分钟

适合用于

  • 需要把「用受控检查点迁移遗留技术栈。」做成可复用流程的团队,且来源分散在 Security Best Practices、Gh Fix Ci、Aspnet Core 等工具中
  • 希望 ChatGPT 或 Codex 保留来源、检查点和可审阅输出的使用者
  • 需要把「运行代码迁移」从一次性对话变成可复查工作流的场景

Skills & Plugins

相关工具

Starter Prompt

起步提示词

Migrate this codebase from [legacy stack or system] to [target stack or system].

Requirements:
- Start by inventorying the legacy assumptions: routing, data models, auth, configuration, build tooling, tests, deployment, and external contracts.
- Map the old stack to the new one and call out anything that has no direct equivalent.
- Propose an incremental migration plan with compatibility layers or checkpoints instead of one big rewrite.
- Keep behavior unchanged unless the migration explicitly requires a user-visible change.
- Work in milestones and run lint, type-check, and focused tests after each milestone.
- Keep rollback or fallback options visible until the transition is complete.
- If validation fails, fix it before continuing.
- Start by mapping the migration surface and proposing the checkpoint plan.
在 ChatGPT 中尝试

介绍

这一节对应官方流程中的「Introduction」。落地时围绕「运行代码迁移」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

操作要点:把已确认的上下文转成「运行代码迁移」所需的可审阅草稿或交付物,并关注 Codex 等相关来源或工具,并保留后续修改入口。

操作要点:把已确认的上下文转成「运行代码迁移」所需的可审阅草稿或交付物,并关注 Codex 等相关来源或工具,并保留后续修改入口。

如何使用

这一节对应官方流程中的「How to use」。落地时围绕「运行代码迁移」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

利用 ExecPlans

这一节对应官方流程中的「Leverage ExecPlans」。落地时围绕「运行代码迁移」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

操作要点:把已确认的上下文转成「运行代码迁移」所需的可审阅草稿或交付物,并关注 Codex 等相关来源或工具,并保留后续修改入口。

组合 with a goal

这一节对应官方流程中的「Combine with a goal」。落地时围绕「运行代码迁移」把目标、输入、执行步骤和验证证据保持在同一条工作流里。

操作要点:在继续执行前检查来源、假设、受众、权限和输出质量,并关注 Codex 等相关来源或工具;不确定内容应进入待确认列表。

Prompt Library

建议提示词

先界定范围

For Run code migrations, first inspect the available sources and propose the smallest useful scope. Name the inputs, outputs, validation steps, permissions, and anything that needs approval before action.

交付前复核

Review the result for Run code migrations. Check source coverage, assumptions, unresolved questions, and the evidence that proves the output is ready to use.