one big agent-driven refactor or twenty small ones on a 60k-line codebase refactor
60k lines of TypeScript, five years old, and we want to move from a hand-rolled DI container to plain constructor injection. Touches roughly 180 files. Nothing about it is hard, it's just enormous and boring — exactly the sort of thing an agent should be good at.
Option A: one branch, let it grind through all 180 files over a couple of days, review at the end.
Option B: 20 PRs of nine files each, merged as they go.
A is obviously less merge pain. B is obviously more reviewable. Team of three, we ship to production twice a week and can't freeze the codebase.
Has anyone done the big one and been glad?
@heirloom_hank · 5mo ago · 2 replies
B, and not for the reviewability reason — for the rebase reason.
You ship twice a week with three people. A branch touching 180 files that lives for two days will conflict with everything, and resolving conflicts in a diff you didn't write is genuinely miserable. Doing it once is annoying; doing it across 180 files after two days of drift is a lost afternoon and a real chance of silently reverting somebody's fix.
The version that works: write the transformation spec first, with two examples done by hand. Then batch by directory, 8-12 files at a time, merged same day. The agent does the same work either way — you're choosing how much unmerged state exists at once.
Twenty PRs sounds like twenty times the ceremony. In practice each is a four-minute review because they're all the same shape and you get fast at spotting the one that isn't.
Reply
Report
@muslin_mira · 5mo ago
The 'you get fast at spotting the deviation' point is what tipped it. Twenty of the same shape is much easier than twenty different shapes at once.
Reply
Report