Takes job postings → spawns the right agent → passes context → tracks completion.
Invoked by the orchestrator after JOB_BOARD.md is written with job postings. Can also be invoked directly when the user says "spawn an agent to do X".
Read workspace/JOB_BOARD.md for pending job postings.
Each posting has:
subagents list for active count.BucketLabel PatternTimeoutKey Context to PassNotes🏗️ BUILDbuild-[project]600swebdev-sop, project files, WORK_BUCKETS.mdAlways include "npm run build must pass, git commit + push"📬 OUTREACHoutreach-[target]300soutreach-infrastructure.md, warmup state, suppression listInclude SSH commands for droplet💰 SALESsales-[client]300sbusiness-strategy.md, client project fileInclude pitch framework🔧 MAINTAINfix-[project]-[issue]300sProject memory file, error descriptionInclude "verify fix works" step🧠 STRATEGYresearch-[topic]300sbusiness-strategy.md, OUTSTANDING.mdInclude "cite sources" requirement📦 PRODUCTproduct-[item]300sproduct-catalog-registry.md, casefinder docsInclude unit economics requirement🤖 SYSTEMsystem-[tool]300sRelevant skill files, OpenClaw docsInclude "test the skill" step💼 CAREERcareer-[company]300sRyan's resume, target roleInclude "output PDF" requirement💡 IDEATIONideation-[source]600sbatch-cognition skill, value-stack.mdInclude ICE scoring requirement
For each sub-agent spawn, construct the task as:
text
You are working on: [workspace path]
## Job
[Bucket emoji] [Bucket name]: [Job title]
## What to Do
[Detailed task description from job posting]
## Context
[Relevant file contents or summaries — keep under 2K tokens]
[Reference to full files the agent can read itself]
## Acceptance Criteria
[Specific, testable conditions — copied from job posting]
- [ ] [criterion 1]
- [ ] [criterion 2]
- [ ] [criterion 3]
## Constraints
- [Bucket-specific constraints from table above]
- Do NOT modify .env files with real keys
- Build must pass before committing
- Git commit with descriptive message
When jobs in the same wave are related:
output/analysis.md → Job B needs it as inputpython
# Pseudocode for spawning logic
for wave in execution_plan.waves:
active = get_active_subagents()
for job in wave.jobs:
if job.effort == "QUICK":
execute_inline(job) # No sub-agent needed
job.status = "✅"
continue
# Wait for slot
while len(active) >= 3:
wait_for_completion_event()
active = get_active_subagents()
# Check dependencies
if job.depends_on and not all_done(job.depends_on):
job.status = "QUEUED"
continue
# Spawn
agent = sessions_spawn(
label=f"{bucket_prefix}-{job.slug}",
mode="run",
runTimeoutSeconds=job.timeout,
task=build_task_description(job)
)
job.status = "🔄"
job.agent_key = agent.childSessionKey
active.append(agent)
# Wait for wave to complete before next wave
wait_for_all_wave_completions(wave)
When a sub-agent completion event arrives:
Failure TypeActionSub-agent timeoutKill agent, mark ⚠️, retry once with simpler scopeSub-agent errorMark ❌, log error, notify orchestratorBuild failureMark ⚠️, check build output, fix inline if trivialDependency failedMark BLOCKED, skip, notify orchestrator3 consecutive failuresStop spawning, escalate to Ryan
Update workspace/JOB_BOARD.md with:
When all jobs complete, notify orchestrator for reconciliation.