Start here

An example flow

One flow, worked through: the steps in example/, why each is there, and what a feature leaves behind as it goes through them.

assay runs steps; which steps a project has is the project's own. example/ beside the code is one project's .assay/ folder, to copy or link into a project as its own, and this page walks through its flow. It is one way of doing it, not the way: the design is what assay is, and running is every setting used here.

failpasstouchupfailpassreworkredesignacceptrequest.mdspecbuildtestreviewarbitratetouchupcheck@done: the personmerges@person: the persondecides what follows
Step Runs Branch Model
spec one agent in Opus
build one agent in and out Opus
test a command in none
review one to three agents in Gemini Neon, Haiku, Grok
arbitrate one agent in Opus
touchup one agent in and out Sonnet
check a command in none

Each step is a file in example/steps/: what assay needs to run it between +++ lines, then what it is asked.

The steps

  1. spec reads the request and the repo and writes the design: what will be built, in enough detail that a builder who has not seen the request could build it and a reviewer could tell whether it was built. Where a choice is the person's, it asks. It also says how big the work is and what it risks, which settle who reviews it, below. It runs on the strongest model, because every later step is held to the design: a weak one is not caught but enforced.
  2. build builds what the design describes and commits it. Its commits are the feature's branch.
  3. test is a command, the project's build and tests, run on the branch. It is the one thing in the flow that is not an opinion, and reviewers are not spent on work that does not build: a failure goes back to build with everything the command printed.
  4. review is up to three agents, as the feature's settings ask for, each in a role with a part of the step's text to itself and a different job, so that no two find the same things. The auditor always runs, and holds the branch to the design. Where the work risks more than nothing, the breaker joins it: it is asked to break the thing by running it, and to report only what it saw happen, which a cheap model does well. Where the work reaches beyond a file or two, the maintainer judges how it is written, as the person who makes the next change to it: duplication, layout, names, dead code and debt, held to the project's rules and to what each costs the next change. The code already there is not the standard: a bad pattern the change copies is fixed in it, and where else the pattern lives goes to the person as work of its own. A second reader on the auditor's brief was tried on three models and never found what the first had not. A reviewer does not choose where the flow goes: a clean review and one with points both go to the arbitrator, so its verdict is the first line of its review and nothing it says is lost.
  5. arbitrate reads the reviews, checks each point against the code, and chooses what happens next. It is handed the feature's history, so it can weigh a further lap against what the feature has already taken.
  6. touchup makes the few small changes the arbitrator listed, and check runs the build and tests on them. Nothing reviews them again.

Who reviews

The config declares two settings, and what a feature is set to says which of review's agents run. A feature is small and risks none until something sets it.

Setting Words Adds
size small, medium, large from medium, the maintainer
risk none, behaviour, data from behaviour, the breaker

They are two questions and are judged apart: how far a change reaches, which is whether how it is written wants a reviewer of its own, and the worst a mistake in it could do, which is what kind of reviewer it wants: behaviour where fixing the code puts it right, data where the damage outlasts the fix. A small change that could lose data wants the reviewer who runs it, and not the one who judges its layout. The person may set either as they make the feature, assay new notes -F idea.md --set risk=data, and spec, which lists @settings in both in and out, sets them from the request.

agents = [
  { role = "auditor", harness = "agy", model = "gemini-4-neon", effort = "medium" },
  { role = "breaker", harness = "claude", model = "haiku", effort = "medium", at.risk = ["behaviour", "data"] },
  { role = "maintainer", harness = "grok", model = "grok-4.7", effort = "medium", at.size = ["medium", "large"] },
]

The ways on from arbitrate

[next]
accept   = { to = "@done",   when = "no reviewer found anything that must be fixed" }
touchup  = { to = "touchup", when = "the work is right and only small things remain" }
rework   = { to = "build",   when = "the design stands and the code needs changing, in what it does or how it is written" }
redesign = { to = "@person", when = "the design itself is wrong or incomplete" }
  • There are two ways back to code. rework is a full lap: build, test, the reviews and arbitration again, for a change that matters. touchup is for a few lines, and skips the review, which is why it has a step and a command of its own: the same build and tests as test, leading somewhere else.
  • A redesign goes to the person, since a question of design is theirs to settle, with an agent or alone. They turn spec again when they have.
  • accept ends the flow, and the branch is the person's to merge.

What passes between them

A turn is handed what the step before it produced and whatever the person said as they turned it, so each step writes one document and need not know who reads it:

  • The arbitrator's decision ends with what whoever is next has to do. A builder sent back is handed that decision as the step before it, with the design, which it names in in.
  • A failed test's output reaches the builder the same way.
  • A reviewer is handed the test's output as the step before, and names the design and the builder's notes in in.
  • spec names spec?, its own earlier design, for when the arbitrator sends the design back.

So a step's own text says only what is being asked of it. What it is given and what it must hand back are two sections assay adds to its prompt. For build, sent back by the arbitrator:

## What you are given

In /in, read-only:
- 005-arbitrate/claude-1/out.md: what arbitrate produced, the step before you
- 001-spec/claude-1/out.md: what spec produced

## What you hand back

Write to /out:
- out.md: what this step produces; test, the step after you, is handed it
- tell.md: to tell the person something they should know and need not answer, such as what you assumed where you were not told; the work carries on
- ask.md: to ask the person something, which stops this work until they answer, only when you cannot go on without them

The person does not read out.md as it passes: put nothing in it that is meant for them, and say nothing in it of these files or of how you hand things back.

What you commit is kept, so:
- commit source only: no build output, binaries or secrets
- where the build produces files, see that the repo's ignore rules cover them

The branch started at d44139a. Against that it changes 6 files, adding 633 lines and removing 0: git diff d44139a...HEAD shows it.

build last ran at dbde825. Since then it changes 3 files, adding 108 lines and removing 12: git diff dbde825...HEAD shows it.

The repo's .assay folder belongs to the tool running you and is no part of this work: do not read it, act on it or change it.

Between the step's text and that section go the project's standing rules, example/rules.md: how a document is laid out to be read in a terminal, and how plainly to say what was done.

A feature, as it went

The project this flow is tried on is a small command-line tool called notes. One of its features made notes rm undoable, with a bin that empties itself after 30 days:

assay new bin2 "undoable rm" -F request.md
assay turn 12                 spec, the config's start
assay turn 12                 build, and so on: each turn says what follows
assay status 12
012-bin2 assay/012-bin2 at 7f3752a
  risk=data size=medium
  TURN           ENDED         SESSION       MODEL          TIME   COST     TOKENS
  001-spec       done          claude-1      opus           1m24s  $0.3326  16 in, 8.3k out, 229k cached
  002-build      done          claude-1      opus           2m15s  $0.6344  26 in, 17k out, 535k cached
  003-test       done pass     command-1                    3s
  004-review     done          auditor-1     gemini-4-neon  2m15s  $0.3658  53k in, 13k out, 129k cached
                               breaker-1     haiku          1m39s  $0.0187  30 in, 16k out, 614k cached
                               maintainer-1  grok-4.7       3m24s  $0.3656  57k in, 17k out, 296k cached
                               in all                       3m24s
  005-arbitrate  done touchup  claude-1      opus           36s    $0.2004  12 in, 3.1k out, 171k cached
  006-touchup    done          claude-1      sonnet         22s    $0.0565  10 in, 2.2k out, 106k cached
  007-check      done pass     command-1                    3s
  total                                                     12m1s  $1.9740  110k in, 76k out, 2.1M cached
  told you something: 001-spec/by/claude-1/out/tell.md
  told you something: 002-build/by/claude-1/out/tell.md
  told you something: 004-review/by/maintainer-1/out/tell.md
  told you something: 005-arbitrate/by/claude-1/out/tell.md
  told you something: 006-touchup/by/claude-1/out/tell.md

The flow is finished: assay/012-bin2 is yours to merge. Its report is report.md.

One lap and a touch-up. Spec set the risk to data, since a fault in the bin could lose notes for good, so the breaker ran, and the size to medium, so the maintainer did. The breaker found two promises of the design that no test guarded; the arbitrator upheld both and sent them to a touch-up, tests only. What it left is the feature's folder:

.assay-state/features/012-bin2/
  feature.json                  what it is for, and the commit it started from
  request.md
  report.md                     what it took, made from the record when the flow ended
  001-spec/
    step.json
    in/request.md               what /in held
    by/claude-1/
      prompt.md                 the prompt as sent
      out/out.md                the design
      out/settings              the size and risk it set
      out/tell.md               what it assumed, for the person
      transcript.log
      events.jsonl
      meta.json                 how the session ran
  002-build/
    by/claude-1/out/out.md      the builder's notes
    by/claude-1/branch.bundle   its commits
  003-test/
    by/command-1/out/out.md     what it printed
  004-review/
    by/auditor-1/out/out.md
    by/breaker-1/out/out.md
    by/maintainer-1/out/out.md
  005-arbitrate/
    by/claude-1/out/out.md      the rulings, and what the touch-up is to do
    by/claude-1/out/choice      touchup
  006-touchup/
    in/005-arbitrate/...        a link to the decision it was handed
    ...

Looking over code already written

One step is no part of that flow. assess looks over code that has been written and leaves a report: one agent, the repo going in, nothing coming out but its output, and nothing after it.

assay new assess "looking over the code" --start assess --about 1
assay turn 2 -m "the last five commits"
assay turn 2 assess -m "the tests this time"
  • --about 1 names the feature whose work it is looking over: every turn starts from that feature's branch as it then is, and the step, which lists @about/spec?, is handed its design, so it does not report as a fault what the design decided. With --follow in its place the feature looks over the main line, HEAD as it is at each turn.
  • What to look at is said as the message.
  • It lists assess:all in in, so each turn is handed every report it has made in that feature, and begins by saying which of their points still stand.

It is the smallest case of a flow that makes something other than a branch.

Looking back at the flow

retro is no part of the flow either. It looks back at how one finished feature went through it, and judges the flow, not the code: what each step cost against what it gave. It is handed that feature's history, its settings, its report, @about/@report, and its whole folder, @about/@folder. It starts from the report, which already says what each lap was, where the time and the money went, what each session's tool calls were and which failed, and what stands out. It goes to the folder only for what the report points at or cannot say: what a prompt said, why a session did what it did, and which of a reviewer's points the arbitration upheld.

assay new retro "how the flow is doing" --start retro --follow
assay turn <n> --about 3
assay turn <n> retro --about 4

One feature makes every retro, and --about on each turn names the finished feature it looks at, so its own earlier reports are its memory of the others. The first turn begins at retro, its start; it leads nowhere, so each later one names it.

Trying it

A project to try it on needs only to be a git repo with example/ linked in as its .assay:

git init trial && cd trial && git commit --allow-empty -m start
ln -s /path/to/assay/example .assay
assay build
assay new notes -F idea.md

Editing a step there edits the example, and the next turn uses it: the flow is read from the working tree every turn.

What this flow does not do

  • Choose between several builders.
  • Turn the wheel without the person.
  • Sort what comes in before it is specified: every request goes to spec.