# Rules for agents building software

From Chief of Agents (https://chiefofagents.si), a living thesis by Tanvir. 27 lessons from eleven weeks of running agents on real projects, one rule each.
Adapt them to your project. The three decisions at the end are mine. Yours may differ.

## 1. Choose the problem

- Rule 1. Settle the unclear parts before building, and record the answers somewhere that outlives the conversation. (The agent interviews me first, https://chiefofagents.si/one-page#rule-1)
- Rule 2. Write one PRD for the project, keep it under version control, and start every agent from it. (Give the project one source of truth, https://chiefofagents.si/one-page#rule-2)
- Rule 3. Cut work by what a user can do, never by technical layer. (Stop building frontend, backend, then database, https://chiefofagents.si/one-page#rule-3)
- Rule 4. Build one thin, complete journey and test it end to end before you build wider. (Prove one complete path first, https://chiefofagents.si/one-page#rule-4)

## 2. Assign the work

- Rule 5. Write the takeover packet after the work is verified, and write it for someone who knows nothing. (Every slice gets a takeover packet, https://chiefofagents.si/one-page#rule-5)
- Rule 6. Make the unit of work a verified outcome in the repository, so any fresh agent can continue from it. (Git carries truth between chats, https://chiefofagents.si/one-page#rule-6)
- Rule 8. Give every agent one task and one owner, and keep the one who built it away from the one who approves it. (One lead agent, and specialists, https://chiefofagents.si/one-page#rule-8)
- Rule 9. Reach for the simple shape first. (Loop or graph, https://chiefofagents.si/one-page#rule-9)
- Rule 10. If several agents share a task, write down the state they all read from. (What the graph holds, https://chiefofagents.si/one-page#rule-10)
- Rule 12. Use a checklist when a checklist does the job. (Sequence, loop or graph?, https://chiefofagents.si/one-page#rule-12)
- Rule 26. Route by how much it costs to be wrong. (Match the model to the task, https://chiefofagents.si/one-page#rule-26)

## 3. Set the boundaries

- Rule 7. Replace watching with writing. What you would have caught by looking has to be caught by a rule. (More freedom needs more structure, https://chiefofagents.si/one-page#rule-7)
- Rule 11. Decide before you leave what the agent may never do, and make it stop when it gets there. (Preparing an AFK run, https://chiefofagents.si/one-page#rule-11)
- Rule 13. Design the run so the most it can do without you is prepare a decision, or carry out one you granted in writing before you left. (Anatomy of an AFK run, https://chiefofagents.si/one-page#rule-13)
- Rule 16. Assume anything an agent can print, it can read. (Keep secrets out of sight, https://chiefofagents.si/one-page#rule-16)
- Rule 17. Give agents a full copy of the shape of production and no route to the real thing. (Never test against production data, https://chiefofagents.si/one-page#rule-17)
- Rule 18. Check where a tool is pointing before it speaks, and fail loudly if the answer is not what its name promises. (Local means local, https://chiefofagents.si/one-page#rule-18)
- Rule 19. Database first, code second, and never rewrite a migration that has already run. (The database must be ready first, https://chiefofagents.si/one-page#rule-19)

## 4. Judge the result

- Rule 14. Make the thing you review small, single-purpose and tied to one exact commit. (Returning at the merge gate, https://chiefofagents.si/one-page#rule-14)
- Rule 15. Treat "it works here", "it is deployed" and "it works for users" as three different claims. (What happens after the code works, https://chiefofagents.si/one-page#rule-15)
- Rule 20. Use review that the builder does not control, and make it look at the running product. (Nobody grades their own homework, https://chiefofagents.si/one-page#rule-20)
- Rule 21. Measure at the boundary where the money is spent, and believe the party that sends the bill. (Over ten times the estimate, https://chiefofagents.si/one-page#rule-21)
- Rule 22. Test for the thing that should happen. Silence is not a result. (No feature, no bug, https://chiefofagents.si/one-page#rule-22)

## 5. Make it stick

- Rule 23. Decide where each kind of knowledge lives, and which source wins when two disagree. (New agent, same old mistakes, https://chiefofagents.si/one-page#rule-23)
- Rule 24. After every failure ask where the lesson must live so that it cannot be skipped. (Scar tissue, https://chiefofagents.si/one-page#rule-24)
- Rule 25. When you catch yourself typing the same instruction a third time, package it. (House rules, https://chiefofagents.si/one-page#rule-25)

## 6. What stays mine

- Rule 27. Pick the few decisions you will never hand over, write them down, and delegate the rest. (The bottleneck, https://chiefofagents.si/one-page#rule-27)

## Never, without a person

- Merge into the main branch.
- Change the production database.
- Publish anything.

## Always stop and wait if the next step would

- Force-push over history.
- Expose a secret.
- Change the production database.
- Merge code, unless granted in writing for this run.
- Publish, unless granted in writing for this run.
