skills/subspawn/SKILL.md
Bounded subagent delegation and synthesis. Use for explicit subagent, delegation, fan-out, spawn policy, custom agent routing, wait behavior, and evidence-first synthesis.
npx skillsauth add bjornmelin/dev-skills subspawnInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Keep subagents bounded. The main agent owns planning, waits for delegated results, synthesizes evidence, and makes final decisions unless the user says otherwise.
Use this skill when:
Only spawn when the user explicitly asks for subagents or parallel agent work. Do not use this skill to rationalize extra delegation. Keep work local when delegation would add coordination cost without improving quality.
Explicit user instructions override the default delegation heuristics.
If user specifies any below, honor unless unsafe or impossible:
When override differs from default:
Before spawning:
For nontrivial batches, generate a plan before spawning:
python3 skills/subspawn/scripts/subspawn_plan.py plan \
--preset research \
--task "Research current Codex subagent docs" \
--scope "official OpenAI docs and GitHub only"
Use --role for explicit custom role selection, --mode edit only with
disjoint write surfaces, and --json when another tool needs to consume the
plan. Run validate-roles after changing subagent templates.
Packaged standalone subspawn installs include local preset template copies in
templates/agents/; full repo checkouts prefer the sibling deep-researcher and
subagent-creator templates first.
repo_explorer role when installed; keep Codex built-in explorer as a
fallback and avoid custom names that accidentally shadow built-ins.explorer, worker, or default.After spawning a planned batch, immediately wait for every spawned subagent in that batch before doing substantive next work.
While subagents are running, allowed actions are limited to:
wait_agent or equivalent wait/status operationssend_input only to unblock or correct a running subagentresume_agent or close_agent for lifecycle recoveryDo not inspect files, run tests, browse, edit, continue local analysis, start new unrelated tool calls, or produce the final answer until the spawned batch has completed and its results have been synthesized. The only exception is an explicit user instruction to run asynchronous delegation without waiting.
When the runtime exposes explicit close operations, close completed subagent threads after synthesis so long-lived sessions do not accumulate stale agent or MCP resources.
Follow the active Codex tool schema and the custom agent files available in the session.
model and reasoning_effort when inheriting the parent model
or when a custom agent file already pins them.gpt-5.6-terra at medium for mechanical inventory and at high for
bounded retrieval and source gathering.gpt-5.6-sol at medium for default judgment and implementation; use
Sol high for planning, architecture, security, root-cause work, and lead
synthesis.max only for independent adversarial validation.xhigh, max, or ultra for routine delegated work. Sol
max is a root-only emergency escalation after tighter scope and Sol high
still underfit.Only set model or reasoning_effort directly when the user asks or the
current tool schema supports that override and it is necessary. Include a
one-line reason in the spawn prompt when overriding.
Use medium as the default for most agents.
high when an agent must trace complex logic, check assumptions, handle
edge cases, investigate security-sensitive code, or resolve conflicting
evidence.high for bounded read-heavy source gathering.max only for an independent adversarial lane, never the primary
planner or implementer.Before increasing effort, tighten:
Use the current spawn_agent schema exactly.
Runtime compatibility matrix:
| Surface | Typical fields | Safe custom-role posture |
| --- | --- | --- |
| legacy tool | agent_type, model, reasoning_effort, fork_context | Keep prompt self-contained. Avoid combining full fork_context with role/model overrides if rejected. |
| multi-agent v2 | agent_type, model, reasoning_effort, task_name, fork_turns | Set stable task_name; use fork_turns: "none" for custom role/model/effort overrides unless inherited history is required. |
| custom agent file | standalone TOML role under ~/.codex/agents or .codex/agents | Prefer omitting per-call model/effort when the role file pins them. |
If the schema exposes fork_turns and task_name:
task_name.agent_type, or direct model/reasoning overrides,
set fork_turns: "none" unless the user explicitly requests inherited
history. Current Codex multi-agent v2 rejects full-history forks with role,
model, or reasoning overrides.fork_turns: "all" only when the child must inherit full parent context
and no role/model/reasoning override is required.If the schema exposes legacy fork_context:
Escalate only specific subagents that underfit.
Escalation order:
Every spawned subagent prompt must explicitly specify:
Spawn prompt shape:
Task: one bounded task or question
Scope: paths, modules, docs, APIs, or explicit ownership
Mode: read-only, or may edit named files only
Wait: parent will wait for all spawned agents before substantive next work
Role: selected custom or built-in agent role
Model: inherited, custom-agent pinned, or explicit override with reason
Reasoning: inherited, custom-agent pinned, or explicit override with reason
Return format:
- Status
- Evidence or role-specific source headings
- Files inspected/changed, queries run, or sources hydrated
- Commands run or provider calls
- Findings or claims with confidence and source IDs
- Risks/blockers
When a custom role template provides a narrower return contract, use the template-specific headings emitted by the planner.
For edit-capable workers, also say:
Require concise, evidence-first output:
No vague summaries without evidence.
Prefer:
For proposed changes, require one of:
Subagent proposes edits without tests: require exact checks to run next.
Use long bounded waits for the full batch rather than short polling loops. If a wait times out:
Do not forget open subagents. Final output must account for every spawned subagent as completed, timed out, closed, or failed.
Before any substantive next work or final answer:
When findings conflict, produce a conflict ledger with:
Validating this skill requires at least one probe forcing real delegation, not only a refusal path.
Good probe:
Planning-only smoke:
python3 skills/subspawn/scripts/subspawn_plan.py validate-roles
python3 skills/subspawn/scripts/subspawn_plan.py plan \
--preset review \
--task "Review this PR for correctness and test gaps" \
--scope "current PR diff only"
Common failure modes + fixes:
development
Pre-PR multi-model review, parallel opus and codex exec adversarial lanes, then adversarial verification of merged findings. Read-only. Use before shipping nontrivial diffs.
tools
Independent gpt-5.6 diff review via the Codex CLI, normal or steerable adversarial with JSON findings. Use before shipping nontrivial changes.
development
Delegate implementation, investigation, or bulk work to gpt-5.6 codex via pinned codex exec. Use for clear-spec builds, migrations, debugging, or any task MODELS.md routes to codex.
development
Adversarial pre-mortem: imagine the plan failed, work backwards to surface risky assumptions + irreversible bets, then harden them. Proactively offer it (after the current request; confirm first) before a hard-to-reverse or one-way-door call (API, schema, framework, a hire), an all-upside plan, or unvalidated assumptions. Also on request.