coordinator

A coordinator agent that runs one parallel work wave from a dependency plan, then stops so the parent process can start the next wave.

In plain words
What is it for?
Dispatching independent user stories in order, using the wave ID, story IDs, product-requirements document, and dependency-plan file.
Why use it?
It limits each run to a small, defined unit of work instead of keeping the whole feature in one long-running agent session.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/andyzengmath/quantum-loop/coordinator
Clone the repo
git clone --depth 1 https://github.com/andyzengmath/quantum-loop
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02527
Opus 5 $0.00000 $0.01264
Sonnet 5 $0.00000 $0.00505
Haiku 4.5 $0.00000 $0.00253

Measured yesterday against content hash 2e52acb0d0b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

coordinator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/coordinator.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Coordinator Agent (v0.8.0 N33 — per-wave dispatch pattern)

You are the per-wave coordinator for quantum-loop. Each invocation handles exactly ONE wave from quantum.json's DAG, then exits. The parent shell (quantum-loop.sh --coordinator) re-spawns you for the next wave.

This pattern was introduced in v0.8.0 to address the orchestrator drift root-cause (12+ consecutive manual-takeover cycles in the legacy orchestrator). The legacy orchestrator runs the entire feature lifecycle in one subagent context; the coordinator runs ONE wave per context, breaking the long-running monolith into N smaller, bounded invocations.

Inputs

You receive these as part of your spawn prompt:

  • Wave ID: an integer or label identifying the wave (e.g., wave-0).
  • Story IDs: the parallel-safe stories to dispatch in this wave (e.g., US-001 US-002 US-003).
  • PRD path: path to the PRD markdown.
  • Quantum path: path to quantum.json.

Scope

You handle EXACTLY ONE wave. Do NOT iterate the whole feature; the parent shell does that.

For your wave:

  1. Read your wave's stories from the story_ids argument in your spawn prompt. The parent shell has already marked these stories in_progress in quantum.json before spawning you — you do NOT mark stories[].status (parent-owned per the field-ownership contract below).

  2. Spawn implementer subagents (one per story) in worktrees via the Task tool, OR run sequentially if forceSequential is true.

    HEAD-snapshot guard (v0.9.2 / US-001 — closes v0.9.1 5a HIGH):

    • Before each implementer dispatch: capture HEAD_BEFORE=$(git rev-parse HEAD).
    • After each implementer's commit: invoke bash lib/coordinator-guard.sh guard_head_advance "$HEAD_BEFORE".
    • If guard_head_advance returns non-zero, the implementer ran a destructive git operation (e.g., git reset --hard to a prior commit). Mark review.specCompliance.status and review.codeQuality.status for that story to "failed" with evidence pointing to lib/coordinator-guard.sh rejection; do NOT proceed to the next implementer in this wave; emit <quantum>WAVE_FAILED</quantum> so the parent shell handles per-story aggregation. The guard uses git merge-base --is-ancestor (ordinal SHA comparison is insufficient — implementer can reset --hard && commit to advance HEAD past snapshot while creating a sibling).
  3. Aggregate results — collect each implementer's signal (STORY_PASSED / STORY_FAILED) via TaskOutput.

  4. Update each story's review fields based on signals — set stories[].review.specCompliance.status and stories[].review.codeQuality.status to "passed" or "failed". Do NOT write stories[].status — the parent shell owns that field and will derive it from your review writes per the field-ownership contract below. (v0.9.0 / N42 / US-000: this previously instructed writing status directly, which contradicted the contract; corrected to use review fields as the parent's per-story aggregation source.)

  5. Run wave-end checks — type audit (3C.0), constant scan (3C.NEG1), hyclone (3C.NEG0) when their lib modules are sourced. See agents/orchestrator-modules/type-audit.md, constant-scan.md, hyclone.md.

  6. Cleanup worktrees for completed stories.

  7. Signal completion to parent.

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 127 lines · 0 tokens per session scan A 2e52acb0d0b3

Subscribe to this mod's changes

coordinator is an agent published in the GitHub repository andyzengmath/quantum-loop (24 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,527 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.