InnerVault

herdr-multiagent

Indexedprompts.chat (CC0 prompt collection), Ferrum-Sidereum

--- name: herdr-multiagent description: "Playbook for running several coding agents in parallel under Herdr: stage decomposition, one git worktree + isolated env + pane per agent, file-based briefs, state monitoring…

Open the source (opens github.com) https://github.com/f/prompts.chat

What it is

Prompts from Ferrum-Sidereum.

The problem it solves and who it suits haven't been reviewed by InnerVault. The description above is the source's own.

The prompt

Fill in before using: ${HERDR_ENV:-}

---
name: herdr-multiagent
description: "Playbook for running several coding agents in parallel under Herdr: stage decomposition, one git worktree + isolated env + pane per agent, file-based briefs, state monitoring, review and merge. Agent-agnostic: the child kind comes from `herdr pane current` (.result.pane.agent) and matches the orchestrator (omp, opencode, claude, codex, kimi, ...). Use for multi-agent parallel work in separate worktrees. Requires HERDR_ENV=1."
---

# Multi-agent work through Herdr

Playbook: split the project's remaining work into independent stages, put each stage
on its own agent in its own git worktree and Herdr pane, hand it a file-based brief,
monitor it, and accept the result.

This skill is agent-agnostic: the kind of the children equals the kind of the
orchestrator. Launched from opencode, the children are opencode; from omp, they are
omp; from claude, they are claude. Never hardcode the orchestrator's kind from
memory and never pick a "popular" kind.

## 0. Preconditions

```bash
test "${HERDR_ENV:-}" = 1   # if this fails, stop - we are not inside Herdr
```

If the check fails, tell the user the session is not running under Herdr and stop.
Do not drive someone else's Herdr from outside it.

The basic pane/agent commands live in Herdr's own skill (`herdr --skill`).
The installed binary is the authority on syntax; when unsure read
`herdr agent`, `herdr pane`, `herdr integration` instead of guessing.

## 1. Determine your own kind - before anything else

```bash
herdr pane current --current
```

The `.result.pane.agent` field IS the orchestrator's kind, and the same value goes
to `--kind` for the children:

```bash
KIND=$(herdr pane current --current | jq -r '.result.pane.agent')
# without jq:
KIND=$(herdr pane current --current | sed -E 's/.*"agent":"([^"]+)".*/\1/' | head -1)
echo "$KIND"
```

Empty or `unknown` - ask the user which kind to start the children with.
Below, `$KIND` always means this resolved value, never a literal.

Check the Herdr integration for this kind (it provides `agent list/wait/prompt`):

```bash
herdr integration status | grep -i "$KIND"
```

- `current` - good.
- `not installed` - run `herdr integration install "$KIND"`. Only **new** sessions
  pick the integration up, so install it BEFORE starting children; the orchestrator
  itself stays invisible to `agent list`, which is fine - it needs no monitoring.
- The kind is absent from `herdr integration install` (e.g. `amp`, `cline`, `kiro`,
  `maki`) - there will be no structural monitoring, use the §7 fallback
  (`pane read` + git). Not a blocker.

State it explicitly to the user: "children kind = $KIND".

## 2. Decomposition - the main step, do not rush

- Read the project plan/spec and the current state (`git log`, tests,
  `git worktree list`).
- Split the remaining work into stages with **non-overlapping file areas**.
  Two agents on one package - only deliberately and with an explicit order
  (afterwards, not in parallel).
- Additive edits to shared files (config, lock) are acceptable - record in the briefs
  "additive only, no signature changes"; the orchestrator resolves merge conflicts.
- Write down the matrix "stage -> files it MAY / MUST NOT touch".

Before launch: everything finished in main is committed, the tree is clean.

## 3. Worktree + isolated environment per agent

```bash
git worktree add ../<proj>-s<N> -b stage-<N>-<name>
```

Python trap: a shared venv imports SOMEONE ELSE's code (editable install of the main
repo). Give each worktree its own venv:

```bash
cd ../<proj>-s<N> && python -m venv .venv \
  && ./.venv/Scripts/python.exe -m pip install -q -e "./api[dev]"
```

Install several venvs sequentially in one background command (the pip cache is shared).
JS stack: its own `node_modules` per worktree (`npm ci`).

If the orchestrator has a command-wrapper hook (rtk and similar): a relative
interpreter path (`../.venv/Scripts/python.exe`) in briefs does not resolve through
such a hook ("command not found"). In briefs and prompts use only ABSOLUTE paths to
the python/npm of that worktree.

## 4. Briefs - as files, not on the command line

`<repo>/.briefs/stage-<N>.md` (untracked). Brief structure:

- **context**: what to read first (spec, contract, key files), what is already done;
- **task**: concrete requirements referencing spec items;
- **boundaries**: files allowed/forbidden, "do not leave the worktree", "do NOT push";
- **acceptance**: exact test/linter commands (with the absolute interpreter path of
  the worktree), "pre-existing tests stay green", commit to its own branch, final report.

A brief must not assume a particular agent kind: do not write "run omp/skill/..."
into it - write the goal, the boundaries and the acceptance commands. The child
decides which of its own tools to use.

The prompt to the agent is short: "Read the file <brief> and complete it fully".

## 5. Panes: create them, name them IMMEDIATELY

Recommended layout - main-left: the orchestrator pane on the left at full height, all
children in a column on the right, one under another. If the user has layout plugins
built around main-left, any other scheme breaks their view.
If the user explicitly asks for a different layout, follow the user.

First child - `split --current --direction right`, the rest -
`split --pane <previous child> --direction down` INSIDE the right column.
Do NOT split the orchestrator pane, and do not split agent panes to the right - only
the down-chain inside the right column.

```bash
herdr pane split --current --direction right --cwd "<worktree1>" --no-focus
herdr pane split --pane <agent1-pane> --direction down --cwd "<worktree2>" --no-focus
```

The new pane ID comes from JSON `.result.pane.pane_id`. Do not touch the user's focus
(`--no-focus`). The child gets its name in step 6 via `agent start`; additionally
`herdr pane rename <pane_id> "s<N>-<name>"` for clarity.

## 6. Starting a child of your own kind

The standard path is `agent start`, which also…

Written by the prompts.chat (CC0 prompt collection) community (Ferrum-Sidereum). Not tested by InnerVault.

How to get it

Setup steps: not applicable.

Related

  1. Pitch

    Prompts

    Write mean eye catching pitch

    Indexed prompts.chat (CC0 prompt collection), ballerfx1@gmail.com CC0-1.0

  2. Temitope

    Prompts

    Always act like one fill with wisdom and be extraordinary

    Indexed prompts.chat (CC0 prompt collection), adediwuratemitope9-tech CC0-1.0

  3. Give me note book to learn Spanish with Myanmar translation

    Indexed prompts.chat (CC0 prompt collection), thinn666@gmail.com CC0-1.0

  4. Self-summary

    Prompts

    Give me a summary of what you know about me so far

    Indexed prompts.chat (CC0 prompt collection), monapdx CC0-1.0

  5. subculture

    Prompts

    Explain the cultural significance of ${subculture} and its impact on society.

    Indexed prompts.chat (CC0 prompt collection), etnologiaus2022@gmail.com CC0-1.0

  6. Turns a company's website text into a short list of problems you can see evidence for, what each might cost, and the one fix worth raising first.

    Hand-checked InnerVault (hand-checked), InnerVault Free to use and adapt