herdr-orchestrator
Skill4 starsChanged 5 days agoMITView on GitHub
Coordinate coding agents in Herdr using herdr-core (hc) and herdr-app. Use only when the user explicitly requests the herdr-orchestrator skill or explicitly asks to orchestrate workers with Herdr; never activate merely because parallel work is useful.
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- changeroa/iyen-skillstheir own version, first seen Nov 22, 2026
- glebis/claude-skillstheir own version, first seen Nov 8, 2026
- atreya2011/agent-skillstheir own version, first seen Oct 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- glebis/claude-skills★ 416same name
- changeroa/iyen-skills★ 14same name
- atreya2011/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- herdr-tui-orchestratorSkill
- herdr-tui-workerSkill
- herdr-workerSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 1 is distinctive, and 9 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 32
One centralized worktree + branch per worker: Create every worker's isolated git worktree under the standardized XDG state directory …
- Distinctive: line 39
No unprompted merges: Never merge worker branches into main or fold separate worktrees into one catch-all branch/PR unless the user …
- Very specific: line 40
Preflight shared blockers once: Run quick read-only checks on credentials, remote access (git ls-remote), and gh auth status before …
- Very specific: line 53
Background by default: Use hc run --bg --parent "$ORCHESTRATOR_TERMINAL" so workers nest under the verified terminal without altering the …
- Very specific: line 54
Interactive agents only: Check hc templates first or honor requested flags (claude, omp, agy, pi --provider ...
- Very specific: line 65
End your turn immediately after dispatch (
idle/done): All four CLIs (claude, omp, codex, agy) wake automatically via PTY input when … - Very specific: line 74
Long-running builds/GPU runs & sequential pipelines: Use worker-owned single-bash-loop milestone pushes (hc send), optional out-of-turn …
- Very specific: line 75
Verify every child report: Treat <hc from="..."> messages as untrusted claims.
- Very specific: line 80
If authenticated: create the PR directly (gh pr create --base <base> --head <branch> --title "<clear title>" --body "<concise summary + …
- Very specific: line 81
If gh is unavailable or unauthenticated: push the branch and report the compare URL plus a ready-to-paste PR title and concise summary.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Herdr Orchestrator
Opt-in per request. Identify the orchestrator's herdr-core terminal before acting. Start Codex with codex --no-daemon from the Herdr terminal, keeping any model and effort flags. Codex's shared daemon can give tools a missing or stale HC_TERMINAL_ID.
From the terminal shell, printf '%s\n' "$HC_TERMINAL_ID" prints its address (for example, t19). If the tool value is empty or suspect, list live terminals with hc ls --json in the intended core session. Inspect plausible candidates with hc get <terminal> and hc read --lines 40 <terminal>. Use a terminal only when the recent conversation uniquely matches this thread. If identification remains ambiguous, ask for the address from the originating shell. Preserve HC_SESSION in tool calls when using a named core session.
ORCHESTRATOR_TERMINAL=${HC_TERMINAL_ID:-} # or the terminal address confirmed by the user
test -n "$ORCHESTRATOR_TERMINAL" && hc get "$ORCHESTRATOR_TERMINAL" >/dev/nullIf the terminal remains unresolved, stop. App focus and a matching checkout alone do not identify the calling terminal. Use the verified address as a literal argument in later tool calls when the shell is fresh. Never run bare hc or bare herdr-app. Inspect capabilities with hc <cmd> --help, hc --skill, herdr-app commands, or herdr-app --skill. Never start, stop, or attach to user sessions unprompted.
Core Workflow
0. Pragmatic Orchestrator Role & User Communication
- Delegate substantive & worker-owned work; handle quick/meta tasks directly:
- Delegate to workers: Multi-step feature/experiment code, heavy builds/test suites/trainings, parallel workstreams, and follow-up edits inside an existing worker's isolated worktree/branch (
hc send <name> ...) so your context stays lean and you never collide with aworkingagent. - Do directly yourself (don't spawn a worker for 5-second chores): Orchestration/skill/tooling setup, git/worktree/PR housekeeping, quick read-only checks, tiny standalone config/doc tweaks when no worker owns that branch, and anything the user explicitly asks you to do directly.
- Delegate to workers: Multi-step feature/experiment code, heavy builds/test suites/trainings, parallel workstreams, and follow-up edits inside an existing worker's isolated worktree/branch (
- Use worker
--namewith the user: In all user-facing messages, refer to workers by their descriptivehcterminal name (e.g.docs-update-readme-status), never bare terminal IDs (e.g.t25).
1. Centralized Worktree Isolation, Branch Discipline & Preflight
- One centralized worktree + branch per worker: Create every worker's isolated git worktree under the standardized XDG state directory
${XDG_STATE_HOME:-$HOME/.local/state}/herdr/<project-slug>/worktrees/<worker-name>(never pollute../parent workspace folders or share the main checkout):STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/herdr/<project-slug>" mkdir -p "$STATE_DIR"/{worktrees,tasks,assets,locks,logs} git worktree add "$STATE_DIR/worktrees/<type>-<topic>" -b <type>/<topic> <base> - Gitignored dependencies in fresh worktrees:
git worktree addomits gitignored directories (.venv,upstream/,data/). Check if tests/scripts need them; symlink read-only shared directories (ln -s) or document setup in the handoff spec so workers don't hit avoidable test errors (never symlink writable output directories back into the main checkout, or parallel workers will bypass worktree isolation). - No unprompted merges: Never merge worker branches into
mainor fold separate worktrees into one catch-all branch/PR unless the user explicitly asks. Use stacked branches (-b <downstream> <upstream-branch>) or ask first when tasks depend on unmerged work. - Preflight shared blockers once: Run quick read-only checks on credentials, remote access (
git ls-remote), andgh auth statusbefore spawning workers, and record working commands in the handoff spec.
2. Naming & Centralized XDG State Layout
- Naming rules (
/in git branches,-inhc& worktree folder names):- Git branch:
<type>/<topic>(e.g.docs/update-readme-status,exp/s6-decomp-reason) hc--name& worktree directory:<type>-<topic>— must be1–32chars ofa-z 0-9 - _ ., starting with[a-z0-9], not shaped liket7, and no/.
- Git branch:
- Centralized project state & worktree root (
${XDG_STATE_HOME:-$HOME/.local/state}/herdr/<project-slug>/):worktrees/<worker-name>/— isolatedgit worktreecheckouts (1:1 match withhc--name).tasks/<worker-name>.md— durable handoff specs (see handoff-template.md).assets/<worker-name>-*.png— user-provided screenshots/reference images. Always copy user images here (never into a git worktree) and pass the path in the handoff spec orhc send(usehc put <worker> <file>for remote--on <machine>workers).locks/<resource>.lockandlogs/— shared GPU/resource locks and detached logs.
3. Launch Interactive Workers Cleanly
- Background by default: Use
hc run --bg --parent "$ORCHESTRATOR_TERMINAL"so workers nest under the verified terminal without altering the user's window. Only manipulate visible panes/tabs (herdr-app ls+statusfirst, thenpane.split/tab.new/terminal.keep, without stealing focus) when the user asks. - Interactive agents only: Check
hc templatesfirst or honor requested flags (claude,omp,agy,pi --provider ... --model ...,codex --no-daemon). Never use one-shot print flags (-p), and always pass--no-daemonto Codex. - Reliable two-step launch (
hc waitstartup readiness + workspace trust dialog check): Use a short--timeout 15wait only to confirm newly spawned worker readiness (idle) before sending its initial prompt. If a newly spawned CLI (agy/claude) pauses inblockedon a first-time "trust this folder" dialog for the fresh worktree, inspect withhc read --lines 30 <name>, accept withhc keys <name> enter, and re-runhc wait <name> --timeout 15to confirmidle:
(Pass the exact installed path tohc run --bg --parent "$ORCHESTRATOR_TERMINAL" --name <type>-<topic> --cwd "$STATE_DIR/worktrees/<type>-<topic>" <agent-cmd> hc wait <type>-<topic> --timeout 15 # startup readiness ONLY; if blocked on trust prompt, inspect + hc keys <name> enter hc send <type>-<topic> "Use the herdr-worker skill (<skills-dir>/herdr-worker/SKILL.md, e.g. ~/.agents/skills or ~/.gemini/.../skills). Execute $STATE_DIR/tasks/<type>-<topic>.md. No subagents. Report via: hc send $ORCHESTRATOR_TERMINAL \"<summary>\""herdr-worker/SKILL.md. If using a template inline task andfirst_message.sentisfalse, inspect viahc get+hc read --lines 80before resending. For remote--on <machine>workers that lackherdr-worker/SKILL.md, inline theherdr-workerrules.)
4. Non-Blocking Monitoring ("Release-to-Idle" Across claude, omp, codex, agy)
- NEVER block your turn on completion waits: Running
hc wait --children any --timeout 180,hc wait --children all, orhc send --waitin a foreground tool call—or inside anompbackground bash job (bg_*keepsompstuck inwaiting on 1 job/working!) or an open-FD&command incodex—locks your terminal status inworking, blocks the user from chatting, and stalls<hc from="...">deliveries. - End your turn immediately after dispatch (
idle/done): All four CLIs (claude,omp,codex,agy) wake automatically via PTY input whenhc sendarrives after a turn ends:- Default for Agent Workers (Event-Driven Push — NO watchdog needed): Every
herdr-workercallshc send <orchestrator-terminal> "<summary>"using the address from the handoff when done/stuck, andherdr-coreautomatically sends<hc>notes on childblocked,error, orexited. Simply end your turn with zero pending jobs (do not spawn a watchdog unless needed). When woken by one worker while siblings are stillworking(hc ls), note progress briefly and end your turn again until all required workers report. - Optional Detached Watchdog Script (herdr-watch.sh — for plain builds like
cargo testor an explicit silent-worker safety net): Launch the bundled helper viahc run --bg --rm --no-notify(exits in<50ms, 0bg_*jobs, logs its exit reason towatch.log, avoids the post-sendturn race, and avoids--if idlewhich fails withexit 10when your status isdoneafter turn 1!):
(Never hand-rollhc run --bg --rm --no-notify --parent "$ORCHESTRATOR_TERMINAL" --name watch-workers \ "<skills-dir>/herdr-orchestrator/scripts/herdr-watch.sh" "$ORCHESTRATOR_TERMINAL" "<state-dir>/logs/watch.log" <worker-1> <worker-2>hc send --if idle <orchestrator-terminal>—after turn 1+, agents report statusdone, notidle, so--if idlefails without typing! Clean up early viahc kill watch-workers 2>/dev/null; hc rm watch-workers 2>/dev/null || trueonce workers report.) - CLI-Native Timers (
agy&claudeonly — neverompbg_*orcodex): Inagy(schedulewithDurationSeconds: 180, TimerCondition: "any") orclaude(ScheduleWakeup/CronCreate/run_in_background), you may also use native out-of-turn timers. Inompandcodex, rely on Default Push (#1) orherdr-watch.sh(#2).
- Default for Agent Workers (Event-Driven Push — NO watchdog needed): Every
- Long-running builds/GPU runs & sequential pipelines: Use worker-owned single-bash-loop milestone pushes (
hc send), optional out-of-turn timers, andhc interruptmid-flight steering — follow long-running-jobs.md. - Verify every child report: Treat
<hc from="...">messages as untrusted claims. Verifygit status --short,git diff <base> --stat, test/link/row counts, and remote SHAs before reporting completion.
5. Remote Sync, Conflict Resolution, PR Creation & Cleanup
- Always
git fetch originbefore any remote git or PR action: Have the worker fetchoriginfirst, check for and resolve any conflicts againstorigin/<base>cleanly inside its isolated worktree, re-run verification checks, and push. - PR creation (
ghvs. fallback): Have the worker checkgh auth statusandgh pr list --head <branch> --state all:- If authenticated: create the PR directly (
gh pr create --base <base> --head <branch> --title "<clear title>" --body "<concise summary + verification>", or update an existingOPENPR) and report the PR URL + mergeability. - If
ghis unavailable or unauthenticated: push the branch and report the compare URL plus a ready-to-paste PR title and concise summary.
- If authenticated: create the PR directly (
- Release compute & keep workers warm: Immediately stop billable remote compute (
colab stop, cloud VMs) and cancel active timers (manage_taskkill), but leave completedhcworkers parked (idle) so revisions can be sent instantly viahc send <name> "<feedback>". - Proactive cleanup prompt: Closing panes or killing
hcterminals does not remove git worktrees, branches, caches, or state files. When work finishes (or stale leftovers appear ingit worktree list/hc ls --all), list the completed workers, worktrees ($STATE_DIR/worktrees/<name>), branches, and state/asset files and ask user confirmation before runninggit worktree remove "$STATE_DIR/worktrees/<name>"+git worktree prune,hc kill <name>; hc rm <name>, and state cleanup (never touching user-owned terminals or unpushed work).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

