/lstack-extras:hc-agentfrom lstack-extras
Manages AI agent fleets in the Herdr desktop app: spawn workers, prompt/wait/read, monitor fleet status, steer panes, and teardown via hc and herdr-app CLIs.
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 tab of the Herdr desktop app. Keep the root pane as orchestrator; add each worker as a split to the right running the main agent's own launch profile; then prompt, wait, read, monitor, steer, or tear down through hc (herdr-core, which runs the terminals) and herdr-app (which arranges the window), wrapped by this skill's scripts.
The app is not the Herdr TUI: its terminals set HC_TERMINAL_ID, not HERDR_ENV, and the herdr CLI on PATH there reaches a separate TUI server. This skill never calls herdr. A worker's name is its hc-agent.name label, and its status is the OSC 7501 state its CLI reports (hc get). Relay reply deltas, not whole screens, 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 workers beside root | Phases 1–2, then 4–6 if assigning work |
| Message an existing agent | Phases 3–5 |
| Give several workers different tasks | Phases 3 and 7 (dispatch) |
| 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/app-vs-tui.md for every herdr-agent operation and how it behaves here (same, different, or unavailable), the observed versions, and what is still unverified.references/hc-recipes.md for the scripts resolver, spawn waves, what --start runs, steering, teardown, and edge cases.references/launch-profile.md for where a worker's kind, model, thinking level, flags and wrapper come from, and what never carries over.references/delivery-and-waiting.md for the status table, the prompt contract and exit codes, reading replies, the file fallback, and fleet monitoring.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: someone asking how this works may not have the app installed yet. Take it on help, --help, /hc-agent help, or any plain question about what the skill does. Print the text in references/help-request.md, or for a narrower question (how to broadcast, what differs from herdr-agent) answer from that one phase or from references/app-vs-tui.md and name it. Run no hc or herdr-app command, change nothing, and emit no completion report.
Done when: the user has the summary or their specific answer, and no command ran.
HERDR_ENV=1, this is a Herdr TUI pane: stop and use herdr-agent. If neither HERDR_ENV nor HC_TERMINAL_ID is set, this is not a Herdr terminal at all: stop, BLOCKED.here to the scripts/ directory beside this SKILL.md. When the harness does not show the skill's base directory, use the resolver in references/hc-recipes.md.python3 "$here/agent.py" check. It confirms hc and herdr-app are on PATH (command -v hc herdr-app), that hc get $HC_TERMINAL_ID resolves with herdr.space and herdr.tab labels (so the window shows this terminal), and that herdr-app ls lists its pane in that tab. On any failure it prints the fix, and the run ends BLOCKED. Never act on whatever the window happens to show.hc <command> --help or herdr-app commands. Never run bare herdr-app, which opens the person's window.GO, the outgoing agent issues no further prompts, splits, or closes.herdr, and spawn only with an explicit split. Workers come from herdr-app do pane.split --pane <explicit pane> through launch_profile.py --start. Never use terminal.open or terminal.keep, which place relative to the focused pane, and never hc run, whose children die with their parent and stay hidden from the window.hc-agent.name label in the root's tab, then pass its t… address to every hc call. hc resolves bare words against its own --name namespace, so a label name could reach a different terminal.working, blocked, unverifiable (no status), agent-less, or finished target, and never write to your own terminal. A missing status is never idle.agent.py prompt cycle.agent.py focus and tell the user; never answer the dialog for them, and never send with hc's --force.--without flags opts out.Record root (terminal), root_pane, space, tab, and project_dir (cwd) from the check output. Every script defaults its root to $HC_TERMINAL_ID, which persists between tool calls even when shell variables do not.
Done when: agent.py check exited 0 and concrete root, root_pane, space, tab, project_dir, and here values are recorded.
Before spawning, define each worker's unique name, task, and expected deliverable. Names must match [a-z][a-z0-9_-]{0,31} and must not look like an address (t7); a name already used in the tab gets an epoch suffix.
Resolve the inherited launch profile once per spawn wave, as its own tool call, so the user sees it before any agent starts:
python3 "$here/launch_profile.py" --main-model "$main_model" --main-thinking "$main_thinking" >/dev/null
Set main_model and main_thinking to your own model ID and thinking level, and leave either one empty rather than guess. On Claude Code, leave main_thinking empty, because the script reads CLAUDE_EFFORT. Relay the summary line to the user before the first spawn, including any ⚠ or warning: line. If the user already declined bypass for this run, pass --without bypass on every worker. references/launch-profile.md has the source order, the wrapper rule, and what never carries over.
Then start each worker with one --start call per worker:
python3 "$here/launch_profile.py" --main-model "$main_model" --main-thinking "$main_thinking" \
--start reviewer --cwd "$project_dir"
Each start splits the newest worker pane (or root's) to the right, labels the new terminal, puts focus back where it was, and waits for an idle or done status; the app sizes the columns. Details and exit codes: references/hc-recipes.md → What --start runs.
Use the name and terminal each start printed for every later call. Confirm the fleet with python3 "$here/agent.py" fleet --fail-on-blocked before assigning work. If the user asked only for spawning, still send each worker the worker preamble (Phase 4) as its first prompt.
Done when: the launch-profile summary reached the user, and every start printed "outcome": "ready" and "focus_restored": true with a unique name and a terminal in the root's tab, while root remained in its pane.
Run python3 "$here/agent.py" get <name>. It matches the exact hc-agent.name label or a t… address in the root's tab and prints the terminal, pane, kind, and status. If a name is missing or ambiguous, list the fleet with agent.py fleet and ask; never silently retarget. Record the name and terminal address and use that address for every later call.
Done when: one existing target resolves uniquely, and its name, terminal address, and current status are recorded.
python3 "$here/agent.py" prompt "$target" - --timeout 180 <<'EOF'
<task text>
EOF
One call refuses an unsafe target before typing, appends a turn tag (hc-agent turn <id>), sends with hc send --if idle (plain hc send for done or error), and waits for this turn to settle; its JSON carries the turn ID. hc send can wait 60 seconds for a person's unfinished draft, so give the shell call a timeout above --timeout plus 60 (250000 ms for --timeout 180). Exit codes: 0 settled, 3 blocked, 4 unverifiable, 5 no agent, 6 working, 7 stalled, 8 timeout, 9 exited; references/delivery-and-waiting.md has the full contract, --raw, and the response to each code.
Start each worker's first task with the worker preamble: You are <name>, a worker in an hc-agent fleet. The orchestrator owns this tab and its layout: do not create, close, or type into other terminals, and do not start sub-agents unless asked.
Done when: the prompt printed "outcome": "settled", or a named outcome was propagated.
Map the failure first: blocked needs a human, stalled was submitted with no newer status after it (inspect, never blindly resend), and timeout found no settled state inside the budget. Propagate each; never report it as a reply.
On success, read the lines after that turn's echo and relay only the relevant delta:
python3 "$here/agent.py" read "$target" --turn "$turn"
It prints what follows the turn tag in the screen plus 400 history lines (hc read). Exit 4 means the tag is not there: raise --lines, or use the file fallback in references/delivery-and-waiting.md.
Done when: the reply delta came from agent.py read after a settled outcome, or the blocked/stalled/timeout outcome is reported and nothing more was sent.
python3 "$here/agent.py" fleet
It lists every terminal in the root's tab with role (worker, main, other, root), status, kind, and message, blocked first. It polls one hc get per terminal, so report it as "polled at " and re-run it rather than trusting memory. The app has no badge or notification command: when a worker blocks, show it with agent.py focus <name> and tell the user in chat.
Done when: the current fleet state came from an agent.py fleet call made after the last dispatch.
python3 "$here/agent.py" broadcast "<task>" <targets...> for one task, or python3 "$here/agent.py" dispatch tasks.json for a {name: task} object. Each resolves every target from one listing, dedupes, refuses unsafe ones, prompts the rest concurrently, and prints one outcome and turn ID per target.python3 "$here/agent.py" focus <name> shows that agent in the window (herdr-app do agent.focus). For a full takeover the user can run hc attach <terminal> in their own terminal and detach with ctrl+. For follow-ups, repeat Phases 4–5.agent.py fleet. After explicit confirmation, run python3 "$here/agent.py" close <names...> --confirmed: it closes only hc-agent.role=worker terminals in the root's tab (herdr-app do pane.close) and refuses root, main, and the user's own panes. If the user declines or does not answer, close nothing and record the teardown as skipped. Close a tab or space only when explicitly requested.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. A pane.split terminal has no parent, so the successor outlives this one.
Full procedure: references/context-succession.md → HANDOFF procedure.
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, a sent GO, 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:
agent.py check: ok · root t2x kept in its pane · tab tb…7e
Profile: claude via mcc wrapper · claude-opus-5-5 · thinking max (inherited)
launch_profile.py --start: reviewer=t31, tests=t32 · ready · focus restored
agent.py fleet (polled 14:02): reviewer=done, tests=done · 2 replies read, 0 blocked
Uncertainty: column widths are app-managed and were not measured; replies relayed as written
Decision: No approval needed.
Acceptance criteria:
help request prints the usage summary, runs no hc or herdr-app command, and emits no completion report.herdr command runs, in any phase.agent.py check passes and every target resolves to one terminal address in the root's tab.agent.py prompt, broadcast or dispatch, and returned a named outcome and turn ID.agent.py fleet, 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/hc-recipes.md → Edge cases when a target is blocked, unverifiable, or finished; a name collides; focus did not come back; a worker starts in the wrong folder; a wrapper has no --; a successor never acks; or both HERDR_ENV and HC_TERMINAL_ID are set.
Every run except help ends with two blocks from references/final-report.md: the Step Completion Report (one row per check: prerequisites, root, targets, launch profile, layout and focus, delivery, replies, fleet status, context gate, destructive action), then the final report: Result: (COMPLETE, PARTIAL — <reason>, or BLOCKED — <reason>), Evidence: (only checks that ran), Uncertainty:, and Decision: (the approval needed, or No approval needed.).
Optional and propose-only. After the run's result is delivered, run this check:
hc or herdr-app command, script path, or worker CLI failed and a workaround worked.--timeout.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/app-vs-tui.md (opens in a new tab)references/context-succession.md (opens in a new tab)references/delivery-and-waiting.md (opens in a new tab)references/final-report.md (opens in a new tab)references/hc-recipes.md (opens in a new tab)references/help-request.md (opens in a new tab)references/launch-profile.md (opens in a new tab)scripts/agent.py (opens in a new tab)scripts/hclib.py (opens in a new tab)scripts/launch_profile.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