Agent roles define responsibility. Execution plans decide threads.
inline: execute in the main thread.subagent-readonly: isolate exploration, analysis, QA, security, architecture review, or final review with no writes.subagent-shared: use a SubAgent in the shared workspace only for serialized, non-overlapping writes.subagent-worktree: use an isolated worktree for independent parallel implementation with stable contracts.Default to inline. Use a SubAgent only when the task is independently describable, inputs are stable, output is structured, scope is bounded, file overlap is low, and isolation or parallelism outweighs coordination cost.
inline execution when SubAgents or worktrees are unavailable.Every delegated task carries an immutable objective, acceptance criteria, source of truth, inputs, read scope, write scope, required project Skills, prohibited actions, verification, escalation conditions, and required return format.
Use one return contract everywhere:
status
summary
findings_or_changes
artifacts
files_inspected
files_changed
assumptions
risks
verification
unresolved_items
recommended_next_action
A SubAgent returns partial evidence when possible. The main orchestrator decides whether to retry, reject, serialize, or integrate it.