Morten Sæther

← Blog

From One Agent to a Team: Why I Split the Work into Roles

#34 · 20 October 2026

The agent that writes the code should not be the one marking it, and the other reasons one context window stopped being enough

Post 33 ended with an agent that had written a feature, reviewed its own work and found it excellent. The answer turned out to be a folder of markdown files describing people who do not exist.

The trigger

The application feature did it, issue #41: talent should be able to apply to a casting from the casting detail page. One agent, one prompt, and a result that looked complete: a cast_application table, a server-logic endpoint, a form on the detail page, a flow to notify the caster, a Playwright test.

Then I read it. The endpoint accepted a talent profile ID from the browser and never checked that it belonged to the signed-in contact, nor that the casting was published and the deadline not passed. The test covered the happy path the same agent had written. The flow had the caster’s e-mail hard-coded. That is what you get when the author and the reviewer share a brain.

A human team would not let that through, because the reviewer did not write the code and has no stake in it being fine. So the first split: one agent implements, another reviews, and the reviewer is told to assume the implementation is wrong until proven otherwise.

The first split: implementer and reviewer

This alone caught most of the application problems on the second attempt: the missing ownership and deadline checks, the happy-path test, the hard-coded address. The implementer fixed them. I read two reports and nodded.

The reviewer was not a better model. It was the same model with a different brief and no memory of having written the code. The quality came from the separation.

The second split: by domain

The reviewer caught what a generalist could catch. It missed the Liquid-in-a-comment-block trap, because it did not know the trap exists. It missed the table created in the wrong solution and the deploy workflow that needed a new environment secret.

Each layer has its own traps. Liquid has the comment block and a date filter that takes .NET formats. Dataverse has solution membership and option sets that come back as numbers. Power Automate has connection references and environment variables that override your deployment settings. GitHub Actions has its own ways of deploying the right artefact to the wrong environment.

So the roles became domain roles: powerpages for Liquid, templates and server logic; dataverse for schema; integration for flows and external APIs; powerplatform for deploy workflows and environments. Then security and qa as the two reviewers, and architect for anything touching more than one of the above. Each role carries the traps for its layer in its own rules, written once and read every time. The coordinator that ties them together gets the next post.

The agent roles: domain roles that build, two reviewers, an architect for cross-layer work, and read-only documentation twins Domain roles build the change, each with the traps for its own layer powerpages Liquid, templates, server logic dataverse schema integration flows, external APIs powerplatform deploy workflows, environments Reviewers security assumes it is broken, qa tries to use it security qa Architect anything touching more than one of the above architect Read-only twins same domain knowledge, no permission to change solution code doc-powerpages doc-dataverse
Each role carries the traps for its layer in its own rules, written once and read every time.

What a role is

A markdown file with a frontmatter block and a body:

---
name: powerpages
description: Liquid, web templates and server logic for the portal
model: sonnet
---
You own everything under web-templates and server-logic.
Never write HTML or JavaScript comments in a web template.
Never place Liquid tags inside a comment block.
Verify every table and column name against the schema before use.
When done, hand off to security, then qa.

The description is what the coordinator reads when deciding who gets a task. The model sets which tier runs it. The body is the rules, the scope and the handoff chain. Without the chain I become the router; with it, “security approved” is a precondition for “done”.

Two readers, one source

GitHub Copilot reads custom agents from .github/agents, Claude Code from .claude/agents, in nearly the same format. I keep .github/agents as the source of truth and mirror it into a gitignored .claude/agents with a script that strips the Copilot-only fields and maps the model names.

The mirror script was stripping the name field, because I had assumed the file name was enough. Claude Code registered none of the agents, and every dispatch to coordinator or powerpages fell back to the built-in generalist. For several days I thought the specialists were working. The giveaway was a Liquid comment that should never have passed review. The rule now: after any change to the agent files, give one named agent a trivial task and confirm it answers as itself.

The read-only twins

There is a second set with a doc- prefix: doc-powerpages, doc-dataverse and so on. Same domain knowledge, no permission to change solution code. They exist for documentation work, where the risk is an agent that “helpfully” fixes a template while documenting it. They get a post of their own later.

What the split bought me

A feature now goes through three pairs of eyes that do not share context: the specialist that builds it, the security reviewer that assumes it is broken, and the qa reviewer that tries to use it. More tokens than one agent, fewer than me finding the ownership check missing in production.

It also bought me a way to improve the system without improving the model. When something gets through, I find the role that should have caught it and add a line to its file. The team gets better one sentence at a time, which is the only kind of better I have managed with a human team either.

Next: the coordinator, the one agent on the team that is not allowed to write code.