6 rules I follow after months of vibecoding a full-stack app solo

by•

I'm a non-engineer (MBA, product and ops background) who has spent the last few months vibecoding a production marketplace with Next.js, Supabase and Vercel: auth, bookings, dashboards, a blog and email. These are the rules I learned the hard way.

1. Ask for complete files, not snippets.
"Change lines 40–60" is where things break. The AI drops a closing tag, misses an import, or you paste into the wrong place. I always ask for the full file and replace it entirely. It's slower to read but much faster overall.

2. Never trust the browser with identity.
Early on, my API routes accepted a userId sent from the frontend. That means anyone could pretend to be anyone. Now every server route reads the user from the session cookie, and that's the first thing I check in any AI-generated route. AI tools will happily write insecure code that works perfectly.

3. Generate, don't hand-write, anything that mirrors your database.
I used to ask the AI to write my TypeScript database types. They drifted out of sync within days. Now I generate them from the actual schema with one CLI command. The rule: if a tool can produce it from the source of truth, don't let an AI guess at it.

4. Delete dead code aggressively.
Vibecoding creates a lot of abandoned components, duplicate folders and half-finished routes. Mine eventually broke a production build because of an empty page file nobody used. Every few weeks I ask for a full audit, "list every file that isn't imported anywhere", and delete it.

5. When something looks wrong, clear the cache before you debug.
I spent hours chasing a "bug" where old images kept showing. It was just the build cache. Now my first step for anything weird is to delete .next and restart. I also version my image filenames (-v1, -v2) so browsers can't serve stale copies.

6. Treat git as non-negotiable, especially across devices.
I code on two laptops and once ended up with diverged branches I didn't understand. Now: pull before I start, push before I stop, and commit small and often. When the AI makes a mess, git reset is the undo button that saves the day.

Bonus: set up error monitoring (I use Sentry) before launch, not after. You'll learn things about real browsers and real users that no amount of local testing shows you.

What rules have you picked up? I'm especially curious what other non-engineers do to keep AI-written code secure.

16 views

Add a comment

Replies

Best

An agent generated a fix and a test that went green immediately. Reverting the fix to double-check showed the test still passed. It had written an assertion that bypassed the bug entirely. Always watch the test fail first.

 heard this twice now, fail first goes on our list

I'm on the engineering side, but honestly the thing that's worked best for me is not trusting myself to remember rules at all.

I keep one shared rules file for every project. Every time something goes wrong I write it up, and I'm close to 200 of those now. The ones that happen twice become hooks that block the action before it runs, about 100 so far. One of them checks every date and weekday I write against the calendar, because I got a weekday wrong more than once.