I Let AI Refactor My Legacy Code for 30 Days — The Results Shocked Me

Dev.to AI
Generative AI

I have a monolith. It is a Rails application from 2018 that handles billing for a mid-sized SaaS. We call it "The Beast" internally because it bites back whenever you try to touch the payment logic. For years, my strategy was simple. If it works, do not touch it. If it breaks, patch it with duct tape and prayers. This approach worked until last month when we needed to migrate our payment provider. The existing code was so tangled that estimating the work felt like guessing the weight of a cloud. I decided to run an experiment.