each cycle
Syntax
each cycle: plan, then act, then observe
What it does
Defines the repeated unit of work โ the steps the loop runs, in order, on every pass until the goal is met. It's any subset of three verbs: plan reads context and decides the next move read-only; act makes the actual change; observe runs the done when check to see if the loop is finished. The full plan, then act, then observe is the default self-correcting unit, so you can omit the line entirely and get it for free.
You'd write the line to trim the cycle when a phase is wasted effort. A mechanical, well-scoped change often doesn't need a planning step โ act, then observe just does it and checks, saving a model call per cycle. On the other end, an ambiguous task benefits from keeping plan so the agent reasons before it writes. The order is fixed to the verbs you list; you don't invent new steps. Two related places also set it: a config-tier each cycle: at the top of the file sets the default for every loop below, and a loop's own line overrides that default just for itself. Whatever the shape, the observe step is what closes the loop โ it runs the predicate that decides pass (stop) or fail (reflect into the next plan), so a cycle without a way to observe can never end on its own.
Example
each cycle: plan, then act, then observe # full self-correcting unit
each cycle: act, then observe # skip planning โ just do + checktwo shapes
How it runs
Common mistakes
- Dropping
observe. Without it the loop never runs itsdone whencheck, so it can't tell it's finished. Every cycle needs a way to observe or it runs blind to the hard cap. - Cutting
planon an ambiguous task.act, then observesaves a call, but on fuzzy work the agent writes before it reasons and thrashes. Keep planning unless the change is genuinely mechanical. - Inventing steps. The vocabulary is exactly
plan,act,observe. A verb like "review" or "test" isn't a cycle step โ put verification indone whenand after-work inalso. - Forgetting the config-tier default wins by scope. A file-level
each cycle:sets the default; a loop's own line overrides it just for that loop. If a stage isn't cycling as you expect, check which level set it.