Refactoring & Migrations with AI: Smarter Code Transformation at Scale

This ad is not shown to multipass and full ticket holders
React Advanced
React Advanced 2025
November 27 - 1, 2025
London, UK & Online
We will be diving deep
Learn More
In partnership with Focus Reactive
Upcoming event
React Advanced 2025
React Advanced 2025
November 27 - 1, 2025. London, UK & Online
Learn more
Bookmark
Rate this content

In this session, I’ll explore how AI-powered tooling is transforming large-scale refactoring and codebase migrations, making these complex tasks faster and more efficient. By leveraging tools like Large Language Models (LLMs), static analysis, and refactoring frameworks, we can automate repetitive code transformations, accelerate migration paths, and reduce human error. I’ll share practical examples of how we can migrate legacy systems to modern frameworks, break monolithic architectures into service-based structures, and automate large-scale code changes across thousands of files.

 I’ll demonstrate how tools like OpenAI Codex, GitHub Copilot, and fine-tuned models for domain-specific transformations can assist in these processes, while still integrating with traditional migration tools and CI/CD systems. I’ll also cover the importance of developer oversight, highlighting lessons learned from real-world production rollouts and how to balance automation with manual reviews.

By the end of the talk, I want attendees to walk away with a clear understanding of how to use AI to enhance their refactoring and migration workflows, ensuring they can handle large-scale transformations while maintaining code quality, consistency, and governance.

This talk has been presented at AI Coding Summit, check out the latest edition of this Tech Conference.

FAQ

GitHub Copilot and GPT-5 Codecs assist in code refactoring by providing context-aware suggestions, handling multi-file changes, suggesting architectural patterns, and operating autonomously to improve code accuracy and efficiency.

Successful AI-powered code migrations include Google's 50% reduction in migration time using AI, Reddit's efficient refactoring across 2,000 repositories, and Pinterest's division of a Python codebase into 200 microservices.

AI can effectively perform framework and language migrations, architectural transformations, and performance and security improvements, handling complex syntax transformations, API migrations, and identifying performance bottlenecks.

Essential rules for successful AI refactoring include preserving original code behavior, providing extensive context, implementing smart retry mechanisms, ensuring multiple validation gates, starting small, and documenting all changes.

AI tools integrate into existing development workflows by providing automatic quality gates, enabling continuous refactoring, and generating comprehensive test suites for AI-generated code.

Challenges include potential AI hallucinations, missing domain-specific constraints, complex business logic errors, and organizational resistance to automated transformations.

Teams can prepare by starting with low-risk tasks, investing in training, establishing governance for AI tools, building supportive infrastructure, and measuring technical debt reduction and productivity gains.

Future developments in AI code refactoring include more sophisticated AI agents capable of handling multi-depository transformations and making architectural decisions with minimal human intervention.

AI plays a fundamental role in refactoring and large-scale code migrations by analyzing thousands of files, understanding complex dependencies, and automating transformations that traditionally took teams months or years to complete.

Nikolay Gushchin
Nikolay Gushchin
19 min
23 Oct, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
AI's role in refactoring and migrations. Tools like GitHub, Copilot, OpenAI Codecs improve transformations. Challenges in large-scale projects and AI's impact on modernizing legacy systems. Google and Reddit's success with AI-powered migrations. Framework migrations with AI: pattern recognition, syntax transformation, and seamless transitions. Successful AI refactoring integrates into CI/CD pipelines, providing critical capabilities like automatic quality gauges and continuous improvement through small changes. Challenges and mitigation strategies in AI refactoring, focusing on testing, human oversight, and organizational obstacles.

1. AI's Role in Refactoring and Migrations

Short description:

AI's role in refactoring and migrations. Tools like GitHub, Copilot, OpenAI Codecs improve transformations. Challenges in large-scale projects and AI's impact on modernizing legacy systems. Google and Reddit's success with AI-powered migrations. Complexities in modern applications and the need for AI-driven solutions.

Hello everybody. Today I want to share how AI is fundamental to change the game for refactoring and large-scale migrations. We are not talking about simple autocomplete anymore. We are talking about AI systems that can analyze thousands of files, understand complex dependencies and automate transformations that previously took teams months, even years.

In the next 20 minutes, we'll explore how tools like GitHub, Copilot, OpenAI Codecs, and other specialized migration frameworks make these complex transformations faster, safer, and more manageable. And more importantly, I will share some real-world lessons learned from my experience and show you how to balance automation with human oversight that is still essential. So when I hear about refactoring with AI, I always think about this tweet.

None of it worked, but boy, was it beautiful. No, but seriously, the idea of AI refactoring has been around for a while, and earlier attempts were clunky and error-prone and often generating more work than they saved. But fast forward to today, and we are seeing AI tools that can handle complex tasks with impressive accuracy. So there is a way forward that we will explore today.

But first, some context. Large-scale code migrations and refactoring projects are just notoriously difficult. Legacy system modernization projects have more than 70% of failure rate. It is like more than two softs. And some examples of this are Facebook transition to React 16, architectures that took more than two years. And Google's recent research that showed that large-scale migrations traditionally require hundreds of software engineering years to complete manually. But here's what's changing. Google recently used AI-powered tooling to reduce migration time by 50%, while having an AI generate 74% of code changes across more than 500 modifications. And Reddit used AI to detect anti-patterns and refactor across 2,000 repositories efficiently. These are not just isolated success stories. They represent a fundamental shift in how we approach cloud transformation. The challenge is not just scale. It is complexity.

Modern applications have intricate dependency graphs, business logic scattered across multiple layers, and the constant pressure to maintain service availability during transitions. Traditional tools like static analyzers and charging replay script just cannot handle contextual understanding required for large and safe migrations. So here's what we will cover in the next 20 minutes. One is types of refactoring that AI can do with some examples. Two is AI-powered refactoring tools. And three, essential rules for LLM-powered refactoring.

2. AI Refactoring: Types, Tools, and Principles

Short description:

AI excels at framework and language migrations, architectural transformations, and performance and security improvements. Key tools include GPT-5 Codecs and GitHub Copilot. Specialized migration tools like SortGraph and Aviator agents aid in large-scale transformations. Foundational principles for successful AI refactoring implementations.

And four, some just final thoughts and recommendations. So, let's look at how AI can be used for refactoring tasks. AI excels at three critical types of large-scale refactoring via previously maintenance methods. First is framework and language migrations. AI can handle complex syntax transformations, API migrations, and even cross-language conversions. We are seeing successful Python-to-Python seq migrations, AngularJS-to-Angular transitions, and Java version upgrades that maintain business logic integrity while adopting modern patterns. Second is architectural transformations. It is the most impressive capability, breaking monoliths into micro-services, instructing shared libraries, and restructuring for better separation of concerns. AI can analyze call graphs, identify boundaries, and suggest database decomposition strategies. Third is performance and security improvements. AI tools can identify performance bottlenecks, suggest algorithmic improvements, and even detect security vulnerabilities during factoring. They are particularly effective at replacing inefficient patterns with optimized alternatives while preserving functionality. So, what tools are available today that can help you with this complex task? Most prominent, of course, is GPT-5 Codecs. It is specifically optimized for complex fair engineering tasks. It is just not just your basic completion tool. It can operate autonomously for up to 7 hours, handling multi-file changes spanning across thousands of lines. In direct evaluation, GPT-5 Codecs achieved more than 50% of accuracy, compared to 39% for standard GPT models. And there is, of course, GitHub Copilot. It has evolved beyond individual developer assistance. Enterprise version can now include specialized refactoring capabilities that understand your entire codebase context. It can suggest architectural patterns, identify code smells across repositories, and propose systematic improvements. There are also specialized migration tools like, for example, SortGraph, Aviator agents, and TwigFunction. They are purposefully built for large-scale transformations. Aviator agents, for example, act as an intelligent migration assistant, finding references, understanding dependencies, and breaking down large transformations into manageable chunks. So, before we dive into examples, let's establish the foundational principles that separate successful AI refactoring implementations from disasters. Based on Google research and just industry-best practices, here are some six non-negotiable rules. And the first is the obvious one. It is to preserve above all the behavior. Refactored code must behave identically to the original under all conditions. This means that comprehensive regression testing, edge case validation, and performance benchmarking are required.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.
The Ai-Assisted Developer Workflow: Build Faster and Smarter Today
JSNation US 2024JSNation US 2024
31 min
The Ai-Assisted Developer Workflow: Build Faster and Smarter Today
Top Content
AI is transforming software engineering by using agents to help with coding. Agents can autonomously complete tasks and make decisions based on data. Collaborative AI and automation are opening new possibilities in code generation. Bolt is a powerful tool for troubleshooting, bug fixing, and authentication. Code generation tools like Copilot and Cursor provide support for selecting models and codebase awareness. Cline is a useful extension for website inspection and testing. Guidelines for coding with agents include defining requirements, choosing the right model, and frequent testing. Clear and concise instructions are crucial in AI-generated code. Experienced engineers are still necessary in understanding architecture and problem-solving. Energy consumption insights and sustainability are discussed in the Talk.
The Rise of the AI Engineer
React Summit US 2023React Summit US 2023
30 min
The Rise of the AI Engineer
Top Content
Watch video: The Rise of the AI Engineer
The rise of AI engineers is driven by the demand for AI and the emergence of ML research and engineering organizations. Start-ups are leveraging AI through APIs, resulting in a time-to-market advantage. The future of AI engineering holds promising results, with a focus on AI UX and the role of AI agents. Equity in AI and the central problems of AI engineering require collective efforts to address. The day-to-day life of an AI engineer involves working on products or infrastructure and dealing with specialties and tools specific to the field.
AI and Web Development: Hype or Reality
JSNation 2023JSNation 2023
24 min
AI and Web Development: Hype or Reality
Top Content
This talk explores the use of AI in web development, including tools like GitHub Copilot and Fig for CLI commands. AI can generate boilerplate code, provide context-aware solutions, and generate dummy data. It can also assist with CSS selectors and regexes, and be integrated into applications. AI is used to enhance the podcast experience by transcribing episodes and providing JSON data. The talk also discusses formatting AI output, crafting requests, and analyzing embeddings for similarity.
Web Apps of the Future With Web AI
JSNation 2024JSNation 2024
32 min
Web Apps of the Future With Web AI
Web AI in JavaScript allows for running machine learning models client-side in a web browser, offering advantages such as privacy, offline capabilities, low latency, and cost savings. Various AI models can be used for tasks like background blur, text toxicity detection, 3D data extraction, face mesh recognition, hand tracking, pose detection, and body segmentation. JavaScript libraries like MediaPipe LLM inference API and Visual Blocks facilitate the use of AI models. Web AI is in its early stages but has the potential to revolutionize web experiences and improve accessibility.
Code coverage with AI
TestJS Summit 2023TestJS Summit 2023
8 min
Code coverage with AI
Premium
Codium is a generative AI assistant for software development that offers code explanation, test generation, and collaboration features. It can generate tests for a GraphQL API in VS Code, improve code coverage, and even document tests. Codium allows analyzing specific code lines, generating tests based on existing ones, and answering code-related questions. It can also provide suggestions for code improvement, help with code refactoring, and assist with writing commit messages.

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
AI for React Developers
React Advanced 2024React Advanced 2024
142 min
AI for React Developers
Top Content
Featured Workshop
Eve Porcello
Eve Porcello
Knowledge of AI tooling is critical for future-proofing the careers of React developers, and the Vercel suite of AI tools is an approachable on-ramp. In this course, we’ll take a closer look at the Vercel AI SDK and how this can help React developers build streaming interfaces with JavaScript and Next.js. We’ll also incorporate additional 3rd party APIs to build and deploy a music visualization app.
Topics:- Creating a React Project with Next.js- Choosing a LLM- Customizing Streaming Interfaces- Building Routes- Creating and Generating Components - Using Hooks (useChat, useCompletion, useActions, etc)
Building Full Stack Apps With Cursor
JSNation 2025JSNation 2025
46 min
Building Full Stack Apps With Cursor
Featured Workshop
Mike Mikula
Mike Mikula
In this workshop I’ll cover a repeatable process on how to spin up full stack apps in Cursor.  Expect to understand techniques such as using GPT to create product requirements, database schemas, roadmaps and using those in notes to generate checklists to guide app development.  We will dive further in on how to fix hallucinations/ errors that occur, useful prompts to make your app look and feel modern, approaches to get every layer wired up and more!  By the end expect to be able to run your own AI generated full stack app on your machine!
Please, find the FAQ here
Vibe coding with Cline
JSNation 2025JSNation 2025
64 min
Vibe coding with Cline
Featured Workshop
Nik Pash
Nik Pash
The way we write code is fundamentally changing. Instead of getting stuck in nested loops and implementation details, imagine focusing purely on architecture and creative problem-solving while your AI pair programmer handles the execution. In this hands-on workshop, I'll show you how to leverage Cline (an autonomous coding agent that recently hit 1M VS Code downloads) to dramatically accelerate your development workflow through a practice we call "vibe coding" - where humans focus on high-level thinking and AI handles the implementation.You'll discover:The fundamental principles of "vibe coding" and how it differs from traditional developmentHow to architect solutions at a high level and have AI implement them accuratelyLive demo: Building a production-grade caching system in Go that saved us $500/weekTechniques for using AI to understand complex codebases in minutes instead of hoursBest practices for prompting AI agents to get exactly the code you wantCommon pitfalls to avoid when working with AI coding assistantsStrategies for using AI to accelerate learning and reduce dependency on senior engineersHow to effectively combine human creativity with AI implementation capabilitiesWhether you're a junior developer looking to accelerate your learning or a senior engineer wanting to optimize your workflow, you'll leave this workshop with practical experience in AI-assisted development that you can immediately apply to your projects. Through live coding demos and hands-on exercises, you'll learn how to leverage Cline to write better code faster while focusing on what matters - solving real problems.
Free webinar: Building Full Stack Apps With Cursor
Productivity Conf for Devs and Tech LeadersProductivity Conf for Devs and Tech Leaders
71 min
Free webinar: Building Full Stack Apps With Cursor
Top Content
WorkshopFree
Mike Mikula
Mike Mikula
In this webinar I’ll cover a repeatable process on how to spin up full stack apps in Cursor.  Expect to understand techniques such as using GPT to create product requirements, database schemas, roadmaps and using those in notes to generate checklists to guide app development.  We will dive further in on how to fix hallucinations/ errors that occur, useful prompts to make your app look and feel modern, approaches to get every layer wired up and more!  By the end expect to be able to run your own ai generated full stack app on your machine!
Working With OpenAI and Prompt Engineering for React Developers
React Advanced 2023React Advanced 2023
98 min
Working With OpenAI and Prompt Engineering for React Developers
Top Content
Workshop
Richard Moss
Richard Moss
In this workshop we'll take a tour of applied AI from the perspective of front end developers, zooming in on the emerging best practices when it comes to working with LLMs to build great products. This workshop is based on learnings from working with the OpenAI API from its debut last November to build out a working MVP which became PowerModeAI (A customer facing ideation and slide creation tool).
In the workshop they'll be a mix of presentation and hands on exercises to cover topics including:
- GPT fundamentals- Pitfalls of LLMs- Prompt engineering best practices and techniques- Using the playground effectively- Installing and configuring the OpenAI SDK- Approaches to working with the API and prompt management- Implementing the API to build an AI powered customer facing application- Fine tuning and embeddings- Emerging best practice on LLMOps