Orchestrate Parallel Code Generation Agents
Quota-aware six-phase protocol for coordinating parallel Antigravity 2.0 subagents: decompose, route, scope, execute, recover, integrate.
Why it matters
Decompose complex coding tasks into parallel, quota-aware subagent missions for efficient development and reduced cost.
Outcomes
What it gets done
Break down large tasks into manageable, isolated agent missions.
Coordinate multiple agents (code, browser, terminal) to work concurrently.
Implement quota-aware routing and context isolation for cost efficiency.
Manage parallel execution, error recovery, and final integration checks.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-subagent-orchestrator | bash Overview
Subagent Orchestrator
A six-phase quota-aware protocol for coordinating parallel subagents in Antigravity 2.0, from Mission Brief approval through model routing, context scoping, and integration checks. Use for multi-file, multi-agent tasks with real quota risk; skip it for single-file edits, short scripts, or plan-only requests.
What it does
A quota-aware, six-phase protocol for coordinating parallel subagents in Antigravity 2.0: decompose a task into isolated agent missions, route each to a cost-appropriate model, scope each agent's context, execute in dependency-ordered rounds, recover from failures without cascading broken output, and run a final integration sweep. Phase 1 requires producing and getting user approval on a Mission Brief - goal, agent count, quota strategy, and per-agent role, scope, model, inputs, outputs, and dependencies - before any agent spawns. Phase 2 applies a quota-routing decision tree: tasks over 20 files or 500 new lines default entirely to Gemini Flash with Sonnet reserved for final review, while creative UI or complex-logic tasks get one Sonnet builder agent with Flash for the rest, under hard cost rules that forbid Claude Opus in any subagent, cap Claude Sonnet at one subagent per mission, and limit the browser subagent to one per mission on its own quota pool. Phase 3 scopes each agent to a context packet naming exactly which files to read and write, explicitly excluding irrelevant files, and adding build artifacts like node_modules or .next/ to .antigravityignore. Phase 4 spawns agents in dependency-ordered rounds and runs a three-point spot check between rounds - scope adherence, import/export conflicts, and placeholder "TODO" output - before proceeding. Phase 5 defines a recovery protocol that spawns a single cheap repair agent scoped only to the broken file and the error message rather than re-running the whole mission. Phase 6 runs a six-item integration checklist covering import resolution, duplicate names, hardcoded values, leftover console.log, consistent TypeScript types, and whether the build would succeed. It also tracks estimated quota usage by event type and pauses to ask the user whether to continue once usage crosses 60% of the sprint quota, and mandates continuous status communication with a compact per-round progress bar.
When to use - and when NOT to
Use it when a task spans three or more files or components, multiple agents should work simultaneously, quota issues have hit mid-task before, the task involves both planning and building, or a browser agent, code agent, and terminal agent need to run together. Do not use it for editing a single file or fixing one bug, writing a quick script under 50 lines, or when the request is just a question or a plan with no execution - a single focused edit or direct answer is faster and clearer there.
Inputs and outputs
Input is a multi-file or multi-component task description. Output is a user-approved Mission Brief, per-agent context packets, round-by-round execution with spot checks, and a final integration report, following the documented Mission Brief format:
MISSION BRIEF
Goal: [one sentence, what done looks like]
Total Agents: [N]
Quota Strategy: [FLASH / SONNET / MIXED]
Expected Token Cost: [LOW / MEDIUM / HIGH]
Integrations
Built specifically for Antigravity 2.0's subagent model, routing between Gemini Flash and Claude Sonnet, never Opus, plus a separately-pooled browser subagent; references three worked examples for a parallel Next.js feature build, a backend-plus-frontend split, and a minimal-quota debug and repair mission.
Who it's for
Antigravity 2.0 users running multi-agent missions who need explicit quota discipline, context isolation, and failure recovery rather than an unscoped fan-out that burns the weekly quota.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.