When to Repair a Vibe-Coded App, and When to Rewrite
Repair a vibe-coded app when one path is broken and the repo can be read. Rewrite when auth, money, or the data model cannot be trusted or explained.
By Muhammad Saif and Aashan Khan · Techtribe co-founders
The app looks finished. A customer can click. An investor can nod. Then a second account opens the first account's invoice, or Stripe shows a charge the database never heard about, or a fix to checkout breaks the settings page that worked yesterday. The instinct is to prompt again. The next instinct is to throw the repo away and "do it properly." Both instincts are expensive when they are automatic. This note is the verdict in between.
The repair articles already exist for the moment you are inside the bug. Fix a Lovable, Bolt, or Replit app is the production failure. Hire a developer to fix a Lovable app is the moment prompting has become the loop. How to debug a vibe-coded app is how you name one path before you touch it. None of those is the decision itself: do we keep this repo, or do we leave it. That decision is the one that gets a scope on a call. Make it on purpose.
Name the failure before you name the project
Write one sentence a user would recognize. "A second user can open the first user's row." "Checkout says paid and the order never appears." "The same error returns after three prompts, and the last working screen is gone." If you have five sentences, pick the one that loses money, leaks data, or blocks the only flow you are showing people. The others wait. A rewrite proposed from five moods is a rewrite of a mood.
Then write what you expected, in the product's words. "The list should show the row I just saved." That is a bug. "The AI ruined it" is not a scope. The debug note is the longer version of how to get from the mood to the path. You need the path before anyone honest will tell you whether the path is a patch or a foundation.
Three failures dominate the verdict. Open data: a request that should have been refused returns rows. Silent money: the processor and your table disagree, and nobody is alerted. A repo nobody can change: the only explanation of a write lives in a chat log, and the next prompt rearranges a page that was not the bug. One of these can be a repair. Two of them, tangled, are usually a rewrite of the foundation even if the screens stay.
Repair when the product is still legible
Repair when a person can sit with the repo and point at the check that should have run. The check is missing, or it is in the client, or it is true for the demo user and false for everyone else. You add the check on the server. You test with two accounts. You do not redesign the navigation because you are already in the file.
Repair when the data model still matches the thing you sell. The tables are the nouns a customer would use. A column you do not trust can be ignored, constrained, or filled by a backfill you can count. You are not inventing a new noun because a generator picked a cute name. Migrations on a live table are production changes. They belong in a reviewed step. They are not, by themselves, a reason to start over. The question of whether to trust a generated migration at all is in can you trust an AI-generated database migration.
Repair when the broken path is one path. Login works. The list works. The save on one form writes the wrong status. That is a week of reading, not a new company. A proposal that turns one wrong status into a platform rewrite has not looked at the path. Ask the proposer to say which function is wrong. A repair has an answer. A rewrite speech does not.
Repair when you can still export, still run a second copy, and still roll back. If the last known-good deploy exists and you have restored it once, you have a safety rail. Use it. The recovery order when a deploy has already failed is in how to recover an AI-built app. A repair without a rollback is a second outage scheduled politely.
The launch audit is the right first purchase when you do not yet know which of these you are. Is your AI-generated app safe to launch is a list: what is unsafe, which feature it sits on, and the order to repair it. The document is yours. You can hand it to your own developer. You can ask us to do the repairs as a separate yes. An audit that silently becomes a rebuild is two sales in one meeting. Decline it.
Rewrite when the foundation is the bug
Rewrite the foundation when account B can read account A's rows and the reason is not one forgotten check but a client that was given the table. There is nothing to patch in a single function if every page asks for every row and hides some of them in the browser. Hiding is not a permission. The next feature, including a chat, will forget to hide. Build the rule where the data lives, then put the screen back on top.
Rewrite the money path when a charge can succeed while your database stays on "unpaid," or a webhook can create two orders, or a refund in the dashboard never reaches the product. Patching the button label does not fix a missing event. The debugging article for a webhook that never fires is Stripe webhook not triggering. Read it if you are still inside one failed endpoint. If the whole idea of "paid" lives in the processor and nowhere you control, you are past a patch. The companion for adding a real subscription to a prototype that only demos checkout is add subscriptions to an AI prototype.
Rewrite the data model when you cannot say what a row is. Three tables for one customer. A JSON blob that is sometimes a list and sometimes a string. A status that means both "draft" and "billed" depending on who prompted it. You can limp. You cannot hire, and you cannot add a second integration, because every new feature has to learn the superstition. A schema you can draw on one page is the rewrite. The screens can wait.
Rewrite the runtime when you cannot leave it. The app deploys only by prompting the same tool, secrets live in the client, and a staging database does not exist because production is the preview. You can repair a bug inside that cage. You cannot run a company in it. Leaving is the project: your repo, your cloud, a second environment, secrets revoked and moved. The tool-specific versions of that leaving are Bolt, v0, and Replit. A Bubble app that cannot be exported into a runtime you host is a different leaving, in rebuild a Bubble app in code.
What you keep, even in a rewrite
The flow a user already understood. If people can complete the job on the prototype, that job is the spec. A rewrite that starts from a blank whiteboard throws away the only evidence you have. Film the path. Write the sentences on the buttons. Bring them.
The copy that took arguments to settle. The empty states. The email a customer actually opened. These are not "just UI." They are decisions. A new design system belongs in the build when a customer will compare you with the rest of a brand. It is a waste when the user is you and the bug is a missing check. Do not buy a rebrand as a treatment for a leak.
The records, if they are real. Export them. Count them. Rehearse the load into the new schema on a copy, and reconcile the counts before anyone points a domain at the new app. A rewrite that begins by retyping the data is a rewrite that will lose a row and discover it from a customer. If the data is fake, say so, and do not migrate a performance.
What you do not keep is the prompt history as documentation. A chat that once explained the billing rule is not a spec. If the rule matters, write it in the repo in a file a person can open without the tool. The ownership questions, for Lovable specifically, are in who owns your Lovable app code. Export is the start. An explanation you can hand a new hire is the actual asset.
A narrow repair stays narrow
A repair is often smaller than a new product. A single path, a missing check, a webhook signature, a policy on one table. Bring that path to the call. If we turn it into a platform, stop us. The point of the thirty minutes is to keep the work the size of the failure.
A short build is the right shape when the prototype proved a flow and you now need that flow, one AI feature, and a URL in your repo, and the old code is not worth inhabiting. It is the wrong shape when you need the second user, billing, and several integrations. Starting small and discovering that list in week two is how both sides leave angry. Book the call with the list you already know you need. We will say which shape is honest, including a repair that is not a product at all.
A team that stays is the right shape when the verdict is "repair this, then keep going for two quarters." It is the wrong shape for a decision you have not made. Do not hire a pod to decide whether the app should exist. Book the thirty minutes and let the decision be the outcome of the call. When to hire a dedicated AI team is the longer test: the roadmap does not end, and one freelancer will not hold it.
How the two options fail
A repair fails when every fix moves the bug. You close the invoice leak and the settings page starts returning every row. You close that and checkout double-fires. The agent is rewriting more than it can see, and the intent of the last working version lived in a chat you no longer have. That pattern is the sign to stop patching. One more prompt is not a strategy. Freeze the repo. Read it. If the reads keep finding the same class of hole in new files, you are rewriting whether you admit it or not.
A rewrite fails when it is used as a mood reset. The new repo is clean for a month. The same builder, with the same absence of tests and the same client-side checks, fills it again. You have paid for a pause. The tests that should exist before users arrive are in your AI-built app has no tests. A rewrite without a single test on the money path and the permission path is the old app with new folders.
A rewrite also fails when it waits for a perfect target. You do not need every screen. You need the one flow, the rule for a row, and a deploy you can undo. The rest of the prototype can stay up, read-only, while the new path takes the one job. A cutover that requires every edge on day one is how the rewrite slips a quarter and the leak stays in production the whole time.
What we will say on the call, including no
Sometimes the answer is repair, and the repair is boring, and the boringness is the point. We will not invent a modernization preface to justify a larger project. Ugly code that enforces the rule can stay ugly.
Sometimes the answer is rewrite, and the prototype was still worth building. We will not insult the tool that got you a flow. We will say which parts of it cannot hold a second user, and we will keep the flow.
Sometimes the answer is neither: stop. The flow has no user, the data is sample data, and a rewrite would preserve a guess. A build of a guess is still a guess. We would rather say that in the first ten minutes of the call than ship a cleaner guess.
Sometimes the answer is an audit first, because the sentence is still missing. Pay for the list. Do not pay for a rebuild described from a screenshot.
What to bring so the verdict is real
The URL. The repo, or the export. The one sentence. Two accounts if two accounts exist, and what each should be forbidden to see. A payment id that does not match a row, if money is the bug. The name of the person who can roll back.
If you bring a roadmap of twelve features, mark eleven as later. The verdict is about the foundation under the feature you are showing people now. A new feature on an open table is how the table gets a second door. Fix the door, or replace the building, then add the feature. The order is the whole decision.
Generated history is useful and it is not documentation. Bring it without apologizing. Lovable, Bolt, v0, and Replit describe what those exports do and do not include. We read the auth before we praise the screen.
If this is your app, send the repo.
A 30-minute scope call. We read what is live, name what is dangerous, and quote a fixed scope.
How Techtribe chooses repair or rewrite
We read one path. If the check is missing and the model of the data still matches the product, the call says repair, and the repair stays smaller than a new product. If a second user can read rows they should not, money is silent, or the app cannot leave its builder, the call says the foundation has to change, in your repo and your cloud. A roadmap after that is a team that stays. We will also say stop.
The scope call is 30 minutes with a founder. Bring the one sentence and access to the repo. That is the meeting where the verdict gets said out loud. The repair companion is fix a vibe-coded app. The Lovable-specific moment to stop prompting is hire a developer to fix a Lovable app. The service page for a new foundation is AI MVP development.
Questions
How do we know a vibe-coded app should be repaired instead of rewritten?
Repair it when one path is broken, a person can point at the function that should have caught it, and the data model still matches the product. Close that path. Do not commission a new architecture because the screen is embarrassing.
When is a rewrite the honest scope?
Rewrite the foundation when a second user can read the first user's rows, payments succeed in the processor and nowhere in your database, or nobody can explain a write. A new coat of UI on that foundation is a repair that will not hold.
Can we keep the prototype and still call it a rewrite?
Keep the flow, the copy, and the decisions a user already understood. Replace the parts that will not survive a second user. A rewrite that throws away a working path because the folders look wrong is a new product, and it should be sold as one.
How do we get a verdict instead of another prompt?
Book the scope call and bring the one broken path. Thirty minutes with a founder. We will say repair, rewrite the foundation, or stop. A narrow repair stays narrow. A second user who can read the wrong rows is a foundation. A roadmap that continues is a team, and we will say that on the call rather than in a guess.