Skip to main content
Handbook/Automate/Page 73 · OS-First

System Comes Before the Code

Share

Share this page

Pass it to someone who needs it.

Star on GitHub

Key takeaway: Build the system before the app

Chapter 9 of 15 · Automate

Setup your AI operating system

Your app is built, debugged, and covered by tests, and you have done every step of that by hand. Here is the move almost nobody makes: hand the whole loop to a system. Give your agents a real operating system, memory, tools, a schedule, and guardrails, so they work like a team instead of one-off chats.

By the end of this part, you can:

  • Stand up agents with memory, tools, and clear roles
  • Put routine work on a schedule so it runs without you
  • Set guardrails so agents fix what's safe and ask on the rest
  • Get one place to see and command everything they do
Done:Test·You are here: Automate·Next:Harden

You defined the system on your first day and you have been feeding it ever since: rules, a spec, decisions, gates, tests. Every bit of it you have driven by hand. That was the point, because you cannot hand over work you have never done. You have now done it, and this part is where you start handing it over.

9.1.1Automation is what trust buys

Automation is one component of the system, not the system itself, and it is deliberately the last one to arrive.

Anyone can put an agent on a schedule on day one. What they get is a machine producing work they have no way to judge, faster than they can check it. You spent the last stages learning what good output looks like on your own project, which is the only thing that makes handing it over safe.

So nothing about the loop changes here. What changes is who runs each step, how much of it survives between sessions, and how many agents can work at once without colliding.

9.1.2Machinery earns its place

Add each piece of machinery only when a task actually hurts without it. The people who run real operations this way never carry a part they have not needed, and neither should you.

The proof is never glamorous. In one long-running setup, a single plain file describing how the deploy really works ended a mistake the agent had repeated in every session. That one page paid for the whole system inside a week.

Each piece of the system arrives because a real task hurt without it, never in advance.

9.1.3The whole system, and where each piece came from

Once the machinery exists, your agents have a home: they know where things go, what matters right now, and how you want the work done. You stop re-explaining yourself and start giving commands.

Everything below belongs to the software department of your operating system, the one this book builds end to end. The growth department attaches to the same tree later, and the last part of the book points at where.

Here is every piece of it on one page:

PieceWhat it gives youWhere it gets built
One entry file every session readsThe agent walks in knowing your projectAlready done, in Set Up
A spec, an architecture, decisions on recordSomething to build against, not vibesAlready done, in Plan and Architect
Gates that block bad work mechanicallyRules that hold when nobody is watchingAlready done, in Build and Test
The tree, departments, and a control centerOne home for everything that is not app codeThis part
Agents with roles, tools, memory, and limitsA crew instead of a chat windowThis part
A shared board, a ledger, and one task pathWork that survives the session it started inThis part
Version stamps, verdicts, and a freshness sweepKnowing whether any of it actually workedLater, once you are live

Only the last two blocks are new. Everything above them you already own, which is exactly why you can be trusted with what comes next.

9.1.4Build your own, and grow it with you

Everywhere else this book tells you to reuse before you build. Your operating system is the one deliberate exception, and building it yourself is the point. You learn exactly how it works, it fits how you build, and it keeps growing with you.

That means your own way to test your work, your own inbox for the tasks you and your agents create, your own way to run your content. Each piece is shaped to what matters to you, not to a generic template.

If you would rather start from a ready-made one, a system like the one this part describes already runs a real company in production. A version you can install and adapt is what could come next. You can follow it and vote for it here.

This prompt sets the base up and, more importantly, teaches your agent that it now has one:

Ready prompt
Act as a senior engineer setting up my operating base. Read my rules file first so this fits what is already recorded. Create one folder that will hold how I run everything, kept outside any single app's code, and put a short README in it saying what it is for and what does NOT belong there, so neither of us fills it with app code later. Leave it otherwise empty; the next chapters fill it in. Then add one line to my rules file naming this folder as the home for plans, decisions and progress, so every future session looks here first. If you need the full reasoning behind this step, read https://zalt.me/guides/vibe-coding/ai-os/os-first Where my project lives, and what I am running:

Do this now: paste the prompt so the folder exists and your agent knows it is the home for everything that is not app code.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Star on GitHubContribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license