Mahmoud Zalt

I spent over a decade writing software by hand. The last 3 years I've built almost everything with AI, to the point where it builds features based on user behavior and deploys them by itself.

Vibe coding book

The code was never the problem. AI writes working code on the first try more often than most engineers do. What broke was everything around the code:

  • The agent forgets what it built last week and reimplements it slightly differently.
  • Context drifts mid-session and the answers quietly get worse.
  • It goes in circles on a bug, retrying the same fix infinite times (the on/off issue).
  • It writes code that works but isn't safe or secure. Hackers will email you.
  • It overbuilds abstractions nobody asked for, or worse, swaps out a core dependency.
  • And because it all runs, you don't notice until the codebase is big enough that you're already late.

None of that is an AI problem. It's software engineering running at ten times the speed, with nobody enforcing the discipline that used to come from typing everything yourself.

After my first 3 large AI-built projects, it clicked. I wasn't missing better prompts, or skills, or memory layers. I was missing a process.

So I wrote down everything that consistently worked and everything that kept failing. That turned into 15 stages I now run in order on every build, and give my AI access to:

Set Up → Plan → Architect → Build → Inspect → Amplify → Debug → Test → Automate → Harden → Secure → Protect → Ship → Operate → Scale

The lessons that changed the most

  • Plan first. A written spec beats a clever prompt every time.
  • Architect before you build. AI can only scale a codebase that was designed to scale.
  • Keep a map of where everything lives, and keep it modular. Clear boundaries, always.
  • Work in small slices. Break a large feature into pieces, each one expecting the next to arrive later.
  • Get tests green before you grant more autonomy. Tests are what make trust safe to give. Best enforced on a git hook. There's a simple way to keep coverage above 99%, and yes, my full suite now takes over an hour to run.
  • Security and privacy are stages, not cleanup tasks. Working code isn't safe code. Always try to break it.
  • Build the factory before the car. The factory keeps it running and handles maintenance too.
  • Automate last, once the foundation holds. Only then can you start replacing yourself, and only in stages.

There are a lot more tips and tricks I can't pull off the top of my head right now.

I ended up writing all of this down as a handbook, Vibe Coding with Confidence (by Zalt), mostly because I kept watching almost everyone I mentor repeat the same mistakes. They were just missing the reference.

Anyway, curious what bit you after the prototype stage, and what you do differently now.