/lstack-extras:herdr-agentfrom lstack-extras
Manages AI agent fleets in the Herdr TUI: spawns sub-agents, sends prompts, reads replies, monitors status, and tears down workers via the herdr CLI.
Ships in lstack-extras. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Build and control an AI-agent fleet in the root agent's Herdr tab. Keep the root pane as orchestrator; add each sub-agent as a right-hand split running the main agent's own launch profile; equalize all columns; then start, prompt, wait, read, monitor, steer, or tear down through the herdr CLI.
Use Herdr concepts, not tmux assumptions; references/herdr-recipes.md says which server calls do the work. Relay reply deltas rather than whole panes to protect the context and token budget.
| Request | Follow |
|---|---|
help, or what this does and how to drive it | Help in references/help-request.md — answer and stop |
| Spawn sub-agents beside root | Phases 1–2, then 4–5 if assigning work |
| Message an existing agent | Phases 3–5 |
| Read without sending | Phase 3, then Phase 5 read only |
| Check what the fleet is doing | Phase 6 |
| Broadcast to a fleet | Phases 3 and 7 |
| Focus/steer a pane | Phase 3, then Phase 7 |
| Close workers | Phase 7 teardown |
| Main agent's own context is filling up | Phase 8 HANDOFF |
Read only the reference needed by that branch:
references/herdr-recipes.md for guarded grid spawning, equalization semantics, multi-line prompts, focus, and troubleshooting.references/launch-profile.md for where a worker's kind, model, thinking level, and flags come from, the kind gate, and what never carries over.references/delivery-and-waiting.md for the one-call prompt contract, error codes, wait semantics, reading replies, and the no-agent fallback.references/fleet-monitoring.md for snapshot status, sidebar badges, notifications, and the run report.references/context-succession.md for the main agent's context gate, HANDOFF procedure, and handoff brief template.references/final-report.md for the closing report's status words, required parts, and examples.Resolve this branch before Prerequisites. A help request runs no herdr command, touches no pane, and changes nothing, because someone asking how this works may not have Herdr installed yet. Take it on help, --help, /herdr-agent help, or any plain question about what the skill does or how to drive it. Answer, then stop: no fleet work, no completion report.
The full help text is in references/help-request.md. For a narrower question such as how to broadcast, answer from that one phase instead of printing the whole block, and name the phase so the user can ask for it again by name.
Done when: the user has the summary or their specific answer, and no herdr command ran.
First, if HC_TERMINAL_ID is set and HERDR_ENV is not, this is the Herdr desktop app: stop and use hc-agent. Never call herdr there; it reaches an unrelated TUI server.
command -v herdr and herdr status. If the server is unavailable, ask the user to start Herdr from a real terminal; never run bare herdr from a non-TTY shell.HERDR_ENV=1. Outside a Herdr pane, do not inspect or control the focused session. If check 1 or 2 fails, stop: the run ends BLOCKED.HERDR_PANE_ID, HERDR_TAB_ID, and HERDR_WORKSPACE_ID, or from herdr pane current --current and list/get commands.herdr <group> rather than inventing flags. Client and server versions can differ after an update; herdr status says whether the server supports what you are about to use.right, keep every worker in the root tab, then run the equalizer. Create separate tabs only when the user explicitly requests isolation.blocked target itself, but not a working one, and its wait tracks lifecycle state rather than one turn. Reject missing, ambiguous, working, or unverifiable targets yourself before dispatching.agent prompt --wait cycle.--without flags for a skill that demands bare launches). A field is named only by a concrete value: a kind, a model ID or alias, a thinking level, or a flag. Ask when a request is vague ("something cheaper") or names a model from another harness without a kind. A worker of a different kind inherits nothing else. Never guess a value you cannot read: model or thinking may be reported UNKNOWN, but unreadable same-kind setup flags abort the launch unless --without flags explicitly opts out.test -z "${HC_TERMINAL_ID:-}" || test "${HERDR_ENV:-}" = 1 || { echo "Error: Herdr desktop app; use hc-agent" >&2; exit 1; }
command -v herdr >/dev/null || { echo "Error: herdr is not installed" >&2; exit 1; }
test "${HERDR_ENV:-}" = 1 || { echo "Error: not running inside a Herdr pane" >&2; exit 1; }
herdr status || { echo "Error: Herdr server is unavailable" >&2; exit 1; }
root_pane="${HERDR_PANE_ID:?}"; root_tab="${HERDR_TAB_ID:?}"; ws="${HERDR_WORKSPACE_ID:?}"
Resolve project_dir from the root pane's cwd, falling back to the current directory. Set here to the skill's scripts/ directory with the resolver in references/herdr-recipes.md, which probes repo-local installs before global ones. Every later script call uses "$here/…".
Done when: server status passes and concrete root_pane, root_tab, ws, project_dir, and here values are recorded.
Before spawning, define each worker's unique name, task, and expected deliverable. Placement and launch are two steps: herdr agent start never creates or moves layout, and requires a pane already sitting at its shell prompt.
Resolve the inherited launch profile once per spawn wave, as its own tool call before the call that splits, so the user sees it before any agent starts:
python3 "$here/launch_profile.py" --root-pane "$root_pane" \
--main-model "$main_model" --main-thinking "$main_thinking" >/dev/null
Set main_model and main_thinking, then relay the summary to the user before the first split: references/launch-profile.md → Relay the profile before the first split. If the user already declined bypass for this run, pass --without bypass on every worker.
Use the canonical spawn_sub workflow in references/herdr-recipes.md:
next_grid_split.py --root-pane "$root_pane" to plan the rightmost split.--direction right --no-focus in project_dir, passing --env "HERDR_ROLE=<name>" so the worker can read its own role instead of being told it in every prompt.next_grid_split.py --equalize --root-pane "$root_pane"; abort on any error or non-convergence.--start <name> --pane <id> --timeout 60000. Add only what the user named: --kind, --model, --thinking, --without bypass|flags, or native flags after --. The command runs herdr agent start on the profile.python3 "$here/badge.py" <name> --title "<job>" --token role=<role>.agent start is the readiness gate: it returns only once Herdr detects the expected agent and considers it interactive-ready, and returns agent_not_ready immediately if the agent booted into a dialog. There is no separate readiness pass. Names must match [a-z][a-z0-9_-]{0,31} and be unique among live agents. Never fold the task into argv.
Confirm the fleet with python3 "$here/fleet_status.py" --tab "$root_tab" --fail-on-blocked before assigning any work.
Done when: every worker has a unique name and pane ID in root_tab, the layout widths differ by at most one cell, root remains active, the launch-profile summary reached the user, and every start returned success.
Run herdr agent get <name> or herdr pane get <pane-id>. If a name is missing or ambiguous, list agents and ask; never silently retarget. agent_not_found means the pane hosts no detected agent — start one, or take the pane-surface fallback in references/delivery-and-waiting.md. Record both the name and pane ID and use that same ID for every later mutation.
Done when: one existing target resolves uniquely, and its name, pane ID, and current status are recorded.
python3 "$here/preflight_send.py" "$target" >/dev/null || exit $?
herdr agent prompt "$target" "$task" --wait --timeout 180000
The preflight refuses working (2), blocked (3), unverifiable (4), and no-agent (5) targets. What the one-request prompt guarantees, and when to add --until: references/delivery-and-waiting.md → Phase 4 prompt guarantees.
Done when: the prompt returned success, or a named error code was propagated.
Map the failure first. agent_blocked means nothing was sent and a human is needed. agent_prompt_stalled means it was submitted but no activity followed — inspect, never blindly resend. timeout means no settled state inside the budget. Propagate all three; do not report them as replies.
On success, read a capped transcript and relay only the relevant delta:
herdr agent read "$target" --source recent-unwrapped --lines 80
Accept idle or done as settled; they differ only in whether the completion has been marked seen. If raising --lines reveals no more output, use the alternate-screen file fallback in references/delivery-and-waiting.md.
Done when: the reply delta came from herdr agent read after an idle or done status, or the blocked/stalled/timeout code is reported and nothing more was sent.
python3 "$here/fleet_status.py" --tab "$root_tab"
Prefer this one snapshot call over per-agent herdr agent get polling; why: references/fleet-monitoring.md → Why one snapshot.
Keep the human oriented without making them read panes:
python3 "$here/badge.py" <name> --token phase=<phase>. Display-only, so it never perturbs waits or rollups.herdr notification show "Agent blocked" --body "<name> needs input" --sound request, and once at run completion with --sound done.See references/fleet-monitoring.md for field caps, token semantics, and workspace-level rollups.
Done when: the current fleet state came from a snapshot call, not from memory of what was dispatched.
"$here/broadcast.sh" "<task>" <targets...>. It resolves all targets from one agent list, dedupes, refuses unsafe ones, dispatches agent prompt --wait concurrently, and maps every error code to a reason. HAC_BADGE=1 badges each row with its phase.herdr agent focus <name>, which also marks that agent's completion seen. For follow-ups, repeat Phases 4–5.herdr server stop from an active session unless the user intends to stop every pane process.Done when: every requested target has a recorded outcome and destructive actions match the user's confirmed scope.
Long fleet runs outlive one context window. Self-check your own usage at three gate points — before a spawn wave, before a broadcast, and after each relayed reply — never mid-cycle between a dispatch and its wait. HANDOFF when self-reported usage is at or above the threshold (default 50%); when usage is UNKNOWN, apply the counter fallback in the reference below.
HANDOFF spawns a successor pane and moves the orchestrator role to it after an ack. Details: references/context-succession.md → HANDOFF overview.
Read references/context-succession.md for the gate-point table, UNKNOWN fallback logging, full procedure, and the brief template. Never paste transcripts or diffs into a brief.
Done when: the gate decision is recorded with a percentage or an explicit UNKNOWN fallback, and any HANDOFF has a ready successor pane, a delivered brief, a received ack, and no write from the outgoing pane afterward.
Expected final report for a successful fleet operation:
Result: COMPLETE — spawned reviewer and tests; both replied
Evidence:
herdr status: ok · root kept w26:p1 · 3 equal-width columns
Profile: claude · claude-opus-5[1m] · thinking max (inherited)
fleet_status.py: reviewer=done, tests=idle · 2 replies captured, 0 blocked, 0 timed out
Uncertainty: reply content relayed as written, not checked against the task
Decision: No approval needed.
Acceptance criteria:
help request prints the usage summary, runs no herdr command, and emits no completion report.herdr status succeeds and every target resolves uniquely.fleet_status.py, not from recollection.help ends with the final report, which passes its four reader checks: result on the first line, facts separated from assumptions, every claim traced to evidence, next decision named. Without user feedback, human understanding stays unconfirmed.Read references/edge-cases.md when a target is blocked, agent_not_found, or unknown; a name collides; the grid passes four panes or will not equalize; the workspace or tab is wrong; a successor never acks; root process-info lacks full argv; or a start times out after inheriting a flag.
◆ Herdr Agent ([operation])
··································································
Server: √ pass
Root resolved: √ pass (pane · tab · workspace)
Targets: √ pass (N/N unique)
Launch profile: √ pass (kind · model · thinking · N flags; UNKNOWN and ⚠ named — if spawning; otherwise — n/a)
Layout/readiness: √ pass (if spawning; otherwise — n/a)
Delivery: √ pass (if prompting; otherwise — n/a)
Replies: √ pass (settled · blocked/stalled/timeouts reported)
Fleet snapshot: √ pass (N agents · statuses)
Context gate: √ pass (P% or UNKNOWN · continue | HANDOFF → main-gN)
Destructive action: — none (or confirmed scope)
Result: PASS | FAIL | PARTIAL
After the Step Completion Report, print the final report from references/final-report.md: Result: (COMPLETE, PARTIAL — <reason>, or BLOCKED — <reason>), Evidence: (only checks that ran), Uncertainty:, then Decision: (the approval needed, or No approval needed.). A help request skips it.
Optional and propose-only. After the run's result is delivered, run this check:
herdr subcommand, flag, or scripts/ path failed on this install and a workaround worked.references/ (the directory holding this SKILL.md). Bump the patch number of metadata.version. If the skill is an installed copy or tracked in git, say so. Commit nothing unless the user asks.Off — the user opted out.references/context-succession.md (opens in a new tab)references/delivery-and-waiting.md (opens in a new tab)references/edge-cases.md (opens in a new tab)references/final-report.md (opens in a new tab)references/fleet-monitoring.md (opens in a new tab)references/help-request.md (opens in a new tab)references/herdr-recipes.md (opens in a new tab)references/launch-profile.md (opens in a new tab)scripts/badge.py (opens in a new tab)scripts/broadcast.sh (opens in a new tab)scripts/fleet_status.py (opens in a new tab)scripts/launch_profile.py (opens in a new tab)scripts/next_grid_split.py (opens in a new tab)scripts/preflight_send.py (opens in a new tab)scripts/wait_for_idle.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
mediumThree short reads, in order
npx claudepluginhub luongnv89/skills --plugin lstack-extras32 skills in this plugin
/agent-profileRun a task with a saved agent profile (harness, model, thinking level) built only from what this machine has installed. User-invoked: /agent-profile. Don't use for free opencode runs, Herdr or Rex fleets, or mcc account setup./ai-job-scoutFind open AI engineering jobs that fit a candidate, verify location and apply links, and assess each employer's product. Use for one-off shortlists or a job alert's research step. Don't use for résumé writing, job applications, or company news./appstore-assetsGenerate App Store screenshots, header/search images and looping videos for iPhone, iPad, Mac from code or a landing page, or re-render a set. Use when preparing a submission. Don't use for App Previews, ASO, review audits, icons, Google Play.Other plugins' skills for the same job