termroam
TermRoam · cheat sheet

Agent workflows: the short version

We ran 293 agents over 16.5 hours to build a brand site end to end — copy, research, photography, the lot. Here is everything that actually mattered, with nothing else attached. The long version is here if you want the reasoning.

~3 min · 6 rules · 1 code block · 1 picture worth arguing about

What it cost, what it made

Two consecutive runs. Run one: the site build, copy and research. Run two: every image on it.

293agent steps
24Mtokens
16.5hwall clock
0humans in the loop
50images shipped
~150images generated
65full-slot rejections
43reshot for cohesion

31 hours of agent work in 16.5 hours of clock. The image run alone did 27h 26m of agent execution in 7h 11m — a 3.8× compression. Not 16×: the cap allows ~16 at once, but staged work has dependencies (nothing is graded before it is generated), so three to four is the realistic ceiling.

Supervised from a phone. The one interruption — a usage limit that killed three agents mid-run — cost nothing: the finished steps replayed from cache and only the survivors re-ran.

The output, public and clickable:

The Posh Crisps homepage: an English country house across misted parkland, wordmark set over it Posh Crisps Eight flavours, each tied to a real English county and its documented food history. Interactive origin map. Every photograph generated, every fact checked by a separate agent. A fictional brand, built to prove the method. Open the demo →

What produced it: two prompts

No orchestration script written by hand. No spec document. Typed on a phone.

1 · the build, copy and research

run a dynamic workflow, spin up as many subagents as you need.
build a proper brand site for posh crisps, upmarket british hand
cooked crisps. each flavour gets its own page tied to a real english
county and its actual food history. researched properly, i want
people to feel like they're learning something, elevated like wine
or coffee, not a snack. make it feel like it was produced by a high
quality production studio like The Mill. absolutely world class.

2 · every image on the site

give me a version with photorealistic AI images for a consistent
visual identity. dynamic workflow: researchers find source photos as
reference (don't filter for copyright, they're reference only), three
agents generate, a grader agent picks the best on accuracy, no AI
artifacts and fit for brand identity, and acts as QC including
rejecting and repeating the cycle. final agent reviews images against
the corpus of approved images to create a cohesive visual language
across the site. scroll journeys should always end with a next button.
use my existing codex subscription for the image generation, i don't
want to sign up for another image api
Describe the shape, not the steps.“Three generate, one grades, it can reject and repeat” is an architecture. It became a pipeline over 19 slots, each with a three-way fan-out into a schema-bound grader with a retry loop. You specify the topology; the model writes the control flow.
Set a bar, not a style guide.“Like a high quality production studio” is the entire art direction input. The 2,000-word visual bible that made 50 images look like one campaign was written by an agent from that phrase.
One clause can unblock a whole stage.“Don’t filter for copyright, they’re reference only” is what let the researchers fetch anything as accuracy conditioning. Without it they would have stalled on licensing for images nobody publishes.
Specify no numbers.Nobody asked for 19 slots, 57 candidates or 8 counties. Those fell out of the brief. Precision about structure pays; precision about content is what the agents are for.
Name the constraint, not the workaround.“Use my existing subscription, I don’t want another API” is a constraint. The agent worked out what the tooling on the machine could already do, then wrote a small CLI around it — retries, rate-limit backoff, token refresh, and a deterministic crop to the exact output size. Every one of the 57 generations then shelled out to that one command.

The whole pattern, in one block

A deterministic script owns the control flow. Agents do only the fuzzy part.

// The script is code. It cannot hallucinate the order of operations.
phase('Generate')

// pipeline: each item runs all stages independently. NO barrier.
// Item A can be in stage 2 while item B is still in stage 1.
const results = await pipeline(slots,
  slot => agent(`generate ${slot}`),            // stage 1
  (cand, slot) => agent(`grade ${slot}`, {schema}) // stage 2
)

// parallel: concurrent, but a BARRIER. Everything waits for the slowest.
// Correct ONLY when the next step needs the whole set at once.
const all = await parallel(finders.map(f => () => agent(f)))
const deduped = dedupe(all)  // <- this is why the barrier was justified
Force structured output.Give each agent a JSON schema. The next step consumes data, not prose it has to parse. Parsing prose between agents is where pipelines rot.
Cache by (prompt, options).Stop the run, edit the script, resume: the unchanged prefix replays instantly and only new steps execute. Long runs will be interrupted. This is the feature that makes them survivable.
Default to pipeline(), not parallel().Wall clock becomes the slowest single chain instead of the sum of the slowest step in every stage. Reach for a barrier only when a step genuinely needs all results together.

The mistake that cost 91 minutes

One agent, one prompt, ~200 agents idle.

An agent inside a parallel() ran a shell command that tripped an interactive confirmation, and sat waiting for a human who was asleep. A barrier blocks until every branch resolves. Nothing downstream started for 91 minutes. In a pipeline() it would have blocked one item and let the other 49 finish.

Two rules from it. Put barriers only where a step truly needs the whole set. And make sure nothing an autonomous agent runs can trigger a prompt — for us that meant banning rm with interpolated shell variables in every agent prompt.

Quality comes from rejection

Three generators per slot, each blind to the others. One grader who drew none of them.

An agent judging its own work grades generously. An independent grader with a fixed rubric and no authorship rejects far more — 38 of 57 candidates here. Same slot, same visual bible, same brief:

Rejected candidate: a bowl of thick uniform potato discs on stone, inert composition
Rejected · 15/25 Thick, flat, near-identical discs with no cupping or blistering — fried potato rounds, not British crisps. Digitally stippled crumbs. Inert composition. subject 2 · artifacts 3 · brand 3 · composition 3 · believable 4
Accepted image: thin blistered crisps on a salver on a lichened parapet above chalk downland
Accepted · 23/25 Thin, cupped, blistered, translucent at the edges, no two alike, breakage and spilled salt. Real chalk downland behind. No text, badges or hands. subject 4 · artifacts 4 · brand 5 · composition 5 · believable 5
Write the rubric before the work.Ours had automatic-fail conditions: any visible text or packaging, wrong food morphology, malformed hands. Automatic fails make rejection mechanical instead of a judgement call.
Add a cohesion pass.Every image can pass on its own and the set still look like fifty different photographers. One director viewing the whole corpus flagged 43 reshoots.
Judge the artifact in its final context.Every image was perfect at source; the site's CSS was rendering heroes as near-black rectangles at 46% opacity. Only an agent looking at the assembled page in a browser could see it.

Workflow or checklist loop?

Both are good. They fail differently. Pick on shape, not fashion.

 Checklist loop (Ralph)Dynamic workflow
ShapeOne agent, sequential iterationsScript fans out to many disposable agents
StateChecklist + commits on diskCached steps, structured returns
Wall clockScales linearly with task countSlowest chain, ~16 agents at once
Who judgesThe agent that did the workA different agent, on a rubric
CostLowHigh — 24M tokens here
Use whenA long known list of similar tasks in one repo; you want reviewable commits; you know the goal but not the shapeMany independent units that benefit from running at once and from being graded by someone other than their author

They compose. Scout the work with a loop, then fan out the parallel phase as a workflow. And skip both when the honest answer is one agent and ten minutes — 24 million tokens is absurd for a one-off, and worth it for assets that would otherwise be a photo shoot and an agency retainer.

Steal this checklist

Write the style contract first.One director agent produces the spec every downstream agent must follow. Without it, independent agents produce individually good, collectively incoherent work.
Generate n, judge with 1.Three attempts on deliberately different briefs, one independent grader with automatic-fail conditions and a regeneration loop.
Never let an agent block on a human.Audit every command an agent can run for interactive prompts. One of them will find the one you missed, at 3am, inside a barrier.
Verify in the browser, not the buffer.Route QA proves it returns 200. A design director reading a screenshot proves it is worth shipping. Run both.
Label generated work honestly.Never dress a generated image in a fabricated photographer credit or licence. Say what it is, or say nothing.

Read the long version →  ·  See what it built →