From herdr-pm
From inside herdr, discover your live AI-agent tabs and give each one its own technical-PM/CTO conductor. This is the fleet launcher — use it when several agent-tabs share a workspace and you want to pick which to manage, set backend + autonomy, and split a conductor into each agent's tab; each conductor reads its session and drives the work with scored decisions and parallel worktree lanes. Trigger phrases include "herdr-pm-init", "herdr-pm", "manage my herdr agents", "spin up a PM for each session", "monitor mode", "monitor the fleet for N hours". After spawning, it can enter monitor mode — an autonomous fleet-supervisor loop that for a set window keeps every PM moving with zero blockers (auto-recovers freezes/rate-limits/codex-limits/hung-shells, auto-answers PM questions with full autonomy). Needs herdr (HERDR_ENV=1). Not the per-tab brain (that is herdr-pm-agent, which this installs/mounts and is independently invocable); not for a single Codex side-task (use claude-to-codex).
How this skill is triggered — by the user, by Claude, or both
Slash command
/herdr-pm:herdr-pm-initThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are inside **herdr** (a terminal multiplexer) where several AI agents run in parallel, one per project. This skill is the **fleet launcher**: it gives each **live agent-tab its own conductor** — a manager split in **beside the agent, in its tab**, that reads the session, decides what's next, asks the human scored questions in-pane, and **drives the existing agent via herdr** — fanning indep...
You are inside herdr (a terminal multiplexer) where several AI agents run in parallel, one per project. This skill is the fleet launcher: it gives each live agent-tab its own conductor — a manager split in beside the agent, in its tab, that reads the session, decides what's next, asks the human scored questions in-pane, and drives the existing agent via herdr — fanning independent work into parallel worktree lanes. One manager per tab — never one brain juggling all sessions.
The manager's behavior lives in the herdr-pm-agent skill, which this launcher installs and mounts. You (the launcher) only discover, set up, spawn, and hand off. (herdr-pm-agent is also independently invocable — a human can point it at a single tab without going through this launcher; it then self-bootstraps. This skill is the multi-tab front door.)
herdr-pm-agent (mounted automatically).claude-to-codex.HERDR_ENV is unset, stop and say so.HERDR_ENV=1 and herdr status --json shows a running, compatible server. You cannot start herdr from bash (it needs a TUI) — if it is down, tell the user. Scripts live in this skill's scripts/ dir, referenced below as $HPM/scripts where HPM="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}/skills/herdr-pm-init" (the plugin root when installed as a plugin, else the ~/.claude/skills pool).
python3 "$HPM/scripts/discover_and_spawn.py" discover
Returns JSON: backends_available (offer only CLIs that exist), manage (live agent-tabs with ids, workspace label/number, session, cwd, foreground cwd, repo_root when git can resolve it, and has_conductor — true = a PM already sits in that tab: list as "already managed", never spawn a second), skip_conductors (your own PMs — filtered by registered pm-* name when Herdr exposes it, with fixed ◆ PM … pane labels as the durable fallback), skip_executors (ex-* lanes), skip_idle (empty panes, fully addressable — report, don't manage). Ids are opaque strings: copy them verbatim, never construct one. Detail → references/launcher-workflow.md.
Show the detected agent-tabs; let the human mark which to manage — via your host's interactive question tool (Claude → AskUserQuestion; Codex → request_user_input when available, otherwise an active numbered prompt in-pane; never a passive plain-text list the human must type against). Default = live tabs only (crash-restore of dead sessions is out of scope — offer it only if asked). If a tab is ambiguous, ask.
Peek at each chosen session first, then ask context-aware questions — options from each project's actual work, not a fixed menu:
[conductor] will manage [managed] (e.g. claude will manage claude, codex will manage claude); default codex.▰▱▱▱ observe · ▰▰▱▱ consult · ▰▰▰▱ autonomous (default) · ▰▰▰▰ full); frame around the project's risky/safe steps. The assignment carries the level number.Never ask about: mode — auto-detect it ([ -d <repo>/.herdr-pm ] → power, else light; a human can opt a fresh repo into power by saying so, but it is not a question you raise). Placement — every conductor splits side-by-side into its managed agent's tab; there is no other mode. Relay rhythm — gone; humans answer PMs in their tabs. Codex reviews — not a setup question; the conductor offers them just-in-time on its first branch/worktree review when ~/.codex exists. Goals / the mandate — not a launcher question; in POWER the conductor runs its own deep onboarding interview ("why did you hire me?") on its first turn. This is exactly why launcher setup stays at two questions: you place the hire, the hire learns the job.
Before spawning a codex conductor, make sure its default/code mode can actively ask the human:
codex features list | grep -E '^default_mode_request_user_input[[:space:]]+' || true
If it is not true, ask the human through your current host's active question tool: "Enable Codex request_user_input in default/code mode so PM conductors can ask scored questions directly?" If they approve, run:
codex features enable default_mode_request_user_input
Then re-check codex features list. This edits the user's Codex config intentionally and may require a fresh codex session/restart for already-running Codex panes; new conductors spawned after the change should see it. If the human declines or the command is unavailable, continue with the documented active numbered-prompt fallback.
HPM="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}/skills/herdr-pm-init"
python3 "$HPM/scripts/install_agent_skill.py" --name herdr-pm-agent \
--src "${CLAUDE_PLUGIN_ROOT:-$HOME/.claude}/skills/herdr-pm-agent" --scope global \
--backends codex --dry-run # review, then drop --dry-run
Only codex needs this — claude/pi/hermes already see the operator via the canonical ~/.agents/skills pool. Install global (avoids dropping a symlink + skills-lock.json into the repo). Per-backend dirs + invocation (/name claude, $name codex) → references/backend-matrix.md.
[ -d <repo>/.herdr-pm ] → spawn with --mode power --cwd <repo>/.herdr-pm (the world already exists — no question, no re-init). Otherwise --mode light --cwd <repo>, unless the human explicitly asked for power — only then gather a 1–2 sentence mandate (the north star + win-condition; ask one scoped question if unclear — not a long interview) and scaffold:
python3 "$HPM/scripts/init_power_world.py" --repo <repo> --slug <slug> \
--managed-pane <pane> --managed-term <term> --session-id <sid> \
--autopilot <N> --language <lang> \
--goal "<the 1-2 sentence mandate you gathered>" # writes GOAL/00-charter.md
init_power_world.py builds the full canonical world (spec → herdr-pm-agent references/power-world.md): the folders (GOAL/ TODO/ PLAN/ DECISION/ LEARNING/ MEMORY/), the projection fixtures (STATE/DIGEST/RUNLOG), MEMORY/INDEX + drive-facts, the PLAN/ planning fixtures, a pointers-only hub AGENTS.md (folder map + read-order + plan-first — it does NOT defer to a long interview), and GOAL/00-charter.md from your --goal. On its first power turn the conductor just confirms the mandate (one light touch) and drives (herdr-pm-agent → references/onboarding-interview.md §1). If you couldn't gather a mandate, omit --goal — the charter lands PENDING and the conductor captures it in one question. Git-ignored. Re-running init on an existing world is safe — it completes a partial one (idempotent fill, clobbers nothing), --check audits it, --upgrade refreshes a stale hub; --force is a full reset (fresh only). Several PMs on one repo → --world-dir .herdr-pm-<role> per PM, then spawn with --world (auto-detect stays exactly .herdr-pm). Detail → references/launcher-workflow.md.
One script call per conductor — it splits the conductor side-by-side into the managed agent's tab and runs the whole atomic flow (split-start → registration wait → fixed pane-label rename ◆ PM <REPO_UPPER> + read-back verify → best-effort 70/30 resize → write + prime the assignment → resend-if-eaten → auth check), emitting one JSON result. Tabs are never renamed; the conductor's pane label is fixed after spawn, and live state uses custom_status:
python3 "$HPM/scripts/discover_and_spawn.py" spawn \
--slug <slug> --backend <claude|codex|pi|hermes> \
--cwd <repo-or-.herdr-pm> --repo-upper <REPO_UPPER> \
--managed-pane <pane> --managed-term <term> --session-id <sid> \
--repo <repo> --mode <light|power> --autopilot <N> --language <lang>
Check "ok": true and every verify.* flag; layout_70_30 is informational, not a gate. On auth_ok: false, the script closes only the conductor pane and reports closed_conductor_pane; keep the managed agent's tab. The assignment lands at ~/.local/state/herdr-pm/<slug>/assignment.md (durable — never /tmp), carries your_term, notes $HERDR_PANE_ID for self-targeted status updates, and (power, optional) --world; pane ids still renumber, so any rare pane operation must re-resolve first (references/pitfalls.md #4/#20). Never spawn the next conductor until this one's JSON came back ok. Raw per-step commands (fallback / debugging) → references/backend-matrix.md; traps → references/pitfalls.md.
Each conductor sits beside its agent and asks the human in-pane (custom_status: awaiting you plus one best-effort notification means a decision is waiting). Your job after spawning: report the spawn results + which conductors already await a decision, fire one summary toast (notification show "PMs ready" …), then get out of the way. A conductor is self-sufficient: it dispatches missions via pm.py dispatch --file (each minting a unique marker — TASK_DONE reuse false-fires, pitfall #28; parallel worktree lanes for independent work), arms a backgrounded dual-arm wait (minted-marker wait primary + agent wait <managed_term> status secondary — terminal id, never a pane id; references/pitfalls.md #23) and self-wakes, verifies, reports — you don't babysit it. On request you can survey all conductors (board digest) or answer a conductor's widget for the human via pm.py keys (#19); re-poke one only as a fallback if it stalls past its wait. Conductors keep a short, stable ◆ PM <REPO_UPPER> pane label and never rename tabs. Survey + live autopilot change → references/launcher-workflow.md.
After hand-off, offer to stay on as an autonomous fleet supervisor for a window the human sets through the host's active question tool: "Enter monitor mode for [duration]? I'll keep the whole fleet moving with zero blockers — auto-recover freezes / rate-limits / codex-limits / hung-shells, and auto-answer every PM question with full autonomy (a fresh decision sub-agent reads both scrollbacks and picks the most momentum-forward option). PAUSE anytime via touch ~/.local/state/herdr-pm/PAUSE." If yes → read references/monitor-mode.md and follow it: store the deadline → start the deterministic floor (scripts/monitor-loop.sh, backgrounded) → arm the read-only Monitor (pm_monitor.py --watch) → arm a 4-min ScheduleWakeup heartbeat, then run the per-wake loop. Within the window the human's grant is full autonomy — every action (incl. prod deploy / force-push / delete / migration / spend) is pre-authorized; never leave a blocker. If no → you're done at Step 8. The detector script: pm_monitor.py --dry-run (human report) · --json (orchestrator snapshot) · --watch (the Monitor tripwire) · default ACT (the floor).
.herdr-pm/ exists → power) and .herdr-pm/AGENTS.md pre-fills autopilot — re-ask only backend if relevant. Skip executors too: discovery's skip_executors (ex-* panes) are a conductor's parallel lanes, never manageable agents.herdr tab create / agent start uses --no-focus; all conductor reads and waits run in the background. Never call herdr tab focus / pane focus / agent focus / pane zoom|swap automatically: if the human navigated to a pane themselves, leave it — they own focus and the view entirely. Never run herdr update, server stop|reload-config, session, or integration commands — infra is the human's.--current or omit a target id in automation — omitted targets resolve to the human's focused pane/workspace, not yours (pitfall #27). Explicit --pane/--workspace/--cwd, always.token_revoked, "sign in again"). A backend can spawn, go working, then die on auth — if so, fall back to another backend.HERDR_ENV unset) or herdr down → stop, explain, do not improvise.skip-real); never edit a tracked .gitignore (power world uses .git/info/exclude).description has a hard 1024-char ceiling — codex enforces it, claude doesn't. Over it, codex prints ⚠ invalid description: exceeds maximum length of 1024 characters, skips loading the skill, and the warning surfaces on every codex pane. Re-measure after ANY frontmatter edit; both this skill (~996) and herdr-pm-agent (~972) already hug the ceiling, so trim before adding. Symptom + measure command → references/pitfalls.md #32. (It caps only the description — the body is unbounded, so put detail there.)terminal_id — they renumber (references/pitfalls.md).references/monitor-mode.md): within the user-set window the orchestrator auto-answers every question and takes any action — including irreversible/prod ones — without a second ask; the window IS the authorization. The only brakes are the PAUSE file (~/.local/state/herdr-pm/PAUSE) and a human typing in a pane (took-the-wheel). Stay the single in-session writer; run one --watch at a time (watch.lock); resolve ids at call time; two-phase consequential widget keys.| File | Read when |
|---|---|
references/launcher-workflow.md | Running discovery, the setup-question shaping, install, and the per-tab spawn loop end to end. |
references/backend-matrix.md | Spawning/installing/invoking a specific backend (claude/codex/pi/hermes) — exact commands + JSON keys. |
references/pitfalls.md | Any herdr/codex spawn-or-drive trap (pane renumbering, done≠idle, lost sends, reserved names, plain-text reads). |
references/monitor-mode.md | Running the autonomous fleet-supervisor loop (Step 9 / "monitor mode"): the --watch/--json flags, the ScheduleWakeup+Monitor wake loop, the full-autonomy decision sub-agent, the hung-shell (ESC×2) + recovery playbook. |
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub yigitkonur/herdr-pm --plugin herdr-pm