skills/orchestrating-subagents/SKILL.md
Use when dispatching parallel or serial subagents in OpenCode, coordinating multi-unit plan execution, synthesizing results from independent subagent runs, or handling subagent failure and retry. Triggers on requests to run tasks in parallel, divide work across subagents, orchestrate a pipeline of dependent steps, or coordinate multiple agents without shared-file conflicts.
npx skillsauth add marcusrbrown/systematic orchestrating-subagentsInstall 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.
Dispatch, coordinate, and synthesize results from OpenCode subagents using the task() primitive.
Every subagent dispatch goes through task():
task({
subagent_type: "systematic-implementer",
description: "Implement auth module",
prompt: "...",
})
Required parameters:
subagent_type — the registered agent name (e.g., systematic-implementer, best-practices-researcher)description — 3–5 word label shown in the UIprompt — full instructions for the subagentOptional:
task_id — resume a prior subagent session instead of creating a new onecommand — the slash command that triggered this taskForeground dispatch (no background parameter) blocks until the subagent returns its result. This is the default and works on all OpenCode versions.
Background dispatch is gated by a runtime flag. It is not available by default.
// Only use when the runtime exposes background support
task({
subagent_type: "systematic-implementer",
description: "Implement auth module",
prompt: "...",
background: true, // experimental — see below
})
When background is available: OpenCode exposes task_status in the tool list and the task() tool description includes background mode instructions. This requires OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true or the umbrella OPENCODE_EXPERIMENTAL=true flag.
When background is unavailable: task_status is not registered. Passing background: true returns an error. Fall back to foreground dispatch — dispatch subagents serially or in small foreground batches instead.
Check before assuming: If you see task_status in your available tools, background dispatch is enabled. If you do not see it, use foreground dispatch only.
Dispatch one subagent, wait for its result, then dispatch the next. Use when:
const researchResult = task({
subagent_type: "best-practices-researcher",
description: "Research caching patterns",
prompt: "Research Redis caching best practices for Rails APIs...",
})
// Use research output to guide implementation
task({
subagent_type: "systematic-implementer",
description: "Implement caching",
prompt: `Implement caching based on this research:\n\n${researchResult}`,
})
Dispatch multiple foreground subagents in the same turn. OpenCode runs them concurrently when dispatched together. Use when:
// Dispatch independent review subagents together
task({ subagent_type: "security-sentinel", description: "Security review", prompt: "..." })
task({ subagent_type: "performance-oracle", description: "Performance review", prompt: "..." })
task({ subagent_type: "correctness-reviewer", description: "Correctness review", prompt: "..." })
// All three run; orchestrator synthesizes results after all complete
Before dispatching units in parallel, verify:
git add), create commits, or run the full test suite. If the current workflow owns git operations, the orchestrator handles staging and committing after all parallel units complete; otherwise, synthesize results and file lists and leave staging/committing to the caller or user.If any check fails, downgrade to serial dispatch. Log the reason (e.g., "Units 2 and 4 share config/routes.rb — using serial dispatch").
When dispatching units in parallel, include these instructions in each subagent's prompt:
Do not stage files (
git add), create commits, or run the project test suite. Leave staging and committing to the orchestrator or caller.
After subagents complete, the orchestrator synthesizes results:
task() call with a corrected prompt, or resume the prior session with task_id.task_status to poll or wait for terminal state before retrying.| Scenario | Approach |
|---|---|
| Units have dependencies | Serial foreground dispatch |
| Units share files | Serial foreground dispatch |
| Units are independent, no file overlap | Parallel foreground dispatch |
| Background available + long-running work | Parallel background dispatch with task_status |
| Background unavailable | Foreground only — serial or batched |
| Subagent fails | Diagnose, fix prompt, retry with new task() or resume with task_id |
| File collision detected post-parallel | Stage non-colliding files (if workflow owns git ops), re-run colliding units serially |
| Mistake | Fix |
|---|---|
| Assuming task_status is always available | Check tool list first; fall back to foreground if absent |
| Parallel subagents staging or committing | Instruct subagents not to stage/commit; the current workflow owner handles git ops when applicable, otherwise synthesize file inventory and results for the caller or user |
| Dispatching dependent units without waiting | Always wait for prerequisites to complete and verify their output |
| Ignoring file overlap in parallel batches | Run the Parallel Safety Check before every parallel dispatch |
| Using background: true without checking the flag | Only use when task_status appears in available tools |
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
testing
Use when creating, editing, auditing, or fixing bundled Systematic skills, especially when authoring SKILL.md files, adding skill reference files, resolving content-integrity frontmatter failures, or deciding which Systematic conventions apply beyond the general writing-skills guidance.
development
Generate or regenerate ONBOARDING.md to help new contributors understand a codebase. Use when the user asks to 'create onboarding docs', 'generate ONBOARDING.md', 'document this project for new developers', 'write onboarding documentation', 'vonboard', 'vonboarding', 'prepare this repo for a new contributor', 'refresh the onboarding doc', or 'update ONBOARDING.md'. Also use when someone needs to onboard a new team member and wants a written artifact, or when a codebase lacks onboarding documentation and the user wants to generate one.
tools
Optimize Claude Code permissions by finding safe Bash commands from session history and auto-applying them to settings.json. Can run from any coding agent but targets Claude Code specifically. Use when experiencing permission fatigue, too many permission prompts, wanting to optimize permissions, or needing to set up allowlists. Triggers on "optimize permissions", "reduce permission prompts", "allowlist commands", "too many permission prompts", "permission fatigue", "permission setup", or complaints about clicking approve too often.