mow: multi-agent orchestration
mow turns a finished plan into one self-contained brief per todo, groups the briefs into waves of lanes that own disjoint files, runs each wave as parallel subagents in their own git worktrees, and lets nothing reach the next wave until a separate reviewer has passed the combined diff.
- What it is
- A skill with four modes (
plan,list,ready,go) backed by a package of gate scripts intaskman/taskman/mow/. The skill holds the procedure an orchestrating agent follows; the scripts hold the checks that must not depend on the agent remembering them. - What it isn't
- Not an agent framework. There is no runtime of its own: it drives the host's subagent tool (Claude Code's Agent tool, Cursor's Task tool) and plain git. It is also not for every change; one-file work skips it.
- Why it exists
- One long chat building a dozen todos runs out of context and starts forgetting its own decisions. A dozen fresh chats each rediscover the plan, and two of them edit the same file. mow gives each agent only the context its todo needs, and makes file ownership a planning-time fact instead of a merge-time surprise.
How it works
| Mode | Run it | It does |
|---|---|---|
plan | In the chat where the decisions are still live | Writes docs/plans/<stem>/dispatch/: an INDEX.md with the wave and lane map, one brief per todo. Imports the rows to the board. Prints an operator summary and the orchestration map. |
list | In a fresh chat | Every active run with its full map, plus which runs can safely go in parallel. Read-only. |
ready | Before fan-out | Zooms one run and runs the grill, writing each answer into the plan and briefs. |
go | From any chat | Preflight, then wave by wave: fan out, merge back, review gate, fix rounds. Ends with Integrate, ship-check and the close-out gate. |
The brief: a blind agent's whole world
Each lane agent starts with nothing but its brief and the hydrated decision text the brief points at. It never sees the planning chat. So /mow plan drafts every brief in memory and refuses to write the folder until each passes a thin-brief gate. A thin brief is worse than none: the board import freezes it, and a lane follows it literally.
| Section | Passes when | Refused when |
|---|---|---|
## Goal | A concrete done-state in the agent's own words | An echo of the todo title |
## Context & decisions | At least two bullets a blind agent needs, drawn from the plan and a harvest of the live chat | "See plan", "see chat", or a restated goal |
## Files in scope | Real repo-relative paths the lane owns, plus every existing test the change breaks by shape | Empty, "TBD", "the backend", or a contract change whose broken tests are not listed |
## Do NOT | At least one real scope trap from the grill | "Don't break things" |
## Acceptance check | A SHALL statement, a GIVEN/WHEN/THEN scenario, and a verify command | "Works correctly", "tests pass" |
## QA contract | Checks the lane runs itself, by flavour: a failing regression test first for a bug, before/after numbers for perf, a screenshot at the target viewport for UI | Missing on a code lane, or checks the lane cannot run |
| Decisions / Specs pointers | Decision and requirement ids only, each cited inside Acceptance or Do NOT | Pasted decision prose, or an id no line of the brief cites |
Briefs also carry ## Git rules (lanes never commit), a ## Toolkit of skills to reach for mid-build, and a ## Verification template the lane fills in. Several judgement rules sit beside the table because no script can check them, and each came from a failure: name the shapes you actually sampled when telling a lane how to read an existing file, state the stored form of any matching key and test a non-canonical input, and re-read a review finding's file:line at HEAD before prescribing a fix, because another run may have fixed it already.
Waves: deciding what runs in parallel
The wave map is the hardest planning decision in mow, and it is made by reading file sets, not by intuition. Every todo is classified:
- Sequential when two todos' file sets overlap or one consumes the other's output. They share a lane, or sit in consecutive waves. Shared files are shared state.
- Parallel when file sets are disjoint and neither depends on the other. Separate lanes, same wave.
- Final wave, alone for anything that documents or verifies the others. It depends on everything.
- Foreground only for destructive operations, work outside the repo, or history rewrites. These are marked not-AFK and never run in the background.
Lanes are lettered in wave order from A, and the last lane of a run is always Z, which caps a run at 26 lanes. A plan that needs more should be split. When a plan builds a subsystem that does not exist yet, wave 1 is the thinnest slice that runs end to end, even if that under-uses parallelism; wave 2 widens once the seams are real rather than assumed.
The rule people find surprising is how often the honest answer is "serial". The run in flight while this page was written has five lanes in four waves, and only its last wave runs two lanes at once. Its INDEX spells out why: three lanes touch cli.py, two share five gate modules, and the operator ruled one more pair serial during the grill. That is correct. Parallel lanes that touch one file do not save time; they produce a merge conflict and a run that stops.
Ownership is also checked across runs. Before plan writes and before go fans out, every Files owned cell of every other planned, running or paused run in the repo is unioned, and any overlap (the same path, or one path a prefix of the other) stops the run. A lane stops counting once it has a verification record and its wave has landed, so a later run can take a file as soon as the lane that owned it lands, without waiting for its whole run to ship. Orderings between runs are declared as Lands after: waits, at the precision of a run, a wave or a lane, and one evaluator feeds both preflight and the dependency graph page, so the picture and the refusal cannot disagree.
Lane isolation: worktrees and merge-back
On Claude Code each background code lane gets isolation: "worktree": its own checkout on its own branch, so two lanes cannot corrupt each other's files whatever their briefs say. Disjoint file sets then become a way to avoid merge conflicts rather than the only protection. Getting the merge-back right took dogfooding, and the procedure in the skill is the one that survived a real two-lane run with a real conflict:
- The worktree tool does not commit a lane's changes, so a plain
git mergeof the lane branch does nothing, and sequentialmerge --no-commitbreaks after the first lane. Instead, mow creates one throwaway integration worktree from the wave's starting commit, commits each lane's changes on its own branch, and merges each into the integration branch with a real commit. - A real conflict stops the wave and goes to the operator with the hunks on screen. It is never auto-resolved: a conflict means the plan-time ownership check failed, which is a planning bug to surface.
taskman.mow.land_wavediffs the integration branch against its own merge base, applies it to the main checkout, and commits exactly the landed paths in the same step, built in a private index and moved by compare-and-swap. It refuses if any landed path is already modified in the checkout. Landing used to leave the changes uncommitted, and a peer session's automatic sync committed a whole unreviewed wave under someone else's name minutes later.- Lane worktrees are removed only after the wave has landed and passed its gate, by a sweep that keeps any worktree still holding work or still in use.
Two traps are written into the procedure. A lane must be diffed against its own base, never the main checkout's HEAD: one such diff reported 5,628 deletions across 41 files for a lane that created one file. And a lane never writes to the board from inside its worktree, because the worktree's id counter is a stale copy and merging it back would re-issue live ids. Lanes report the rows they want filed, and the orchestrator files them from the main checkout.
Gates: what stops bad work moving forward
mow has five checkpoints. Two are scripts that refuse; the others are agents in separate contexts whose findings the orchestrator must triage before moving on.
| Checkpoint | When | Refuses or flags |
|---|---|---|
mow-preflight | Before wave 1 | An ungrilled plan, a thin brief, two same-wave lanes owning one file, cross-run overlap, an uncleared wait, a spec plan whose requirements are not all cited by a lane |
check_verification | Each wave's end | A lane with no verification record, unmet QA-contract items, a pointed decision with no "Decisions honored" line, or an artifact that did not change since the wave's base commit |
| Review gate | Each wave's end | Stack reviewers, plus an LLM-security reviewer when prompts or tools changed, run in parallel on the combined wave commit at the top model tier. A reviewer weaker than the builder it checks is a rubber stamp. |
| ship-check | Integrate | Three layers kept separate: matches the plan, respects the system, production ready. Each requirement in the plan's spec is judged met or unmet. |
mow-closeout | The shipped flip | Exit 3 with no ship-check verdict line, a verdict whose hash no longer matches plan.md, a skeletal action report, or a tracker with running lanes or untriaged findings. There is no --force. |
Review findings are triaged by severity. A Critical is fixed now, by a fix-round lane or in the foreground, and the fix is re-reviewed before the next wave. Warnings go onto one checklist task for the whole run, never one task each. Suggestions become captures. After the third failed fix round on the same finding, the orchestrator may not dispatch a fourth: it invokes the recover R-06 ramp, which compares spec, plan and code and waits for the operator.
Fix rounds have their own rule, learned the hard way. A guard written in the same pass as the fix it protects shares the fix's blind spot, so it is mutation-tested separately, in memory, never on disk in a tree other sessions read. One round dispatched to close nine guards that could not fail closed them and introduced three more.
Lane A of the run in flight took 15 minutes and about 130k tokens, invoking tdd, test-coverage and adversarial-tester. The reviewer found no Critical and four Warnings. Three were fixed in a fix round, the fourth went onto the run's checklist task. The re-review of the fix round then found a new Critical, a status cell whose ids would close another task when a row shipped, and the lane went back for a second round. Wave 2 has not started.
What bounds a running lane
Claude Code offers no time or token cap per subagent, so a lane is bounded by two things. Each agent file carries a maxTurns sized from measured runs: cap = max(observed max, ceil(p99 × 1.5)), rounded up to a multiple of 10, applied only to agent types with at least 20 runs. A test fails if a cap drifts from the rule.
| Agent | Measured runs | p50 turns | p99 | Cap |
|---|---|---|---|---|
tdd-builder | 427 | 48 | 212 | 320 |
backend-reviewer | 129 | 11 | 51 | 80 |
ui-designer | 24 | 30 | 155 | 240 |
The second bound is lane-repeat-guard, a hook that denies a subagent's tool call once its identical form has failed three times. A successful edit resets the count, because a red-green TDD loop reruns the same failing test legitimately. A lane stopped at its cap has written no verification record, so the gate already treats it as not done. It may be resumed once (a resume buys a full new turn budget, measured), then re-dispatched at most once with a strictly narrower file scope, then it goes to the operator.
Integrate and close-out
After the last wave the orchestrator runs the repo's post-build tests, then ship-check, then three steps that exist because runs kept losing information at the end:
- Finding triage. Every Critical or Major is classified: mechanizable (the check is added in this run), convention (a tagged decision that future briefs will surface), or one-off (a capture).
- Discovery write-back. Facts learned at go time are sorted by lifetime. Run-scoped facts go in the action report. Anything a lane on a different run would need goes into the repo's own docs or a script. A fact hand-typed into a second lane prompt is, by that repetition alone, permanent.
- Action report and mark-shipped.
action-report.mdrecords outcome, wave results, decisions and leftovers, andtaskman plan mark-shippedcloses the run's board tasks.
Tracker board and token spend
Every run writes dispatch/tracker.json at each event: lane start, agent, skill, artifact, gate result. One local page per repo draws all runs from those files as a left-to-right flow, from the start signal through each wave's lanes to its gate, with per-agent time and tokens. The tracker file is the only per-run state and never moves; a finished run is archived by its own run_status.
bin/mow_spend.py attributes token spend to runs after the fact. It reduces each transcript to sizes and timestamps (never content), counts real usage once per API message, finds which chat owns a run from its writes to the tracker, and places each subagent on its lane, gate or fix round by its description. The result feeds the Runs page described under Observability.
AI engineering practices it demonstrates
- Context isolation. Each lane gets only its brief and the decisions it points at, hydrated into one file, instead of the planner's whole conversation.
- Separation of builder and judge. Builders never commit and never review their own work; reviewers never build; the reviewer tier is never below the builder's.
- Structural isolation over convention. Worktrees make cross-lane corruption impossible on the runtime that supports them, and the docs say plainly where the rule is still only a convention.
- Bounded autonomy. Turn caps sized from measured distributions, a repeat-failure guard, a three-round limit on fix attempts, and an explicit human ramp when any of them trips.
- Verdicts bound to inputs. A ship-check verdict carries the hash of the plan it judged, so editing the plan afterwards invalidates it.
- Evidence as shell output. QA contracts require commands that print their own exit code; a status typed from memory is treated as a hand-written value.
- Cost attribution per lane. Spend is measured per run, wave, lane and fix round, which is what makes "was this run worth it" answerable.
Benefits
- A run can be started, paused and finished from different chats, because everything it needs is in
docs/plans/<stem>/. - Two runs can proceed at once in one repo when their file sets are disjoint, with the overlap check rather than a global lock deciding.
- Every shipped run leaves an action report, verification records per lane and a tracker file, so "what happened in that run" is a file read.
- Failures found in one run become checks or brief rules for the next; many of the rules on this page carry the incident that produced them.
Limits
mow is expensive and intricate. The skill is 1,150 lines, the gate package is 23 modules and 7,404 lines, and most of the procedure is still prose an orchestrating agent must follow correctly. Several open defects are in the gates themselves, so a run can be stopped by its own machinery as well as by bad code.
- Gate bugs that bite real runs. The wave check can false-fail on earlier waves' records that are not yet committed;
land_waverefuses a lane's own verification record although the brief tells the lane to write it; the worktree sweep keeps every lane worktree after a land. - Worktrees are not full environments. A lane's worktree has no virtualenv and no git-ignored env files. In one project every test errored at import inside lanes while the lanes still reported a coverage number.
- Honest wave maps are often serial. Shared hub files such as a CLI module force lanes into separate waves, so the parallel speed-up is smaller than the lane count suggests.
- Caps are per agent type. A docs lane and a multi-module build both run as
tdd-builderand share its 320-turn cap. A failingEditloop is invisible to the repeat guard because the host rejects it before any hook runs. - Overlap is checked per repo. Two runs in different repositories that edit one shared file are not detected.
- Claude Code first. Cursor has no worktree isolation, so lanes share one tree there. Tool-call spend is estimated from characters; only model usage is exact.
Roadmap
| Item | Why it matters | Status |
|---|---|---|
| One module owns each run artifact | Today two gates parse the same report differently and can disagree; this run is in flight | running |
| Fix the wave check and land step for verification records | Both currently refuse correct work and need a hand workaround | correctness |
| Gate a lane's commit range against its Files in scope | Catches a lane that edited outside its brief before review, not after | candidate |
| Cross-repo overlap in preflight | Harness files are shared across repositories; today only one repo's registry is checked | backlog |
| Fail closed on a malformed INDEX | An active run whose INDEX cannot be parsed should block overlap checks, not be skipped | backlog |
| Waves, worktrees and the tracker on VS Code Copilot | Multi-lane mow on a second host, dormant until a plan has more than one lane | planned |
Sources
skills/mow/SKILL.md: modes, brief gate, lane map, runtime resolution, merge-back, review gate, Integrate.skills/mow/TRACKER.md,skills/mow/tracker.html: the tracker contract and page.taskman/taskman/mow/:preflight.py,land_wave.py,check_verification.py,closeout.py,check_ship_check.py,prereqs.py,worktree_sweep.py.docs/workflow/lane-bounds.md,hooks/lane-repeat-guard.py,agents/*.md: caps, the measured table, the repeat guard.docs/workflow/mow-compact-template.md: the session hand-off shape a plan is written in.bin/mow_spend.py: token attribution.docs/plans/dispatch-artifact-owners/dispatch/: INDEX, briefs, verification records andtracker.jsonof the run quoted above, read 2026-10-08.- Counts:
docs/plans/INDEX.mdrows,docs/plans/*/dispatch/folders, brief and verification files, read 2026-10-08.