Skip to content
Amila

Palahepitiya Gamage Amila · Weekly Learnings

What rules should you write down before your second project with AI agents?

· Palahepitiya Gamage Amila

Card titled 25 September: day one, eight rules and seven roles. The eight rules: check a setting reached the running agent; state each fact once; shared start-up files don't say who's in charge; measure the model, don't trust the label; set effort per role, and measure it; turn repeat faults into checks that fail first; run every stage once on real work; record the reason with every change. The seven roles: orchestrator, planner, challenger, builder, verification, UI QA and code reviewer.

On 25 September I took the AI agent setup I'd been using on a client project and moved it into a home of its own, so the next project wouldn't start from scratch. Before I did, I wrote down eight rules from that week.

The short answer. Write down what your first project taught you before you start the second, while the week is still fresh. My eight rules were: check a setting reached the agent, state each fact once, keep shared start-up files quiet about who's in charge, measure the model, set effort per role, turn repeat faults into checks, run every stage once on real work, and record why each change was made. Some held up well. Two of them I had to learn a second time.

Some context. I work as a fractional CTO. From 21 to 25 September, AI agents did real client work for me on two runtimes, Claude Code and Pi. I wrote up one feature from that week, built by seven agents across both. The rules came from what went wrong.

What were the eight rules?

Here they are, in the order I wrote them on 25 September.

  1. Check that a setting actually reached the running agent. Read back what the session recorded, not what you passed in.
  2. State each fact once. A second copy of one fact drifted within a day.
  3. Files that every agent reads at start-up must not say who is in charge.
  4. Measure the model. Don't trust the label. Test on a small task with known answers, several times, on the real route.
  5. Set effort per role, explicitly, and measure it. More effort is not always better.
  6. When reviews keep finding the same kind of fault, write a check, not a better prompt. And a check must fail while the fault exists.
  7. A stage isn't built until it has run once on real work.
  8. Record the reason with the change, in one line, next to the rule.

Why did a start-up file make an agent think it was in charge?

Rule 3 came from a real mix-up that week. Three times, an agent doing one stage of the work read a shared file and decided it was the orchestrator, the agent that hands out the work.

The file had been written as if only the orchestrator would read it. But every agent loaded it at start-up. The fix was to make those shared files neutral, and to say in a role's own file when that role does something different.

That mix-up isn't in my log of what broke after day one. A different start-up problem showed up on 17 October: agents weren't getting all the files they were meant to read. Since then every agent has to prove it loaded its files before it starts work.

How did each rule hold up after day one?

I keep a dated log of what broke and what we changed. Here's what it says about each rule, up to 21 November.

1. Check a setting reached the agent. This one bit on day one. My setup asked for "max" effort on some roles, and Pi quietly ran them at "high". The fix re-applies the setting every time Pi launches, and if a level isn't supported it steps down with a warning, never silently. I had to learn it again later. On 29 October an automatic fallback in Claude Code re-ran two replies on an older Claude model my setup didn't list, and with a bug in my loop, a batch of 11 pieces sat idle overnight. On 10 November the orchestrator itself ran on another unlisted model for 95 messages. Now only models listed in one place may run.

2. State each fact once. Each role's model and effort level live in one model registry, and the launch scripts read them from there. From day one, an automatic check fails if a copy drifts from the registry. On 17 October I did the same for skills: one list now says which skills each stage loads.

3. Shared start-up files don't say who's in charge. Covered above. It hasn't shown up in my log since.

4. Measure the model. On 7 October I picked the model that checks screens from a re-run test. The first test, on 24 September, turned out to be measuring my scripts, not the model. The re-run used:

  • images only
  • 3 runs
  • 4 planted differences to find

The "real route" part mattered too. On 5 November one outage took out a builder model and its fallback at the same time, because both went through the same middleman service. I wrote about why you check the route, not just the model.

5. Set effort per role. Once the effort setting really reached the agent, I tested "high" against "max" on day one:

  • 3 runs at each level
  • the same scores at both
  • "max" used up to 3 times the tokens and time

The challenger, builder, verification and UI QA roles moved to "high". The code reviewer had no effort level set at all, so it got an explicit "high" too.

6. Write a check, and make it fail first. Each fault in the loop that runs my agents got a check, and each check was shown failing on the old code before the fix went in. The number of checks grew:

  • 94 on 3 October
  • 524 on 17 October
  • 1,036 on 5 November
  • all passing when each change was merged

The other half of the rule, about prompts, I proved the hard way. Between 11 and 19 November the orchestrator kept asking me questions in a way that froze its whole session until I answered. The lesson was written down each time, and it happened again. About 17 hours were lost across four of those freezes. A written lesson didn't change the behaviour. I've changed how it asks, and whether that holds isn't measured yet.

7. Run every stage once on real work. I learned this one again too. From 13 October I let the loop build several parts of a plan at once: one at a time, then two, then five. The first run with five builders tripped over itself. Finished builders never saw their own handoffs and were restarted on work they'd already done. The parent loop gave up after about 33 minutes, sooner than one builder takes. Everything had been tested one part at a time. Each fault got its own fix and a check that failed first.

8. Record the reason with the change. From 20 October, on at least 11 nights, I let the orchestrator answer the loop's routine questions while I slept. It logs each answer and the reason for it. The final gate and merges stay with me. On 20 November I let it approve small requests to change files another piece owns, and it logs why each time.

What were the seven starting roles?

The setup started with seven roles, plus me at the gates. A model registry said which model each role used.

  • Orchestrator: hands out the work.
  • Planner: writes the plan.
  • Challenger: questions the plan before anything is built.
  • Builder: writes the code.
  • Verification: checks the claims.
  • UI QA: checks the screens.
  • Code reviewer: reviews the code.

I described how those roles hand work to each other in the operating model behind a multi-agent engineering team.

How did the roles change after day one?

They grew. On 3 October a small router role took routine routing off the orchestrator, and the final gate was set so it can never be handed to an agent.

On 7 October I added discovery and a research check in front of the plan, a designer after it, and spread the roles across model vendors. Claude plans, Qwen does discovery, GLM checks the research, and Kimi designs and checks screens. The planner and the challenger are never allowed to come from the same model family. By 17 October there were 11 roles.

When should you write your own rules down?

Right after your first real project with agents, before the second one starts. That's when you still remember what went wrong and why.

  1. Write each rule next to the thing that went wrong.
  2. Keep each fact in one place, and make something fail when a copy drifts.
  3. For anything that keeps going wrong, write a check and watch it fail before you trust it.
  4. Keep a dated log, so you can see later which rules held.

Expect to learn a couple of them twice. I did.

Related: From code-only to idea-to-product: the three agents I added before the code.

Questions this note answers

What rules should you set before a second project with AI agents?

Write down what the first project taught you. Mine were eight: check a setting reached the agent, state each fact once, keep shared start-up files neutral about who's in charge, measure the model, set effort per role, turn repeat faults into checks that fail first, run every stage once on real work, and record the reason with each change.

What roles does a multi-agent coding setup need?

Mine started with seven: an orchestrator that hands out work, a planner, a challenger that questions the plan, a builder, verification, UI QA for screens, and a code reviewer, with a person at the gates. By 17 October it had grown to 11 roles.

How do you know a setting actually reached an AI agent?

Read back what the running session recorded, not what you passed in. On day one my setup asked for "max" effort and Pi quietly ran "high". Now the setting is re-applied every time Pi launches, and any step down comes with a warning.

Should you fix a repeat agent mistake with a better prompt or a check?

A check. Between 11 and 19 November a lesson written down after each freeze didn't stop the next one, and about 17 hours were lost across four freezes. The checks on my agent loop grew from 94 to 1,036 between 3 October and 5 November, each shown failing first.