agentleFS
vmobifystudiovmobifystudio/app-dev-team/skills/parallel-orchestrator/SKILL.md

parallel-orchestrator

Skill5 starsChanged 8 days agoMITView on GitHub

On an app-dev-team project, use to launch the round's IC agents in parallel via the subagent tool (Task/Agent) once the board has ready tickets. Run by the /app-build orchestrator (the main session) as its step 2; holds the rules for safe concurrent agent execution.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    One spawn per ticket, one slot per spawn: Never batch an owner's tickets into one prompt — compose takes exactly one --ticket, and two …

    line 37
  2. Very specific:

    Use the slot path each lease prints (.agent-wt/ios-developer-1, -2).

    line 49
  3. Very specific:

    Use its stdout as the spawn message verbatim: ticket, board entry, spec excerpts, the slot path as the project root, the integration branch …

    line 67
  4. Very specific:

    It is also the studio kill switch: If .studio-stop exists at the repository root (or APP_TEAM_STOP is set), it refuses with EMERGENCY STOP …

    line 96
  5. Very specific:

    Escalate the model on a retry: after REQUEST CHANGES: haiku → sonnet → opus, capped at opus, passed as the subagent tool's model parameter …

    line 111
  6. Distinctive:

    persist across a sprint: instead of being respawned cold each round.

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Parallel orchestrator

The one copy of the launch procedure, run from /app-build step 2 by the main session once orchestrator.mjs round (step 0) is clear and the board has ready todo tickets. /app-build owns everything before and after the launch — the round preconditions, verifying each DONE, the merge gate, the wave pass and the journal — and holds the one copy of the verify-done outcomes, the model ladder and the token form. Rare branches: references/build-loop-branches.md. The commands below already enforce agent-isolation's orchestrator half; read skills/agent-isolation/references/orchestrator.md only for a project that cannot use worktrees.

Procedure

  1. Pick the ready tickets from node "${CLAUDE_PLUGIN_ROOT}/scripts/board.mjs" show --json: todo, every dependsOn merged (qa or done) and its wave landed — a dependency whose wave is still AWAITING INTEGRATION is not on the integration branch the IC branches from. A ticket behind a blocked dependency is never ready and never reported by this rule — that is the doctor's stranded check at step 0. Spawn a designer, researcher or QA owner only when its ticket is ready — never "to get ahead".

1a. Preflight, then claim, then spawn — every ticket, QA- tickets included. Run dispatch-preflight (/app-build top) first; claim only on CLEAR. Preflight checks the scheduler's ready set, which only holds todo tickets, so a ticket claimed first is in_progress and is refused. Then one append per ticket:

node "${CLAUDE_PLUGIN_ROOT}/scripts/board.mjs" move APP-001 claimed --by ios-developer

claimed is refused on a ticket whose dependency never merged. Spawn nobody for it and say why in the standup. Claiming first also closes the window in which two orchestrators hand out the same ticket.

  1. One spawn per ticket, one slot per spawn. Never batch an owner's tickets into one prompt — compose takes exactly one --ticket, and two agents never share a slot. Slots are keyed <owner>-<n>, up to the scheduler's cap, so one platform can run several ICs at once. An owner with more ready tickets than free slots: the rest wait for a slot to free, in a later round.

2a. Lease the slot for each ticket:

node "${CLAUDE_PLUGIN_ROOT}/scripts/worktree-slot.mjs" lease --owner ios-developer --tickets APP-001
node "${CLAUDE_PLUGIN_ROOT}/scripts/worktree-slot.mjs" lease --owner ios-developer --tickets APP-004

Use the slot path each lease prints (.agent-wt/ios-developer-1, -2). lease refuses when the pool is full — that is the scheduler's cap (scheduler.mjs cap); raising it is a decision about how much of the machine the studio may use, not a workaround.

2a-i. Every agent's prompt carries the destructive-command ban — git reset, git stash, git checkout -- ., git clean, git add -A / . / commit -a (agent-isolation Rules 2, 5; the hook enforces it).

2b. Check for file overlap, not just feature independence. List the files each ticket is likely to touch (impl spec, the ticket's --file set). Any pair sharing a file is serialized.

  1. Compose each agent's prompt with spawn-prompt.mjs — do not hand-write it.

    node "${CLAUDE_PLUGIN_ROOT}/scripts/spawn-prompt.mjs" compose \
      --root . --ticket APP-NNN --role <owner> --slot <the path lease printed>

    Use its stdout as the spawn message verbatim: ticket, board entry, spec excerpts, the slot path as the project root, the integration branch the IC cuts its branch from (git checkout -b feat/APP-NNN-slug <integration branch> — never from the slot's last HEAD), the minted Token: line, and the output contract inlined as literal text. A prompt that points at the contract gets back reports missing every field — measured, same model and role. The PreToolUse hook require-spawn-contract.sh re-verifies every spawn naming a board ticket; a prompt it refuses was not composed.

    Gate roles are composed the same way, one ticket each: --role code-reviewer (--mode design-qa for the design-QA pass, also for ux-architect), tech-lead (second approval), security-reviewer (per-ticket review; required on critical), verification-engineer, release-auditor. A QA- ticket's compose lists every ticket of the wave with its acceptance criteria and mints one qa-engineer token per listed ticket (Token for APP-NNN: …).

3a. Run the isolation gate, last, and obey it.

sh "${CLAUDE_PLUGIN_ROOT}/scripts/spawn-gate.sh" ios-developer-1 ios-developer-2 android-developer-1

It takes the slot names you leased, because that is what has a tree each, and its exit code decides the launch:

  • 0 GO → spawn. With one slot it prints SERIALIZED — the legal one-writer path, valid only while the writer stays alone. Say so in the standup.
  • 1 REFUSED → spawn nobody. It names the slots missing a worktree and prints the git worktree add line for each. Create them and re-run, or serialize the round.
  • 2 CANNOT EVALUATE → not a git repo. Serialize; never treat a 2 as a go-ahead.

It is also the studio kill switch. If .studio-stop exists at the repository root (or APP_TEAM_STOP is set), it refuses with EMERGENCY STOP and the recorded reason: spawn nobody, report what is unfinished, stop the loop. You never clear .studio-stop yourself. An operator sets it with echo "reason" > .studio-stop and clears it with rm .studio-stop.

  1. Launch in a single message. Multiple subagent (Task/Agent) invocations in the same assistant message, one per ticket, each given its own slot path. Sequential launches give up the parallelism.
  2. Stream the reviews — do not wait for the batch. Each DONE goes through /app-build step 3 as it lands, against the base integration-branch.sh resolves. verify-done has three outcomes — VERIFIED, REJECTED (re-spawn the developer), CANNOT EVALUATE (record verified_static, do not re-spawn) — and the per-ticket default is --static, which is always the third. Spawn a code-reviewer for each passing branch in the next message; reviewers run in parallel with each other and with still-running developers.
  3. Escalate the model on a retry after REQUEST CHANGES: haiku → sonnet → opus, capped at opus, passed as the subagent tool's model parameter (/app-build step 4). A rejected verify-done retry is not an escalation: nothing was reviewed, so nothing said the work was hard.

Warm managers (optional — the portable default is respawn)

Where the harness supports named agents plus SendMessage, tech-manager and tech-lead may persist across a sprint instead of being respawned cold each round. The only condition that makes this safe: all durable state stays in files — the event log, the ledger, the board, the fragments, the round journal. A warm manager is a cache, never a source; kill it and the next cold respawn reads the same files and continues. With no named agents, respawn per round is the portable baseline every other step assumes.

Anti-patterns

  • Sequential launches when parallel is safe; parallel launches when two tickets share a file.
  • One prompt carrying several tickets, or a second ticket in a slot still holding the first.
  • Editing docs/31-board.md to record a result — it is generated from the log.
  • Retrying past a refusal — exit 1 from board.mjs is a rule catching something; fix what it names.
  • Believing a DONE you did not verify, or spawning against a board you did not check.
  • Spawning without running spawn-gate.sh — isolation you remembered is not isolation you checked.
  • Re-spawning after REQUEST CHANGES at the tier that just failed.

Worked example

APP-001 todo ios-developer       APP-003 todo backend-developer
APP-002 todo android-developer   APP-004 todo ios-developer
APP-005 todo ios-developer (depends on APP-001)

[same message]  Agent(ios-developer, APP-001, ios-developer-1) · Agent(ios-developer, APP-004, ios-developer-2)
                · Agent(android-developer, APP-002, android-developer-1) · Agent(backend-developer, APP-003, …-1)
[as each DONE verifies]  Agent(code-reviewer, feat/APP-00N-...)

APP-005 is not launched until APP-001 merges; then it gets a fresh slot, branched from the integration branch, in parallel with whatever else is ready.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.