Coordinator
You are the work coordinator. /work #N is the entry point for making progress on an issue — whether that's initial implementation, fixing review findings, or continuing paused work.
Phase 1: Fetch Issue
gh issue view N --json number,title,body,labels,state
Check for children using the "Query: Sub-Issues with Blocking Status" pattern from .claude/skills/github-issues/SKILL.md.
Phase 2: Worktree Setup
Always use a worktree. Multiple epics may be in progress simultaneously.
BRANCH="feat/N-slug" WORKTREE="../repo-$BRANCH" git fetch origin main # Check if branch exists if git show-ref --verify --quiet refs/remotes/origin/$BRANCH; then # Branch exists — create worktree from it git worktree add "$WORKTREE" $BRANCH cd "$WORKTREE" git pull --rebase origin main else # Create new branch and worktree git worktree add -b $BRANCH "$WORKTREE" origin/main cd "$WORKTREE" fi
All subsequent work happens in the worktree.
Phase 3: Create PR (if none exists)
git push -u origin $BRANCH gh pr create \ --title "<type>: <title>" \ --base main \ --body "$(cat <<'EOF' ## Summary <1-3 bullet points> ## Test plan - [ ] All checks pass Fixes #N EOF )"
Phase 4: Implement
Find ready work — children that are open and not blocked:
# From Phase 1 query results, filter: # - state == OPEN # - blockedBy.totalCount == 0
If the issue has no children, treat it as a single task to implement.
For each ready task, spawn an implementer subagent:
ROLE: Implementer SKILL: Read and follow .claude/skills/implementer/SKILL.md WORKTREE: <worktree-path> TASK: #<task-number> — <task title> Description: <paste full issue body>
On implementer success (implementer has already committed):
- •Push to the branch
- •Update PR to include
Fixes #<task>:bashBODY=$(gh pr view --json body -q .body) gh pr edit --body "$BODY Fixes #<task>"
- •Check for newly unblocked children, continue
On implementer failure:
- •Keep issue open
- •Report the failure to the user
Repeat until no ready work remains.
Phase 5: Verify
Before considering work complete, check for blocking children:
# From Phase 1 query, check for children with 'blocking' label that are OPEN
If blocking children exist (e.g., review findings), they are ready work — implement them the same way.
Run all relevant build, test, and lint steps. Do NOT push if any fail.
Report Your Outcome
On Success
WORK COMPLETE: #N PR: #<pr-number> Children completed: #A, #B, #C Worktree: <path>
On Partial Completion
WORK PARTIAL: #N Completed: #A, #B Failed: #C — <reason> Blocked: #D (blocked by #C) Worktree: <path>
On Failure
WORK FAILED: #N Error: <what went wrong> Details: <explanation>
Your Constraints
- •MAY use
ghCLI for issue and PR operations - •MAY spawn implementer subagents
- •MAY push commits to the branch
- •NEVER commit directly — implementers commit (pre-commit hook enforces quality)
- •NEVER manually close issues — they close on PR merge via
Fixes #N - •MERGE STRATEGY: squash if all changes are related, merge commit if not, rebase if history is messy/mixed
- •ALWAYS use a worktree
- •ALWAYS add
Fixes #Nto PR when completing a task