1 hour
How to 執行程式碼遷移 with Eigent
在受控檢查點遷移舊有技術堆疊——將舊系統對應到新系統,分階段完成搬遷,並在每次切換前驗證一致性。
What you need
- Eigent 桌面應用程式
- 程式碼庫存取權(本機或已連線的 repo)
- 測試套件、lint、及 type-check 工具
Best for
- 需要變更框架、執行環境或平台慣例的舊系統轉新系統遷移
- 需要相容層、分階段過渡,以及在每個檢查點明確驗證的團隊
- 管理漸進式 strangler-fig 或 branch-by-abstraction 遷移的工程師
Starter Prompt
將此程式碼庫從 [legacy stack or system] 遷移到 [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.
運作方式
- 盤點舊有假設——routing、data models、auth、configuration、build tooling、tests、deployment,以及 external contracts。
- 將舊技術堆疊對應到新技術堆疊,並指出任何沒有直接對應項目的部分。
- 提出漸進式遷移計劃,加入相容層或檢查點,而不是一次過大重寫。
- 除非遷移明確要求對使用者可見的變更,否則保持行為不變。
- 每完成一個里程碑後,執行 lint、type-check 及針對性測試,以證明一致性再繼續。
- 在遷移完成前,保持回滾或備援方案清晰可見。
更多可嘗試的提示
- 這個程式碼庫中有哪些部分在目標技術堆疊中沒有直接對應?每個缺口應該如何處理?
- 提出一個相容層,讓舊代碼和新代碼在過渡期間可以共存。
- 在這個里程碑之後,最小的測試或檢查是什麼,能證明與舊流程一致?
- 如果這個檢查點的遷移在 production 失敗,回滾步驟是什麼?
如何使用
在 Eigent 中連接你的程式碼庫,並描述你的來源與目標技術堆疊。先從遷移範圍盤點開始——這能讓你在任何程式碼變更之前,完整掌握需要搬遷的內容。按里程碑逐步推進,並在每一步後驗證。若遷移跨越多天,請讓 Eigent 建立一份 ExecPlan 文件,以追蹤整個期間的決策、延後項目與驗證結果。
預期輸出
一份遷移範圍盤點、按檢查點劃分的遷移計劃、每個里程碑的實作差異,以及確認每一步一致性的驗證摘要。每個切換點都會註明回滾選項。
限制
- 複雜的資料模型變更可能需要手動 schema migration scripts;Eigent 可以起草,但你必須審核。
- 外部合約變更需要在遷移本身以外進行協調。
- 大型重寫最好拆成多個小里程碑——避免在單一里程碑中批次處理超過一層的技術堆疊。