How to prepare for AI-driven code modernization projects
https://claude.com/blog/how-to-prepare-for-ai-driven-code-modernization-projects📌 【Anthropic】導入 AI 程式碼現代化前,先想清楚這 6 件事
TL;DR:Anthropic 分享企業導入 AI 驅動程式碼現代化時,該如何先做好組織與流程準備。
過去動輒數年、全員投入的程式碼現代化專案,現在用 agent 可能幾個月甚至幾週就能完成。但 Anthropic 的 forward deployed engineers 在「Notes from the Field」系列中指出一個容易被忽略的事實:技術瓶頸消失了,組織瓶頸卻沒有跟著消失。銀行等關鍵系統的每一次變更,仍然要經過完整的變更管理、審查與核准流程——這套流程原本就是建立在「人寫每一個變更、人審每一個 diff」的假設上。一旦 agent 加速了變更的產出速度,瓶頸就從「怎麼寫出變更」轉移到「怎麼動員整個組織去消化變更」。
🤔 在動手之前,組織要先做完的功課
文章把這件事拆成六個步驟:定義目標(target)、建立驗收憑證(certificate)、設定推廣到正式環境的政策(promotion policy)、備妥前置條件(環境、CI/CD、審查量能、核准機制)、打造並優化 agentic workflow(用 Claude Code 打造能拆成多條平行 subagent 工作流的客製流程),最後才是實際執行:先在一小部分程式碼上端到端驗證,再逐步擴大規模。
🧩 第一步:決定你要做的是哪一種現代化
Anthropic 把現代化分成三種類型。Uplift(提升)是同技術堆疊的版本升級,例如 C++11 → C++20,適用於堆疊本身沒問題、只是版本落後(生命週期已終止的執行環境、未修補的安全漏洞、升不動的相依套件),目標就是明確的執行環境版本與套件集合。Transform(轉換)是跨堆疊但保持行為不變的重寫,例如 COBOL → Java,適用於堆疊本身才是問題、而現有行為是可信的,除了 Uplift 的所有需求外,還要定義新的語言、框架與架構慣例。Reimagine(重構想)則是在新架構上進行的全新重建,同時修改行為,適用於行為本身也需要改變的情況,除了 Transform 的需求外,還要寫出完整的新系統行為規格。
文章特別提醒,選哪一種類型在組織內部常常有爭議:越靠近正式環境的人傾向希望「只換堆疊、行為完全不變」以控制風險(也就是 Transform);而長期背負這套舊系統的工程師和部分業務關係人,則往往希望趁機清償技術債、甚至提出新需求(也就是 Reimagine)。兩種立場都合理,但如果這個問題沒有先解決,之後每一個變更「算不算正確」都會變成爭論焦點。先花時間建立共識,看似增加前期摩擦,實際上會讓整個專案跑得更順。
💡 先盤點現有系統,再決定要不要動它
定義目標之前,理解現有系統往往是必要的第一步。把舊程式碼實際在做的事情整理成行為清單,才能判斷哪些部分該改、哪些該留,也才能真正決定這是 Transform 還是 Reimagine——這個過程也經常會挖出沒人記得存在的業務邏輯與邊界案例。Claude 可以承擔大部分的探索工作,例如程式碼現代化外掛(code modernization plugin)裡的 assess、map、extract-rules 指令,能挖出附帶原始碼引用的業務規則,供工程師審閱。不過文章也坦言,光靠 Claude 的探索未必能完整捕捉一套舊系統的實際行為,還是需要搭配對商業使用者與開發者的訪談,以及內部文件補齊缺口。這段前期的脈絡收集可能要花不少時間,但它的品質會決定後續整個 workflow 每一個決策的品質。如果是做 Reimagine,還需要額外把行為規格寫下來並與使用者群體取得共識。
⚠️ 為什麼要做這件事,往往比怎麼做更難達成共識
文章指出,現代化能降低維運與營運成本,但在他們的經驗裡,成本削減其實很少是這類專案真正的驅動力,風險降低才是。帶著未修補漏洞的系統,可能意味著資安入侵或足以危及整個事業的嚴重停機;不再受支援的執行環境、加上懂這套系統的工程師越來越少,只會讓風險持續放大。像 Claude Code 這樣的 agentic coding 工具雖然縮短了現代化的時程,但預算依然難以精準估算,這也是專案容易陷入慣性、遲遲不啟動的原因之一。啟動這類專案最大的挑戰,通常不是技術,而是在擁有系統的團隊與依賴系統的團隊之間建立內部共識與承諾——在領導層把商業論證與專案目標訂清楚,會讓後面的過程順利很多。
🎯 給準備導入的團隊
如果你的組織正在評估類似專案,這篇文章給出的順序值得參考:先在領導層釐清「為什麼要做」與「做到什麼程度」,把 Uplift/Transform/Reimagine 的選擇攤開來討論,再用 Claude 的探索能力搭配人工訪談把現有行為盤點清楚。當利害關係人對「一個變更能承受多少風險」意見分歧時,把「不做現代化的風險」拿出來當作對照的砝碼,往往比單純談成本更容易凝聚共識。
🔗 來源
- 標題:How to prepare for AI-driven code modernization projects
- 作者/機構:Jonah Ezekiel、Lexie Tonelli/Anthropic(Claude Blog)
- 連結:https://claude.com/blog/how-to-prepare-for-ai-driven-code-modernization-projects
#Anthropic #ClaudeCode #CodeModernization #EnterpriseAI #LegacySystems #AgenticWorkflow #ChangeManagement #SoftwareEngineering #DigitalTransformation #AICoding
原始資料 Claude Blog · 收集於 2026-09-23
摘要原文
How to prepare for AI-driven code modernization projects How to organize AI-driven modernization projects for critical systems and regulated enterprises. Category Enterprise AI Claude Code Product Claude Code Date September 23, 2026 Reading time 5 min Share Copy link https://claude.com/blog/how-to-prepare-for-ai-driven-code-modernization-projects Author(s) Jonah Ezekiel Lexie Tonelli In our Notes from the Field series, Anthropic forward deployed engineers share best practices inspired by real customer deployments. In this article, we share our experience managing large code modernization projects. Code modernizations once scoped as multi-year, all-hands efforts can now finish in months (or weeks ), but the organizational work on either side often remains the same. For example, every change to a critical banking system must go through change management, review, and approval. It is a robust process because regulators, auditors, and the business require it. Those processes are what make critical systems trustworthy, and they were built on the assumption that a human wrote each change and a human would review each diff. Once agents accelerate writing the changes, the bottleneck shifts from producing changes to mobilizing the organization around them. This article covers the work enterprises must do before the modernization takes place: defining what done means, what evidence a change must carry, how certified changes will reach production, and what has to be staged so the run can start. We break this process into six steps: Define the target: the tech stack and behavior the modernized code must have. Create the certificate: the conditions that the changes must meet to be considered correct in the target state. Set the promotion policy: the path by which certified changes get into production at the rate they’re produced. Put the prerequisites in place: environment, CI/CD, review capacity, and approvals. Build and refine the agentic workflow: the custom Claude Code dynamic workflow that distributes the modernization across many smaller parallel subagent workstreams that produce the changes. This is built around the target, certificate, and promotion policy. Run the modernization: prove the workflow end to end on a small partition of the codebase, then scale. Step 1: Define the target The target is the end state of the modernization. The desired end state determines which of the three kinds of modernization you are doing, detailed in the table below. Determine the modernization type Type What it is Choose when The target is Uplift Same-stack version bump (e.g., C++11 → C++20). The stack is fine but the version has fallen behind: end-of-life runtimes, unpatched security issues, dependencies you can no longer upgrade. A runtime version and package set. Transform Cross-stack rewrite that keeps behavior fixed (e.g., COBOL → Java). The stack is the problem to resolve and the behavior is trusted. Everything needed for an uplift, plus the language, frameworks, and architectural conventions the new code must follow. Reimagine Greenfield rebuild on a new architecture with modified behavior. The behavior needs to be changed alongside the code. Everything needed for a transform, plus a written behavioral spec for the new system. Determining which type of modernization to do is often debated inside an organization. In our experience, the people closest to production want the stack swapped with behavior held constant to contain risk (transform modernization). On the other side are often the engineers who have lived with the codebase and want the modernization to pay down tech debt, plus other business stakeholders who want to take the opportunity to name new requirements (reimagine modernization). Both positions are reasonable, but if the question is left unresolved it resurfaces later as an argument over whether a given change is “correct.” Building consensus on which path to take adds initial friction, but streamlines the project as a whole. Map the codebase and create the behavioral spec Understanding the current system is often a good first step for defining the target. Extracting what the old code actually does and creating an inventory of current behavior makes it easy to decide if parts should be changed or dropped, and so whether the modernization is a transform or a reimagine. This also often reveals unknown business logic and edge cases. Claude can do much of that discovery by mapping dependencies and documenting workflows that nobody remembers building . The code modernization plugin ’s assess, map, and extract-rules commands mine business rules with source citations that engineers can then review. However, Claude’s discovery alone may not capture how a legacy system fully behaves. Interviews with business users and developers, and internal documentation, can fill those gaps. Context gathering may take some time upfront, but the quality of that context shapes every decision the workflow makes later. For a reimagine, defining the target requires additional work: a detailed behavioral spec should be written down and agreed with user groups. An interactive dependency map example from the code modernization plugin. Establish the project’s justification and goals Alongside defining the target, the organization should consider why the modernization is worth undertaking at all. Modernizing legacy systems can reduce ongoing maintenance and operational costs, however, in our experience, cost reduction has not been the driving goal of most modernization projects. Risk reduction is often the most important modernization benefit. Consider the risk of not doing the modernization when debating whether or not to undergo the project. For example, a system carrying unpatched vulnerabilities can mean a cyber breach or an outage severe enough to put the business itself at risk. An unsupported runtime or a shrinking pool of engineers who understand the system exacerbates the risk. Agentic coding tools like Claude Code have shortened modernization timelines, but budgets are still hard to estimate, which leads to inertia. We have released the costs of some of our large-scale modernizations as have others . These can serve as a rough baseline, and we have additional guidance on budget projections at the bottom of this guide. The main challenge in initiating these projects is usually building the internal consensus and commitment from the teams that own the system, and the teams that depend on it. Building the business case and setting the goals of the project, often at the leadership level, make this part of the process easier. This also helps anchor the tradeoffs in the certificate and promotion policy that follow. When stakeholders disagree over how much risk a change can carry, the risk of not modernizing is the counterweight. Step 2: Define the certificate The certificate is the set of conditions or tests that every modernization change must meet. Pick the conditions that give the strongest cumulative evidence that the change is correct against the target. Each condition should be checkable without a human in the loop, so the agentic workflow can iterate on a change until it meets the certificate or flag it for human review if it can’t.
由 claude-code/sonnet 自動生成