I’m just discovering that one of the things Replit agent is best at is re-factoring.
I am currently taking my proof of concept native app (built with Replit agent) and re-factoring it ready to launch as an open-source off-the-shelf scaffold.
I battled with building the original PoC - one of the hardest things I’ve done, £1,500 in credits and about 200 hours in total.
But now, going through and getting Replit to tidy the code, find issues, look at supabase security and performance issues, and a list of a dozen things I’ve come up with to prepare the scaffold is one of the dreamiest things I’ve ever done in s/w.
THIS is what AI dev is good at. And I am sure there will soon be tools that automated it and make it even easier.
I would love other people’s thoughts, but it strikes me the initial vibe coding of an app to support 100 users is the tough bit; re-tooling it ready for 10,000 is easy.
3 Likes
Interesting insight. I am a couple weeks away from this step and would be interested in any prompting tips you have to ensure the refactoring works as intended.
1 Like
I’ve been working with the agent to help me, creating a two tier process and letting it drive things a little:
-
I ask it to come up with ideas for reviewing the codebase, unused code, packages/plugins not used, etc. Also looking at supabase issues if you use that. It seems really good at figuring what would be good to review. But as it produces it’s list, some of it will trigger you to think of other stuff. Pull it all into a master list
-
Then take that list, and one by one (don’t try it all in one big step!), give it prompts for each thing. Re-test your app after each step, Make sure it is creating rollbacks after each step
After battling with some horrible code in the initial build, it’s actually a light relief - it’s almost like this is what AI dev was built for - improving code rather than writing it from scratch. Well, that’s my experience anyway, will be good to hear how you get on.
4 Likes
Nicely done Steve. When are you releasing this into the wild?
2 Likes
3 weeks ago. and then last week. and then yesterday 

why does dev always take longer than planned.
hopefully now a few weeks, max.
1 Like
Well, I guess I’ll see you in 2026 
3 Likes
This has been my experience. Refactoring is golden, and especially a couple months ago before thinking mode, it made replit agent’s ability to navigate the file tree much better, resulting in much better code.
Hahaha, anything always takes longer than expected. That’s the rule 
But I have also come to realize what you’re saying in this thread.
While the agent may be garbage at what I perceive to be a simple design tweak, it kicks a** when trying to implement something I thought would be difficult and technical! Often it’s even done in 1-3 prompts, as opposed to fighting it to use proper css instead of !important for single classes 
“make an email notification system based on this and that.” - done! And working!
Please align this button correctly, and don’t use !important. “Done. Please check it” → “Looks the same and is still broken” → “ah! I figured out the mistake! It is fixed now” → “still looks the same. Cleared cache and all. And an important statement just broke something else. insert caps lock rant”
2 Likes
I sometimes think AI is so powerful it could solve the Middle East issues in a day if we allowed it. Yet at the same time, I wouldn’t trust it to make a cup of tea 
But, it’s only going to get better.
1 Like