Skip to main content

How the Agent Should Behave

Share

Share this page

Pass it to someone who needs it.

Star on GitHub

Key takeaway: Give the agent standing rules to follow

Your agent starts every session fresh, so it repeats the same mistakes: wrong folder, wrong style, a tool you already rejected. Correcting it each time is exhausting and it never sticks. This chapter gives you the fix, a rules file the agent reads automatically, every single time.

1.4.1A rules file is your standing instructions

A rules file is a plain text file of standing instructions your agent reads at the start of every session, without being asked. It is how you beat the memory problem from the last chapter: the things that matter are in front of the agent every time, so you never re-type them.

Think of it as onboarding a new hire who arrives with amnesia each morning. The rules file is the one-page brief that makes them productive again in seconds.

1.4.2Put the non-negotiables in writing

Fill it with the decisions you never want to explain twice: the tools you build with, and where new code goes. Add your naming style, which ready-made pieces to prefer or avoid, how to save your work, and "always run the app before telling me it works."

Write them concrete, the way you would tell a person, not as vague vibes.

VagueConcrete rule
"write clean code""keep files under 300 lines, one feature per folder"
"be careful with passwords and keys""never hardcode keys, keep them out of the code"
"test your work""run the app and confirm it works before saying done"

1.4.3Keep it short and living

A giant rules file gets skimmed and ignored, by the agent and by you. Keep it tight, only the rules that actually matter.

And keep it living. Every time you catch yourself correcting the agent on something it should have known, add that as one line. Over a few weeks the file quietly becomes the exact brief your project needs.

Each correction becomes a one-line rule, so you never fix the same thing twice.

1.4.4Where the file lives

The rules file lives inside your project folder, next to your code. It travels with the project, so every agent that opens it reads the same rules. Each tool looks for the file under its own name and place. The simplest move is to let your agent create the right one for the tool you chose.

This prompt has your agent create its own rules file:

Ready prompt
Act as a senior engineer configuring my agent. Read my project folder and README first and work from what is actually there, not from assumptions. Create the rules file for the tool I use, in the right filename and place. Seed it with only what is true today: what I am building, that I am new to this and want plain explanations, and a few non-negotiables, for example run the app and confirm it works before telling me it is done, and never invent a fact you have not checked. Do not invent a stack, a folder layout or a naming style: I have not chosen those yet, and the next chapters add each one here as it is decided. Keep it short, and state in the file that this is the one place my standing rules live, so everything later appends here instead of starting a new file. If you need the full reasoning behind this step, read https://zalt.me/guides/vibe-coding/setup/agent-rules My tool, and what I am building:

Do this now: paste the prompt so your agent creates the rules file, then read it and add one rule you already know you care about. Add to it every time you correct the same thing twice.

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