| name | sakura-delegate |
| description | Delegate bounded development research, discussion, testing, or independent review to temporary subagents while the current conversation agent keeps ownership, receives structured reports, and cleans temporary contexts and resources. Use when independent work materially improves confidence or throughput; do not use for trivial tasks or overlapping parallel edits. |
Sakura Delegate
Role
Create an isolated validation or support round without moving ownership away from the current conversation agent. Give each temporary subagent a narrow context package, collect only structured conclusions, resolve conflicts, and close temporary resources after the result is integrated.
Use When
- The user explicitly requests subagents, independent discussion, or parallel validation.
- A complex or high-risk change benefits from an independent specification, security, test, or maintainability review.
- Read-heavy exploration, test execution, triage, or log analysis can proceed independently.
- A planned implementation task has a disjoint write scope and an isolated worktree is available.
Do Not Use When
- The task is a trivial edit, one direct command, or a tightly coupled change that the parent can complete more efficiently.
- Two writers would touch the same file, interface, generated output, migration, or shared mutable environment.
- The runtime cannot isolate a required write task safely.
- Delegation would only repeat work already completed by the parent.
Inputs
- One bounded question or task, its acceptance conditions, and explicit exclusions.
- The minimum project files, facts, revision, and evidence needed by the assigned role.
- A selected mode:
read_only or isolated_write.
- The expected report count and cleanup plan.
Outputs
- One structured report per temporary subagent.
- A parent-owned consolidated decision with conflicts resolved.
- Delegation state containing the round, reports, verdicts, and cleanup evidence.
- Closed child threads and cleaned temporary worktrees, branches, or projects when applicable.
Workflow
- Keep the immediate critical-path task with the current conversation agent and delegate only bounded independent work.
- Select distinct roles, assign stable agent references, and define an expected report count before spawning subagents.
- Use
read_only by default. Use isolated_write only with a dedicated branch or worktree and a disjoint write set.
- Start the delegation round in task state, then give each subagent only the context package needed for its assignment.
- Continue non-overlapping parent work while subagents run. Wait only when their results become necessary for the next decision.
- Require each subagent to bind its report to the planned agent reference and any temporary resource references, without raw logs, full discussion history, private reasoning, or repeated project context.
- Inspect the reported evidence, reconcile conflicting findings, and record every report in task state from the parent only.
- Apply accepted findings through the active stage skill. A delegated
FIX_REQUIRED or BLOCKED verdict cannot be treated as a passing result.
- Close completed child threads. Before deleting temporary worktrees, branches, test projects, or raw report artifacts, verify that no unique unintegrated change or user work would be lost. Retain the accepted code, concise project log entry, and final report.
- Record every planned agent as closed or archived and every reported temporary resource as removed. Finish the delegation round only after every expected report passes with zero blocking issues and structured cleanup evidence is complete.
- A failed or blocked round must pass cleanup before a replacement round can start.
Read delegation-policy.md before choosing roles or parallelism. Read context-package.md when constructing a subagent assignment. Read report-contract.md before accepting or recording a result.
Quality Gate
- Delegation has a specific reason and produces non-duplicative evidence.
- The parent remains responsible for requirements, permissions, integration, and final delivery.
- Parallel writers have isolated workspaces and disjoint write scopes.
- Every expected report follows the contract and is checked against actual evidence.
- No unresolved blocking verdict, unclosed planned agent, unremoved reported resource, or pending cleanup remains.
- The parent context contains conclusions and decisions, not raw intermediate output.
Failure and Fallback
- If a read-only subagent is unavailable, complete the bounded check in the parent and record that delegation was not used.
- If isolated write access is unavailable, keep implementation in the parent rather than sharing one working tree.
- If reports conflict, inspect the underlying evidence and make a parent-owned decision; do not average incompatible conclusions.
- If a subagent returns insufficient evidence, request one scoped correction or replace that report without duplicating the whole round.
- Block the delegation round when required independent evidence cannot be obtained or temporary resources cannot be closed safely.
Upstream and Downstream
- Upstream:
sakura-dev or any active stage that identifies a justified independent subtask.
- Downstream: the same active stage,
sakura-fix for accepted blockers, or sakura-review for final completion.
Handoff
Return the delegation reason, roles, modes, report verdicts, accepted findings, rejected findings, remaining risks, cleanup result, and next active-stage action. Do not include child-thread transcripts or raw logs.