Orchestrating parallel coding agents on a Unity project
by
When multiple coding agents edit the same Unity checkout at once, they collide on scenes, drift from project conventions, and land unreviewed diffs. On a private mobile game template (unity-mobile-game-template, supporting URP 2D and URP 3D), I paired Matt Pocock’s engineering workflow skills with my open-source implement-tasks and task-review skills. Together they connect a Backlog.md task queue to parallel Git worktrees, cross-model peer reviews, and CI-gated GitHub pull requests.
Matt Pocock’s mattpocock/skills handle the engineering discipline of a single task: grill-with-docs resolves design ambiguity, to-spec writes a specification, to-tickets slices it into vertical tasks, tdd enforces red-before-green tests at public interfaces, and pr formats pull requests. My contribution in dkoleev/skills wires those skills into a multi-agent execution loop using a Backlog.md queue, isolated Git worktrees in Herdr, risk-based cross-harness routing, a first-party three-axis task-review skill, post-review SHIP_PR handoff, and a self-hosted GitHub Actions gate.
In that private repository, an on-demand Android Device Smoke workflow (doc-3, TASK-35, PR #32) shipped alongside a parallel fix for a Unity QualitySettings vSyncCount regression (TASK-33, PR #31).
Codebase foundation: deep modules and TDD
Following Matt Pocock’s guide, “How to Make Codebases AI Agents Love”, unity-mobile-game-template is structured so an agent can work inside one module without reading the entire repository (ADR-0001).
Runtime code lives in a three-tier acyclic assembly graph (autoReferenced: false):
- Level 0 (Infrastructure):
Game.Save,Game.Configs,Game.Analytics,Game.Scenes - Level 1 (Domain rules):
Game.CoreandGame.Settings, compiled withnoEngineReferences: trueand checked by an EditMode architectural test (ArchitectureGuardTests.cs) that forbidsUnityEnginereferences - Level 2 (Presentation): mutually isolated
Game.View2D,Game.View3D, andGame.UIassemblies - Level 3 (Composition):
Game.Appwires concrete adapters through VContainer without referencingGame.View2DorGame.View3Ddirectly
Each module exposes only public interfaces and a <Module>Module.Register(IContainerBuilder) entry point, keeping implementations internal without InternalsVisibleTo. When a Worker runs /tdd, it writes failing behavioral tests against those public seams first, such as driving IPlayerProgress or IPlayerSettings with an in-memory ISaveStorage fake, or testing the Android E2E bot (Tools/Bot) through its command-line entry with adb and Poco substituted.
End-to-end architecture
Stage 1: upstream planning with Backlog.md
Before any Worker starts, grill-with-docs resolves architectural questions and updates GLOSSARY.md and docs/adr/. For on-device verification, that session produced ADR-0006: Android device checks run only through GitHub Actions on a self-hosted Windows runner labelled android-device in Interactive mode (because a Windows service cannot see the logged-in user’s adb USB authorization), serialized by a single concurrency: android-device group.
Next, to-spec wrote specification doc-3 (On-device verification: Device Smoke, Nightly Extended, and Runner Device Gate), and to-tickets sliced it into a dependency-ordered Backlog.md graph:
TASK-35: Device Smoke workflow on theandroid-devicerunner (no dependencies)TASK-36: Nightly Extended workflow onmainwith unchanged-SHA skip (depends onTASK-35,TASK-53)TASK-37: Bot extended suite with background/resume during a Run (depends onTASK-36)TASK-38andTASK-39:monkeycrash/ANR check +metrics.json, and upgrade over the previous green nightly APK (both depend onTASK-37)TASK-40: RunnerOn-Demand CheckandScheduled Checkdeclarations (depends onTASK-35,TASK-36,TASK-69)
The TASK-35 card defines the contract handed to the Worker and Reviewer:
id: TASK-35
title: Device Smoke workflow on the android-device runner
references:
- backlog/docs/specifications/doc-3 - On-device-verification-Device-Smoke-Nightly-Extended-and-Runner-Device-Gate.md
- docs/adr/0006-on-device-verification-via-self-hosted-workflows.md
Acceptance Criteria:
- #1 workflow_dispatch takes ref and modes (2d, 3d, both) on runner label android-device
- #2 Both modes run even when the first fails; job fails if any mode fails; artifacts upload per mode
- #3 Job summary shows per-mode result and the failing step
- #4 Concurrency group android-device with cancel-in-progress false
- #5 Runner setup script can add android-device label; testing docs state Interactive-mode requirement
- #6 Manual acceptance recorded after merge: one both dispatch passes on phone; two concurrent dispatches queue
- #7 Repository guardrails pass
Stage 2: parallel worktree dispatch and cross-harness routing
In pr delivery mode, implement-tasks updates the card status to In Progress in the primary checkout, then forks each task worktree from origin/main (base_sha) instead of branching from the primary checkout’s local HEAD. Keeping Backlog.md tracker commits out of task branches prevents parallel pull requests from colliding on Markdown status files when they merge.
On 2026-12-01 at 08:05 UTC, the Runner dispatched two independent tasks concurrently from the same origin/main commit (82635be5):
TASK-35(Device Smoke CI workflow) in worktreetasks-task-35on branchtasks/task-35TASK-33(analyzing and reverting an unintendedvSyncCount1 -> 0change inProjectSettings/QualitySettings.asset) in worktreetasks-task-33on branchtasks/task-33
Assignments come from a local browser editor (implement-tasks --configure) backed by .agents/implement-tasks-routing.json. The Runner evaluates rules from top to bottom and picks the first matching rule. When Independent Reviewer is enabled, it prefers a Reviewer from a different harness and model family than the Worker.

Because TASK-35 introduced a GitHub Actions workflow with shared device concurrency and runner registration changes, it matched Rule 1 (High-risk / architectural), assigning codex (gpt-6.2-sol, effort medium) as Worker and claude (opus, effort medium) as Reviewer at Review Depth deep.
At the same time, TASK-33 matched Rule 2 (Typical), assigning claude (sonnet, medium) as Worker and codex (gpt-6.2-sol, medium) as Reviewer at depth standard.
Each task’s state is persisted in <git-common-dir>/implement-tasks/<task-id>/run.json, as shown in this sanitized excerpt from TASK-35’s archived Run Record:
{
"task_id": "TASK-35",
"routing_rule": "High-risk / architectural",
"routing_reason": "CI workflow with shared android-device concurrency and runner setup.",
"worker_harness": "codex",
"worker_model": "gpt-6.2-sol",
"worker_effort": "medium",
"reviewer_harness": "claude",
"reviewer_model": "opus",
"reviewer_effort": "medium",
"review_depth": "deep",
"review_depth_reason": "CI workflow with shared device concurrency and runner setup",
"delivery_mode": "pr",
"base_sha": "82635be500f9d4310dbb711a8c158695904a6f77",
"task_branch": "tasks/task-35",
"submitted_sha": "c372efdab1dffc78be7b5b34966dbe24dd8512e1",
"reviewed_sha": "c372efdab1dffc78be7b5b34966dbe24dd8512e1",
"approval": "human",
"pr_number": 32,
"ci_status": "pass",
"merge_sha": "b20aa5c7bb5d90d42c817cc0e4020794112c5aca",
"done_commit_sha": "648a09606bc907b9d52d965461768f6d40246364"
}
Inside tasks-task-35, the codex Worker implemented .github/workflows/device-smoke.yml, added -AndroidDevice to Tools/CI/setup-self-hosted-runner.ps1, updated docs/agents/testing.md, and committed 69642ef. Before reporting ready, it ran six local workflow fixtures (testing sequential success, 2D build failure, 2D bot failure, single-mode runs, and Python setup failure), a stubbed runner-registration check, Tools/CI/check-repo.ps1, 23 Python bot tests, 244 EditMode tests, and 17 PlayMode tests.
Stage 3: independent three-axis peer review
Originally, implement-tasks delegated peer review to the external code-review skill from mattpocock/skills, which checks two axes: Spec and Standards. In practice, three gaps appeared (ADR-0009):
- A diff can follow every documented rule and satisfy its acceptance criteria on paper while still shipping a logic bug, a data-loss path, or untested risky branches.
- Every task paid the same review cost regardless of risk, and stylistic judgment calls from Fowler’s smell baseline could trigger unnecessary back-and-forth rounds.
- Relying on an external skill’s file layout meant any upstream change could break the Review Loop contract.
To fix this, I created the first-party task-review skill. It keeps Spec and Standards (with Fowler’s smell baseline pinned strictly as note findings), adds a third Correctness axis inspired by ponytail-review (requiring a concrete reachable production failure case for every blocking finding), and scales reading scope by Review Depth:
none: skips review for rule-matched tasks without disabling the Approval Gatelight: reads the diff and checks bugs visible in the diffstandard: reads direct callers, callees, and touched tests; checks Bug, Risk, and Missing testdeep: traces every caller and end-to-end data flow, plus Scale and Speed
A pass on one axis never hides a failure on another. Only blocking findings open a Correction Round (capped at 5 rounds before escalating to a human). Non-blocking improvements and smells are recorded as note entries in summary.md.
On TASK-35 commit 69642ef, the claude (opus) Reviewer ran at deep and returned 0 blocking, 4 notes (verdict: pass, approval=human). The archived review-report.md records those findings:
Review Depth: deep — TASK-35 review-6e30c852, round 0, sha 69642ef
## Spec
1. [note] AC #6 (manual acceptance: `both` passes on the phone; two concurrent dispatches queue) is not recorded yet. It can only run after the workflow is on the default branch and the runner has the `android-device` label.
## Standards
3. [note] `.github/workflows/device-smoke.yml:39`: checkout uses the default `clean: true`, so `git clean -ffdx` deletes `Library/` in the runner workspace, which PR Tests shares. Measured cold import is ~5 min (unity-results/editmode.log). Fix: copy the pr-tests checkout/clean pattern.
## Correctness
4. [note] `device-smoke.yml:118`: the summary is written only after the mode loop. If the run hits the 90-min timeout or is cancelled, the summary is empty, though artifacts still upload via `always()`.
Spec: 0 blocking, 2 notes · Standards: 0 blocking, 1 note · Correctness: 0 blocking, 1 note
Verdict: pass. approval=human
Because approval=human paused the task at the Approval Gate, I read those notes in the Summary Pane before merging. Even though neither issue was blocking, wiping Unity’s Library/ cache would add roughly 5 minutes to every Device Smoke run and the next PR Tests run. I asked the Worker to fix both notes in Round 1 (c372efd): copying clean: false plus git clean -fd -e Library -e Logs -e Temp from pr-tests.yml, and appending summary rows incrementally as each mode finishes. The Reviewer ran a delta-only re-review on 69642ef..c372efd and cleared it with zero findings.
Meanwhile, in the concurrent TASK-33 lane, the codex Reviewer (standard depth) opened 3 Correction Rounds before issuing pass on c41f9d0.
Stage 4: SHIP_PR, /pr, and GitHub Actions CI
During coding and review, git push is forbidden for both Worker and Reviewer (ADR-0007). Only after the Review Gate passes does the Runner send a SHIP_PR message containing a one-time $ship_token:
SHIP_PR task=TASK-35 token=ship-1e3f054a base=main
1. Push: `git push -u origin HEAD:tasks/task-35`
2. Open the PR with `gh pr create --base main --head tasks/task-35`. Format the body with `.agents/skills/pr/SKILL.md` when present and use `GLOSSARY.md` terms.
Using /pr, the Worker formatted PR #32 with an ASCII execution diagram, Before / After / Pending evidence, and a Merge Danger block (Door: Two-way, Blast Radius: Android device CI).
Once the PR opens, the Runner monitors GitHub Actions via gh pr checks <pr-url> --watch. If CI fails, the Runner fetches the failing logs with gh run view --log-failed and sends them straight back to the Worker in its still-open worktree for a fix, local re-verification, and fresh push (still bounded by the 5-round cap). If advancing main creates a merge conflict (mergeStateStatus: DIRTY), the Runner catches it before asking for human approval and routes the conflict back to the Worker.
On TASK-35, the self-hosted PR Tests (unity-tests) workflow ran on 69642ef (green at 08:26Z) and again on Round 1 c372efd (green at 08:44Z). After I typed approve TASK-35, PR #32 merged at 08:45:16Z (b20aa5c7). The Runner then ran sync_pr.py to fast-forward main, committed Backlog.md Done (648a0960) and pushed it, and cleaned up the worktree, local branch, and Herdr space.
Where automation stops
Shared Unity assets
Tasks touching .unity scenes, .prefab files, AddressableAssetsData/**, Packages/manifest.json, or ProjectSettings/** serialize integration because parallel merges risk Unity YAML GUID collisions and shared asset conflicts. Live Unity Editor runs also serialize or use isolated headless -batchmode checks per worktree.
Human Approval Gate
Auto-merge applies only to routine single-module changes with zero verification gaps. Any High-risk / architectural task, sensitive path (.github/workflows/**, Tools/CI/**, Packages/**, ProjectSettings/**, docs/adr/**, Assets/Game/Save/**), visual/scene/UI edit, verification gap (like TASK-35 AC #6), 5-round escalation, or --handle run pauses in awaiting_approval with an open Summary Pane.
Physical hardware
For checks that require the attached phone, .agents/implement-tasks-auto-merge.md declares an optional On-Demand Check (device <task-id>). The Runner offers it at awaiting_approval without blocking auto-merge on routine tasks, while Nightly Extended runs on main in the same android-device queue and proposes a Backlog.md task if it turns red.
Try the workflow yourself
Both the orchestration skills and Matt Pocock’s engineering skills are open source and installable via the skills CLI:
# Orchestration and three-axis review
npx skills add dkoleev/skills --skill implement-tasks --skill task-review
# Companion engineering workflow skills
npx skills add mattpocock/skills --skill codebase-design --skill domain-modeling --skill grill-with-docs --skill to-spec --skill to-tickets --skill tdd --skill pr --skill retro
Once installed in a repository with Herdr and Backlog.md, run implement-tasks --configure to set up your Harness Pool, routing rules, and review depths in the local editor.
Links and references:
dkoleev/skills(implement-tasks,task-review, and ADRs 0001-0009)mattpocock/skills(grill-with-docs,to-spec,to-tickets,tdd,pr,retro)- How to Make Codebases AI Agents Love by Matt Pocock
DietrichGebert/ponytail(ponytail-review)- Herdr (GitHub) and Backlog.md