herdr-issue-coordinator
Coordinates a batch of GitHub issues through separate Claude Code sessions running in visible Herdr tabs, with tested pull requests, review loops, and gated merges. Use when the user asks one Claude session to sequence several coding sessions, or to complete a parent issue, milestone, or issue batch inside Herdr.
owainlewis · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add owainlewis/agent-skills --skill herdr-issue-coordinatorAbout this skill
name: herdr-issue-coordinator description: "Coordinates a batch of GitHub issues through separate Claude Code sessions running in visible Herdr tabs, with tested pull requests, review loops, and gated merges. Use when the user asks one Claude session to sequence several coding sessions, or to complete a parent issue, milestone, or issue batch inside Herdr." user-invocable: true argument-hint: "<parent issue, milestone, or issue list>"
Herdr issue coordination
Use this session as the coordinator. Give each dispatched GitHub issue its own git worktree, branch, Herdr tab, and Claude Code session. Sequence the work. Keep implementation context in workers and all durable state in GitHub.
This skill is experimental. It depends on the herdr CLI and its API changes
between versions. Verify the commands below against the installed binary before
relying on them.
Explicitly naming /herdr-issue-coordinator, or explicitly telling the
coordinator that agents may merge, authorizes in-scope workers to merge their
own pull requests after every merge gate below passes. An implicit skill match
does not grant merge authority: run in no-merge mode unless the user's words
grant it. Neither mode authorizes deployment, release publication, destructive
operations, branch-protection bypasses, or changes outside the supplied batch.
Preconditions
Stop if any of these fail. Do not substitute hidden subagents for workers.
test "${HERDR_ENV:-}" = 1. You must be running inside a Herdr pane.herdr --versionreports 0.8.0 or later. Earlier versions have noagent promptand noagent start --pane, and this skill will not work.herdr agentlistsprompt, andagent startaccepts--kindand--pane. The binary is the authority, not this document.- The working directory is a git repository with a GitHub remote and
ghauthenticated. - Read the repository instructions, parent issue, sub-issues, declared dependencies, project board, issue state, and linked open or merged pull requests. A merged pull request is only evidence of completion when it closes or explicitly references the issue and its final change and proof satisfy the issue scope. Reconcile that state instead of dispatching again.
- Make every issue a complete task before dispatch. If a missing product or technical decision could change behavior, data, security, compatibility, operations, cost, or proof, mark that issue as needing human input.
- Build a dependency graph. Stop for human correction on a dependency cycle.
State rules
The coordinator is the only writer of batch state. These rules exist because a sequenced batch runs for hours and this session's context is not durable.
- GitHub holds issue, pull request, review, and merge state. Re-read it at the start of every cycle. Never cache it across cycles.
- Never create a second tracker: no local state file, no notes file, no in-context list treated as authoritative.
- Workers never write batch state. They own one issue and report back.
- Workers never write their own tab status. The coordinator pushes it.
- If your own context is compacted mid-batch, re-derive the whole graph from GitHub before dispatching anything.
Concurrency and tabs
- Default to 1 active worker. Use 2 only when two issues are independent and the user asked for speed. Use another limit only when the user asks.
- One tab per active issue. Close it after its merge is verified.
- Never leave finished tabs open. A long batch must not accumulate tabs.
- Keep the user's focus in the coordinator tab.
Coordinator workflow
-
Name this tab for the batch.
herdr tab rename "$HERDR_TAB_ID" "Coordinator"tab renamehas no--clear. Record the original label and restore it verbatim when the batch ends. -
Dispatch only issues whose prerequisites are merged. For each one, create the worktree first, then the tab, then the agent.
# 1. worktree, from the updated remote default branch git worktree add -b <branch> <worktree-path> origin/<default-branch> # 2. tab, in this workspace, rooted in the worktree herdr tab create --workspace "$HERDR_WORKSPACE_ID" \ --cwd <worktree-path> --label "#<issue> <short title>" --no-focus # read .result.tab.tab_id and .result.root_pane.pane_id from the response # 3. agent, in that tab's root pane herdr agent start issue-<issue> --kind claude --pane <root-pane-id> # 4. reclaim focus; agent start has no --no-focus and takes it herdr tab focus "$HERDR_TAB_ID"Agent names must match
[a-z][a-z0-9_-]{0,31}and be unique among live agents, so#123is not a legal name. Useissue-123as the agent name and#123 <short title>as the tab label. Parse every id from the JSON response. Do not predict ids.If the issue already has an open pull request, use that pull request's exact head branch instead of creating a new one, and pass the branch and pull request URL in the worker prompt.
-
agent startreturns only once Herdr sees the agent ready. It reportsagent_statusandinteractive_ready. Do not add a separate wait. -
Send the worker its task and wait for it to settle.
herdr agent prompt issue-<issue> "<worker prompt>" --wait --timeout <ms>agent promptsubmits text and Enter atomically.--waitreturns on the first settledidle,done, orblockedstate. Do not useagent sendfollowed by a separate Enter. -
Read a worker only when it needs help or reports completion.
herdr agent get issue-<issue> herdr agent read issue-<issue> --source recent-unwrapped --lines 200agent readreturns plain text, not JSON. If a completed response is longer than the pane can return, ask the worker to write its full response to a temporary file and reply with only the path, then read that file. -
On
blocked, inspect before answering. Send a deci