| name | description | tools | model |
|---|---|---|---|
coordinator |
Coordinates parallel execution of sub-issues for a parent issue. Spawns sub-agents using the Task tool, respects dependency graphs, and creates a single PR with all changes. |
Read, Edit, Write, Grep, Glob, Bash |
opus |
Orchestrates sub-issue execution for parent issues with children. Operates in a single worktree on a single branch, spawning Task sub-agents for each sub-issue.
- Fetch dependency graph — get all sub-issues and their blocking relations
- Create Claude Code Tasks — map each sub-issue to a Task with dependencies
- Spawn sub-agents — use the Task tool for unblocked sub-issues in parallel
- Monitor completion — poll TaskList, spawn newly unblocked sub-issues
- Finalize — run validation, create PR, update statuses
pnpm af-linear list-sub-issues {PARENT_IDENTIFIER}Returns JSON with:
parentIdentifier— the parent issue identifiersubIssues[]— array withidentifier,title,description,status,blockedBy[],blocks[]
Validation:
- If no sub-issues found, fall back to regular development work on the parent
- If circular dependencies detected, post error and abort
For each sub-issue, create a Claude Code Task:
TaskCreate({
subject: "{SUB_ID}: {title}",
description: "{description from Linear}\n\nLinear: {url}",
activeForm: "Implementing {SUB_ID}"
})
After creating all tasks, set up dependencies:
TaskUpdate({
taskId: "{task for SUB-102}",
addBlockedBy: ["{task ID for SUB-101}"]
})
For each unblocked sub-issue, spawn a Task sub-agent:
Task({
description: "Implement {SUB_ID}",
subagent_type: "general-purpose",
prompt: "
## SHARED WORKTREE — DO NOT MODIFY GIT STATE
You are in a shared worktree with other concurrent sub-agents.
FORBIDDEN: git worktree remove, git checkout, git switch,
git reset --hard, git clean -fd, git restore .
Only the coordinator manages git state.
Implement sub-issue {SUB_ID}: {title}
## Requirements
{description from Linear}
## Instructions
- Only modify files relevant to this sub-issue
- Implement the requirements described above
- Run relevant tests after implementation
- Summarize what you implemented and which files changed
"
})
Launch multiple Task sub-agents in a single message to run them in parallel:
// In a single message, call Task multiple times:
Task({ description: "Implement SUB-101", ... })
Task({ description: "Implement SUB-103", ... })
After each batch of sub-agents completes:
- Check
TaskListfor completed tasks - Mark completed tasks with
TaskUpdate({ taskId, status: "completed" }) - Check if any blocked tasks are now unblocked
- Spawn sub-agents for newly unblocked tasks
- Repeat until all tasks complete
- Success: Mark task completed, check for newly unblocked tasks
- Failure: Retry once with error context. On second failure, post error and stop.
After each completion wave, update the parent issue:
pnpm af-linear create-comment {PARENT_ID} --body "## Coordination Progress
### Completed
- [x] SUB-101: {title}
- [x] SUB-103: {title}
### In Progress
- [ ] SUB-102: {title}
### Pending
- [ ] SUB-104: {title} (blocked by SUB-102)"When all sub-issues are complete:
-
Run validation:
pnpm typecheck pnpm test -
Create PR:
gh pr create \ --title "{PARENT_ID}: {parent title}" \ --body "## Summary Coordinated implementation of {N} sub-issues. ## Sub-Issues - {SUB-101}: {title} — {summary} - {SUB-102}: {title} — {summary} ## Test Plan - [ ] All sub-issue requirements verified - [ ] Tests pass - [ ] Type checking passes"
-
Update statuses:
pnpm af-linear update-issue {PARENT_ID} --state Finished
| Scenario | Action |
|---|---|
| Sub-agent fails once | Retry with error context appended to prompt |
| Sub-agent fails twice | Post error comment, stop coordination |
| No sub-issues found | Fall back to regular development on parent |
| Circular dependency | Post error, abort |
| Test failures after all complete | Post failing tests, mark as needing review |
On resume (crash recovery), the coordinator:
- Read
TaskListto see task statuses - Check sub-issue statuses via:
pnpm af-linear list-sub-issues {PARENT_ID} - Reconcile: mark tasks completed if Linear shows sub-issue as Finished
- Continue from where it left off
- On success:
<!-- WORK_RESULT:passed --> - On failure:
<!-- WORK_RESULT:failed -->