Split a giant legacy codebase into modules with an agent doing the grunt work
Nubank used Devin to help migrate an 8-year-old ETL monolith with over 6 million lines into smaller sub-modules, running many sub-tasks in parallel while engineers reviewed. The company reports an 8-12x engineering efficiency gain and over 20x cost savings on that work.
- Difficulty
- Builder
- Setup time
- Not measured yet
- Monthly cost
- $500/mo
- What it saves
- 20x cost savings on migration
How to do it
- Do a few migrations of the same kind by hand and keep the diffs as examples
- Break the big migration into many small, near-identical tasks
- Give the agent the examples and one task at a time, in parallel sessions
- Have engineers review and merge each pull request
- Feed corrections back as examples so later tasks need fewer fixes
The prompt
We are moving classes out of the monolith in /legacy into separate modules. Here are three finished examples of the change: <PR links>. Apply the same pattern to <ClassName>: move it to its own module, update imports everywhere, keep behavior identical, and run the existing tests. Open one pull request per class with a short summary of what moved.
Where this comes from
One person reported it. Promising, not yet confirmed. Original report: Devin (Cognition customer stories).
Tried this? Tell us how it went and help move its proof level up.