Workflow for parent agents completing child tasks including pulling changes, merging branches, deleting worker branches, and marking tasks complete
This skill provides the workflow for parent agents to properly complete and integrate work from child/worker tasks.
Load this skill when:
a2a_spawn_subtask or a2a_spawn_parallel_subtasks[SUBTASK UPDATE] Task "task-name" completed successfullya2a_reportCompletionApplies to:
Child task completion is a MULTI-STEP process that YOU (the parent) control!
When a child worker calls a2a_reportCompletion, this does NOT:
You must: Review, integrate, and explicitly complete the task following the steps below.
What happens:
a2a_reportCompletion (NOT orchestrator_completeTask)[SUBTASK UPDATE] Task "implement-core" completed successfullyWhat this means:
Actions:
Red flags:
Use a2a_pull_subtask_changes to fetch the child's changes into your worktree:
{
"subtaskWorktree": "/path/to/child/worktree"
}
Note: This pulls their branch into your worktree but doesn't merge it yet. You can review the changes before merging.
Before merging, you MUST review the code:
@reviewer subtask to review the changes for you.Decision Point:
A. If work is SUBSTANDARD:
// a2a_send_message_to_worker
{
"workerId": "worker-id",
"message": "I reviewed your changes. The error handling in `api.ts` is missing. Please add try/catch blocks and retry."
}
B. If work is GOOD:
Decision point: Do dependent tasks need this code?
| Scenario | Merge? | Reason |
|---|---|---|
| Dependent task modifies same files | YES | Prevent conflicts |
| Dependent task imports/uses this code | YES | They need the code |
| Tasks independent, different modules | Optional | No code dependencies |
| Parallel tasks, no overlap | Not required | No integration needed |
If merging:
# Switch to main branch
git checkout main
# Merge the worker's branch
git merge <worker-branch-name>
# If conflicts occur:
git status
git checkout --theirs <file> # Accept worker's version (common pattern)
# OR manually resolve conflicts
git add .
git commit -m "Integrate task: implement-core"
Why merge before completing:
mainCRITICAL STEP - Always delete after integrating:
# Delete the child's branch after merging
git branch -d <child-branch-name>
# If branch wasn't merged and you want to force delete:
git branch -D <child-branch-name>
Why this is mandatory:
orchestrator_completeTask will FAIL if branch still existsā ļø This step only applies if you are an orchestrator managing a plan!
If you're a regular parent agent (not managing an orchestrator plan), skip to step 8.
For orchestrators only - after reviewing, merging, and deleting branch:
{
"taskId": "implement-core"
}
Tool: orchestrator_completeTask
What this does:
Important: This tool verifies the branch was deleted. If you get an error about the branch still existing, go back to step 6.
For orchestrators:
For regular parent agents:
ā DON'T:
orchestrator_completeTask before pulling and reviewing changesā DO:
orchestrator_completeTaskOrchestrator Flow:
Child calls a2a_reportCompletion
ā
You receive notification
ā
Review output
ā
Pull changes (a2a_pull_subtask_changes)
ā
Merge to main (if needed)
ā
Delete branch (git branch -d)
ā
Mark complete (orchestrator_completeTask) ā Orchestrator only
ā
Dependent tasks auto-deploy
Regular Parent Agent Flow:
Child calls a2a_reportCompletion
ā
You receive notification
ā
Review output
ā
Pull changes (a2a_pull_subtask_changes)
ā
Merge to your branch (if needed)
ā
Delete child's branch (git branch -d)
ā
Continue your work with integrated changes
If orchestrator_completeTask fails:
Error: "Worker branch still exists"
git branch --list <branch-name>git branch -d <branch-name>orchestrator_completeTask againIf merge conflicts occur:
git status to see conflicted filesgit checkout --theirs <file> (accept worker's version)git add . and git commit to complete mergeIf child reported partial completion:
a2a_send_message_to_worker with guidanceorchestrator_retryTask