Subagent delegation
Use when splitting work across agents beats running it serially: independent workstreams, context-heavy research, or a review that should test assumptions separately.
- Check it's worth it. Delegate for two or more genuinely independent workstreams, research where only the conclusion needs to return, or a review that benefits from distance — not a single linear task.
- Inspect what the host actually supports — exposed agent tools, concurrency limits, context inheritance — before assuming a field or mode exists. Use the inherited model unless the task clearly justifies an override.
- Write each task so the agent never needs to ask back: a concrete goal, exact paths, read-only or write scope, constraints, the success check, and a bounded turn/time/retry budget.
- Give every writer exclusive ownership of its files or a worktree; serialize anything shared. A worktree does not isolate credentials, databases, or external services — treat those as shared regardless.
- Name the skills and files each task needs explicitly — a child does not inherit the parent's skill selection or context by default.
- Run independent tasks in parallel or background; wait for a dependency before starting the step that needs it. If the host has no delegation support, say so and run the same scoped tasks sequentially instead of silently skipping the split.
- Review every returned diff against its own evidence, not just the subagent's summary, and run the relevant integration check before accepting it.
Check before you finish: no two writers touched the same file concurrently, nothing started before a dependency it needed had returned, and every task had enough context to run with nobody able to answer a follow-up.
Host-specific patterns (Claude Code, Cursor, Codex, OpenCode/OMP) and the delegation-plan template: reference.md.
Lane matrix, context retrieval and merge gates
- Before a large fan-out, write a lane matrix: lane, parallel/sequential/gated, write surface, risk, verification. Run lanes in parallel only when their write surfaces do not collide; if a lane finds a blocker that changes the plan, pause its dependents and update the matrix.
- Never parallelize destructive commands, migrations, writes to the same table, or customer-impacting deploys without an explicit gate. Start long builds and tests as separate sessions and poll them deliberately; nothing should outlive the turn unless the user asked for it.
- When a child cannot know what context it needs, give it a bounded retrieval loop: broad keyword/path search, score each hit for relevance and list missing context, refine terms (the codebase may use different vocabulary, e.g. "throttle" for "rate limit"), and stop after 3 cycles or once a few clearly relevant files are found. A few high-relevance files beat many mediocre ones.
- Treat each agent as a teammate with an owner, a scope (files, branch, forbidden areas), a state (ready, running, review, blocked, merged), evidence (tests, logs, screenshots) and one exact merge gate. Move a card to review only when its handoff artifact and changed files exist.
- Review order before merge: tests, diff review, risk/security check, then polish. One integrator resolves conflicts.
- Failure modes: many agents with no owner or merge gate, useful output that lives only in a chat transcript, a task board whose cards have no acceptance criteria, overlapping writes without worktrees, and reporting "fast" before correctness is proven.
- Finish with a verification table: lanes run and completed, blocked lane with owner and next action, checks run, checks skipped (never hidden behind a success summary).
Adapted in part from ECC skills/iterative-retrieval, skills/parallel-execution-optimizer and skills/team-agent-orchestration (affaan-m/ECC, MIT).
1---2name: bosskuai-subagent-delegation3description: Use when independent workstreams, context-heavy research, or a separate review benefit from subagents; select supported host tools, bounded tasks, and safe write scopes.4metadata:5 source: https://skillmd.com/skills/wankimmy/bosskuai-subagent-delegation6---78# Subagent delegation910Use when splitting work across agents beats running it serially: independent workstreams, context-heavy research, or a review that should test assumptions separately.11121. **Check it's worth it.** Delegate for two or more genuinely independent workstreams, research where only the conclusion needs to return, or a review that benefits from distance — not a single linear task.132. **Inspect what the host actually supports** — exposed agent tools, concurrency limits, context inheritance — before assuming a field or mode exists. Use the inherited model unless the task clearly justifies an override.143. **Write each task so the agent never needs to ask back**: a concrete goal, exact paths, read-only or write scope, constraints, the success check, and a bounded turn/time/retry budget.154. **Give every writer exclusive ownership** of its files or a worktree; serialize anything shared. A worktree does not isolate credentials, databases, or external services — treat those as shared regardless.165. **Name the skills and files each task needs explicitly** — a child does not inherit the parent's skill selection or context by default.176. **Run independent tasks in parallel or background; wait for a dependency before starting the step that needs it.** If the host has no delegation support, say so and run the same scoped tasks sequentially instead of silently skipping the split.187. **Review every returned diff against its own evidence**, not just the subagent's summary, and run the relevant integration check before accepting it.1920Check before you finish: no two writers touched the same file concurrently, nothing started before a dependency it needed had returned, and every task had enough context to run with nobody able to answer a follow-up.2122Host-specific patterns (Claude Code, Cursor, Codex, OpenCode/OMP) and the delegation-plan template: `reference.md`.2324## Lane matrix, context retrieval and merge gates2526- Before a large fan-out, write a lane matrix: lane, parallel/sequential/gated, write surface, risk, verification. Run lanes in parallel only when their write surfaces do not collide; if a lane finds a blocker that changes the plan, pause its dependents and update the matrix.27- Never parallelize destructive commands, migrations, writes to the same table, or customer-impacting deploys without an explicit gate. Start long builds and tests as separate sessions and poll them deliberately; nothing should outlive the turn unless the user asked for it.28- When a child cannot know what context it needs, give it a bounded retrieval loop: broad keyword/path search, score each hit for relevance and list missing context, refine terms (the codebase may use different vocabulary, e.g. "throttle" for "rate limit"), and stop after 3 cycles or once a few clearly relevant files are found. A few high-relevance files beat many mediocre ones.29- Treat each agent as a teammate with an owner, a scope (files, branch, forbidden areas), a state (ready, running, review, blocked, merged), evidence (tests, logs, screenshots) and one exact merge gate. Move a card to review only when its handoff artifact and changed files exist.30- Review order before merge: tests, diff review, risk/security check, then polish. One integrator resolves conflicts.31- Failure modes: many agents with no owner or merge gate, useful output that lives only in a chat transcript, a task board whose cards have no acceptance criteria, overlapping writes without worktrees, and reporting "fast" before correctness is proven.32- Finish with a verification table: lanes run and completed, blocked lane with owner and next action, checks run, checks skipped (never hidden behind a success summary).3334Adapted in part from ECC skills/iterative-retrieval, skills/parallel-execution-optimizer and skills/team-agent-orchestration (affaan-m/ECC, MIT).