Legacy System Migration Using an AI Coding Agent

Legacy System Migration Using an AI Coding Agent

1. Introduction

With recent advances in AI Coding Agents, AI can now be used not only to write code but also to analyze and validate existing systems. In my own development work, I made extensive use of an AI Coding Agent to analyze a legacy system and carry out its implementation and validation.

This project involved migrating an existing system built with ThingWorx and some Java code to a new system based on Spring Boot (Java) and Vue (TypeScript). The large volume of legacy code and lack of detailed requirements made it difficult even to understand the existing functionality and estimate the scope of development.

To address these challenges, I used Claude for analysis and implementation, and Codex for validation. In this article, I’d like to share the development process using these two AI Coding Agents and what I learned along the way.

2. Analyzing the Legacy System and Creating a Work Plan

2.1. Using AI to Analyze the Legacy System

For this project, I first used Claude to analyze the existing ThingWorx and Java code and understand its key features and processing flows. I reviewed the analysis results provided by the AI against my own domain knowledge. When I found the results difficult to understand, I asked follow-up questions and sought clarification to assess their accuracy.

I expected that the analysis alone would take at least one to two months without AI, but the main analysis work was actually completed in about a week. This comparison is based on my personal expectations and experience, not on objectively measured figures.

2.2. Creating a Work Plan and Estimating Effort

Since the requirements had not been sufficiently defined at the outset, I set the implementation goal as reproducing the existing functionality as closely as possible.

Based on Claude’s analysis, I then broke the overall work down into stages and estimated the implementation sequence and effort required. Given the scale of the existing codebase, I believe that understanding the scope and estimating the effort would itself have been difficult without AI.

The initial schedule was set at approximately 15–16 weeks, from the first week of August 2026 through the second or third week of November. It was difficult to gauge how much AI could shorten the work, so even though the schedule assumed the use of AI, I planned conservatively and made sure to leave enough time for validation.

The most significant outcome of this process was not just the reduction in analysis time, but also the ability to turn work of uncertain scope into a concrete development plan.

3. Designing and Implementing the New System

3.1. Designing and Implementing the New System Architecture

After analyzing the legacy system, I reworked its existing functionality to fit the new system based on Spring Boot (Java) and Vue (TypeScript). I asked Claude to analyze the structure of the current development environment and its coding patterns, and to propose a suitable architecture. After reviewing its suggestions and deciding on the final design direction, I proceeded with implementation according to the staged plan I had created earlier.

Claude handled most of the actual code writing, while I reviewed the implementation, identified necessary changes, and decided on the direction of the next steps. For the frontend, I referred to the functionality and layout of the existing ThingWorx screens, then reworked them to fit the components and styles of the new system.

3.2. Mapping Existing Data to the New Data Model

Data mapping was one area of the migration that particularly required the developer’s domain knowledge. Since the existing and new systems had different database table structures and names, I had to determine which data models in the new system corresponded to the existing data.

Claude helped analyze how the data was used and how it flowed through the system, but I made the data mapping decisions myself based on the actual business meaning. I then implemented the mapping, and documented items requiring confirmation from the client in a separate Word document for review.

This process showed that even when AI performs code analysis and implementation, developers remain responsible for design based on domain knowledge and for interpreting the meaning of data.

4. Managing Work Context with Markdown

One aspect I considered important when carrying out long-term development with an AI Coding Agent was work context management. I concluded that it would be difficult to preserve previous analysis results and decisions over time through conversations with AI alone. To address this, I documented the legacy analysis, staged implementation plan, data mapping information, and other details in Markdown files.

These documents served not merely as records, but also as reference materials for Claude in subsequent tasks. This made it possible to continue work based on previous analyses and implementation decisions, while reducing the burden of repeatedly explaining the same background information. The following diagram illustrates the process.

image1.png

Of course, documentation alone does not ensure that AI will understand all the context correctly. It was still important to instruct it to refer to the appropriate documents and to check its results. This experience showed me that Markdown documents can serve as a shared working reference for preserving analysis results and decisions throughout long-term AI-assisted development.

5. Cross-Validation Using Claude and Codex

5.1. Separating Roles and Validating Between AI Coding Agents

For this development project, I divided the roles so that Claude handled implementation and Codex validated the results. I was concerned that if the same AI handled both implementation and validation, it might repeat its own incorrect judgments.

Once Claude had completed an implementation, I had it review its own code first and write a detailed prompt for Codex to use in its validation. Codex then reviewed the code based on that prompt and identified issues and suggested improvements.

Since Claude, the implementer, wrote the validation prompt, the scope of the review could be influenced by Claude’s perspective. I therefore did not accept Codex’s review results at face value and carried out an additional review.

5.2. Classifying Review Results and Making the Final Decision

I then sent Codex’s review results back to Claude and asked it to classify each item as Accepted, Rejected, or Developer judgment. I also required it to provide the reason and rationale for each classification. I reviewed the rationale and asked for a reassessment whenever the explanation was insufficient or seemed unreasonable.

The overall validation process is shown in the following diagram.

image2.png

The purpose of this approach was not to guarantee code accuracy through cross-validation between AIs, but to compare the review results from different AIs along with their reasoning, so that the developer could make the final decision.

This confirmed that even when AI supports code writing and validation, developers still play an important role in assessing whether the results are sound and making the final decisions.

6. Development Results

This development project was initially scheduled to take approximately 15–16 weeks, from the first week of August 2026 through the second or third week of November. The estimate assumed the use of an AI Coding Agent and included sufficient time for validation.

However, during the project, the client asked us to bring the completion date forward to mid-October. Fortunately, development was progressing faster than expected, and by the end of September we had completed about 90% of the overall work. We then carried out the remaining tasks, including implementing PDF output and adjusting the positions of components within screens.

As a result, the time available for validation was somewhat shorter than originally planned. However, the schedule buffer we had built in made it possible to accommodate the change without difficulty. Ultimately, we successfully implemented the existing system’s functionality in the new environment, incorporated additional requirements, and deployed the system.

This experience showed me that AI Coding Agents can be useful not only for writing code, but also for legacy analysis and work planning, and can help provide the flexibility needed to handle unexpected schedule changes.

7. Conclusion

Through this development project, I experienced how AI Coding Agents can be used for a wide range of development activities—not just writing code, but also analyzing legacy systems, supporting design, implementing solutions, and validating them.

Even though AI handled most of the actual code writing, I did not feel that the developer’s role had diminished. On the contrary, it became even more important to understand the AI’s analysis, choose an appropriate design direction, and assess the soundness of implementation and validation results.

This experience led me to believe that, in the future, developers will need to be increasingly capable of using AI tools effectively, quickly acquiring the necessary technical and domain knowledge, and making sound decisions based on that knowledge.

As AI Coding Agents evolve, the way developers write code themselves may change. However, I believe developers will remain responsible for understanding what needs to be implemented and determining whether the results are correct.

Yang

Site footer