Let AI Agents Handle the Refactoring Nobody Wants to Do
Every engineering team has that one backlog ticket everyone ignores. The massive refactoring task. It touches too many files, requires too much mindless work, and provides zero new features for the user. So it sits there, accumulating dust.
I am currently on parental leave. Stepping away from the daily grind gives you a different perspective on how we build software and what actually slows us down. I have been experimenting a lot with AI agents lately, and I realized something important: if you only use AI to write new features, you are missing its biggest superpower. Letting agents do the work your team would never want to do.
Massive refactorings are the perfect use case.
Take migrating from ReactiveSwift to Combine. Ripping out an old reactive framework is usually a nightmare. It is deeply embedded in every layer of the app, from the network layer to the UI. It is exactly the kind of tedious, file-by-file translation that drains a developer’s energy.
But for an agent? It is just a methodical execution of a clear set of rules. Map SignalProducer to AnyPublisher, translate Property to @Published, replace flatMap(.latest) with switchToLatest(). The patterns are well-defined, the transformations are mechanical, and the agent can work through hundreds of files without losing focus.
We had a legacy mock generation system relying on Sourcery. It worked well for years, but it required external tools, Stencil templates, and YAML configs. Converting that to use native Swift Macros is a massive undertaking that nobody wants to own.
An agent can handle this migration smoothly, turning a complex external setup into a pure Swift library. No extra config files, just clean architecture and faster compile times.
Another massive time sink is replacing legacy UIKit views with SwiftUI. We all know how it goes. You have hundreds of screens built with AutoLayout, delegates, and imperative UI code. Rewriting them manually is a slow, error-prone process that drains morale.
But for an AI agent, translating a UIViewController and its constraints into a declarative SwiftUI struct is a perfect task. It reads the layout, maps the state, and generates the modern equivalent while you review the output. The developer’s role shifts from grunt work to quality assurance.

When I get back from leave, presenting this approach is going to be one of the first things I suggest to our engineering guild.
We spend too much time on mindless migrations and boilerplate updates. Strategy is key here. We need to start treating AI not just as a pair programmer for new code, but as a maintenance crew for our technical debt.
The boring work does not go away just because nobody wants to do it. But now we have tools that can handle it. Let the agents do the boring work so the team can focus on building the actual product. 🧹