Repetitive code migrations across a large monorepo
Find every call site of an old API or type, have a model draft each change, and route grouped diffs to owners for review.
The use case
Changing an ID type from 32 to 64 bits or retiring an old API touches thousands of files owned by hundreds of teams. Google published how it uses LLMs for these internal migrations: tools find the places that need changing, a model writes the edits, automated checks validate them, and changes go to the owning teams for review. They report that most landed code was model-written while engineers handled hard cases and review. The approach needs good code search and a reliable build and test system. Owners still review and approve each change in their area.
Example workflow
- Locate all affected call sites with code search
- Have the model draft edits for each location
- Build and test each change automatically
- Group passing changes and send to code owners
- Handle failures and edge cases by hand
Tools
- LLM API
- Code search
- CI
Risks and guardrails
- Finding call sites is the hard part; missed sites break later
- Model edits can pass tests yet change semantics
- Owners can rubber-stamp large volumes; keep batches small
Sources
Written by Agents Lookup. Credits and official pages for the tools this use case names:
- Google paper: AI for internal code migrations (arXiv): arxiv.org/abs/2501.06972