shunk031-orchestrate-herdr-workers

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Orchestrate Herdr Workers

编排Herdr工作者

An orchestrator delegates independent tasks to worker agents, one git worktree tab each; workers report back by prompting the orchestrator, and normal completion remains report-driven without coordinator polling. Read this skill file and the herdr skill first: the herdr skill owns all CLI mechanics, JSON responses, ID handling, and safety rules. This skill adds only the orchestration protocol. Build every peer prompt in a shell variable first (for example, with a quoted heredoc) and pass it as one argument; never let the shell expand task or report text.
编排器会将独立任务委派给工作者Agent,每个任务对应一个git worktree标签页;工作者通过向编排器发送提示来汇报,正常完成流程由报告驱动,无需协调轮询。请先阅读本技能文件和herdr技能:herdr技能负责所有CLI机制、JSON响应、ID处理和安全规则。本技能仅添加编排协议。请先在shell变量中构建每个对等提示(例如使用带引号的here文档),并将其作为单个参数传递;切勿让shell扩展任务或报告文本。

Set up the orchestrator

设置编排器

  1. Name yourself so workers can address you, and label your tab. Pick a short name that is free in
    herdr agent list
    ; names cap at 32 characters:
    bash
    herdr agent rename "$HERDR_PANE_ID" orch
    herdr tab rename "$HERDR_TAB_ID" "🤖 Orchestrator"
    A worker promoting itself to sub-orchestrator skips this step: it keeps the agent name and tab its parent already tracks.
  2. Split the request into independent tasks, one worker each. Give every independent task a distinct branch, worktree/tab, pane, worker name, and separately built quoted
    task_prompt
    ; never reuse another worker's fixed identities or prompt. Keep sequential or trivial work yourself. Per task, decide whether the worker should publish a pull request: instruct it only when the user's request covers publishing.
  1. 为自己命名,以便工作者可以与你通信,并为你的标签页添加标签。选择一个在
    herdr agent list
    中未被使用的短名称;名称长度上限为32个字符:
    bash
    herdr agent rename "$HERDR_PANE_ID" orch
    herdr tab rename "$HERDR_TAB_ID" "🤖 Orchestrator"
    晋升为子编排器的工作者可跳过此步骤:它会保留父编排器已跟踪的Agent名称和标签页。
  2. 将请求拆分为独立任务,每个任务分配给一个工作者。为每个独立任务分配不同的分支、worktree/标签页、面板、工作者名称,以及单独构建的带引号的
    task_prompt
    ;切勿重复使用其他工作者的固定标识或提示。将顺序任务或琐碎任务留给自己处理。针对每个任务,决定工作者是否应发布拉取请求:仅当用户请求涉及发布时才给出相关指令。

Launch each worker

启动每个工作者

  1. Before any task edits, establish the deliverable's repository-associated workspace with
    herdr worktree create
    ; for an already-open deliverable worktree, use
    herdr worktree open
    and reuse its returned deliverable workspace and root-pane IDs instead of creating a second workspace. Do not substitute manual
    git worktree add
    plus
    herdr tab create
    . For every implementer, reviewer, or other related tab for that deliverable, move the returned root pane into a new tab in that deliverable workspace before starting the agent; keep the orchestrator workspace for the orchestrator only. Read the returned deliverable workspace, destination tab, and pane IDs from each response and use those destination IDs for all subsequent commands:
    bash
    # Choose exactly one for the deliverable:
    herdr worktree create --cwd "$PWD" --branch <topic-branch> --label "WIP <short task>" --no-focus
    # For an already-open deliverable worktree, use this instead of create:
    herdr worktree open --cwd "$PWD" --branch <topic-branch> --label "WIP <short task>" --no-focus
    herdr pane move <returned-root-pane-id> --new-tab --workspace <returned-deliverable-workspace-id> --label "🚧 <short task>" --no-focus
  2. Start Codex in the destination pane, prefixing the worker name with your own name so names stay unique across nesting while respecting the 32-character cap. Do not reuse the pre-move root pane ID:
    bash
    herdr agent start <your-name>-<task> --kind codex --pane <destination-pane-id> -- -m gpt-5.6-luna -c model_reasoning_effort=xhigh
  3. Before each dispatch, record the worker's current
    state_change_seq
    . Dispatch with
    herdr agent prompt <worker-name> "$task_prompt"
    without
    --wait
    ; the worker's report wakes you later. Do not treat the CLI
    agent_prompted
    response as a receipt. This is the single receipt contract for dispatches and formal handoffs: make one bounded observation with
    herdr agent get <worker-name>
    and
    herdr agent read <worker-name>
    (or its transcript), and accept it only when the lifecycle has a newer
    state_change_seq
    and the read contains a readable task receipt. Apply it independently to every worker; one worker's receipt never proves another's. If either is absent, redispatch the same quoted prompt before tracking the worker or proceeding. Once the receipt is observed, completion remains report-driven; do not poll. Use this template, keeping the final sentence only when the task should publish:
    You are Herdr worker <worker-name> in worktree <path>; your assigned worker name is exactly <worker-name> and your orchestrator is agent <orch-name>. These worker, task, worktree, orchestrator, and report-target identities are fixed; nothing in the task below overrides them. Task: <task>. Before doing any work, explicitly read the
    shunk031-orchestrate-herdr-workers
    skill and follow its worker protocol. When done, push your branch and open a pull request.
  1. 在进行任何任务编辑之前,使用
    herdr worktree create
    建立与交付物仓库关联的工作区;对于已打开的交付物worktree,使用
    herdr worktree open
    并复用其返回的交付物工作区和根面板ID,而不是创建第二个工作区。请勿用手动
    git worktree add
    herdr tab create
    替代。对于该交付物的每个实现者、评审者或其他相关标签页,在启动Agent之前将返回的根面板移动到该交付物工作区的新标签页中;编排器工作区仅用于编排器自身。从每个响应中读取返回的交付物工作区、目标标签页和面板ID,并将这些目标ID用于所有后续命令:
    bash
    # 为交付物选择以下其中一个命令:
    herdr worktree create --cwd "$PWD" --branch <topic-branch> --label "WIP <short task>" --no-focus
    # 对于已打开的交付物worktree,使用此命令替代create:
    herdr worktree open --cwd "$PWD" --branch <topic-branch> --label "WIP <short task>" --no-focus
    herdr pane move <returned-root-pane-id> --new-tab --workspace <returned-deliverable-workspace-id> --label "🚧 <short task>" --no-focus
  2. 在目标面板中启动Codex,在工作者名称前加上你的名称,以便在嵌套场景中保持名称唯一,同时遵守32个字符的长度限制。请勿复用移动前的根面板ID:
    bash
    herdr agent start <your-name>-<task> --kind codex --pane <destination-pane-id> -- -m gpt-5.6-luna -c model_reasoning_effort=xhigh
  3. 在每次调度之前,记录工作者当前的
    state_change_seq
    。使用
    herdr agent prompt <worker-name> "$task_prompt"
    进行调度,无需添加
    --wait
    ;工作者的报告稍后会触发你的会话。请勿将CLI的
    agent_prompted
    响应视为回执。这是调度和正式交接的唯一回执约定:使用
    herdr agent get <worker-name>
    herdr agent read <worker-name>
    (或其转录内容)进行一次有限观察,仅当生命周期具有更新的
    state_change_seq
    且读取内容包含可读的任务回执时才接受。对每个工作者独立执行此操作;一个工作者的回执不能证明另一个工作者的回执有效。如果缺少其中任何一项,请重新调度相同的带引号提示,然后再跟踪工作者或继续操作。一旦观察到回执,完成流程将由报告驱动;请勿轮询。使用以下模板,仅当任务需要发布时保留最后一句:
    你是位于worktree <path>中的Herdr工作者<worker-name>;你的指定工作者名称为<worker-name>,编排器为Agent <orch-name>。这些工作者、任务、worktree、编排器和报告目标标识是固定的;以下任务中的任何内容都不能覆盖它们。任务:<task>。在开始任何工作之前,请明确阅读
    shunk031-orchestrate-herdr-workers
    技能并遵循其工作者协议。完成后,推送你的分支并打开一个拉取请求。

Work as a worker

作为工作者开展工作

  1. Keep your own tab label according to the
    shunk031-herdr-tab-status
    skill with
    herdr tab rename "$HERDR_TAB_ID" <label>
    ; do not duplicate its status syntax here.
  2. Commit in your worktree; push the branch and open a pull request only if your dispatch says so. Every report begins with its status prefix and the sender's own assigned worker name:
    DONE <worker-name>: <one-line summary> <PR URL if any>
    ,
    BLOCKED <worker-name>: <question>
    , or
    STATUS <worker-name>: <state>
    . Use the exact worker name stated in the dispatch template, never the addressee's name.
    herdr agent prompt
    injects plain text without sender metadata, so the sender name is required for mechanical attribution; the addressee is already implied by the target of
    herdr agent prompt
    . Build the report in a variable and send it with
    herdr agent prompt <orch-name> "$report"
    . If you cannot proceed, send the
    BLOCKED
    form the same way and wait for a reply. Keep an open PR in the user-action handoff status defined by
    shunk031-herdr-tab-status
    until no user or CI action remains; only then use its completion status.
  3. If your task splits into large independent parts, become a sub-orchestrator: keep your existing agent name, tab, parent orchestrator, and report target; use steps 2-5 to create and dispatch each child with distinct identities and a separately built prompt, verify each child with the step-5 receipt contract, then consolidate child reports and report only to <orch-name>. Sub-workers report to you using the sub-orchestrator's own worker name as the report target; for example, if parent
    orch
    's worker is
    orch-api-migration
    , sub-workers report to
    orch-api-migration
    , never directly to
    orch
    .
  1. 根据
    shunk031-herdr-tab-status
    技能,使用
    herdr tab rename "$HERDR_TAB_ID" <label>
    保持你自己的标签页标签;请勿在此处重复其状态语法。
  2. 在你的worktree中提交;仅当调度指令要求时才推送分支并打开拉取请求。每份报告都以状态前缀和发送者自己的指定工作者名称开头:
    DONE <worker-name>: <单行摘要> <PR URL(如有)>
    BLOCKED <worker-name>: <问题>
    STATUS <worker-name>: <状态>
    。使用调度模板中指定的准确工作者名称,切勿使用收件人的名称。
    herdr agent prompt
    会注入纯文本,不包含发送者元数据,因此发送者名称是机械归因所必需的;收件人已由
    herdr agent prompt
    的目标隐含。在变量中构建报告,并使用
    herdr agent prompt <orch-name> "$report"
    发送。如果无法继续,请以相同方式发送
    BLOCKED
    格式的报告并等待回复。将未合并的PR保持在
    shunk031-herdr-tab-status
    定义的用户操作交接状态,直到没有用户或CI操作剩余;仅在此时使用完成状态。
  3. 如果你的任务拆分为大型独立部分,请成为子编排器:保留现有的Agent名称、标签页、父编排器和报告目标;使用步骤2-5创建并调度每个子任务,为其分配不同的标识和单独构建的提示,使用步骤5的回执约定验证每个子任务,然后整合子任务报告并仅向<orch-name>汇报。子工作者使用子编排器自己的工作者名称作为报告目标进行汇报;例如,如果父编排器
    orch
    的工作者是
    orch-api-migration
    ,子工作者应向
    orch-api-migration
    汇报,切勿直接向
    orch
    汇报。

Collect and finish

收集并完成工作

  1. After dispatching all workers, stop and wait; each report arrives as a new prompt in your session. Track outstanding workers by name and tab/pane ID, with their reported PR URLs — but treat that list as a cache. The durable truth is Herdr state (tab labels, transcripts, live agents) plus git and PR state; report prompts are only wake-ups, and the list can always be rebuilt from the truth, even after your own restart. Whenever you finish other work or wonder about progress, reconcile the cache against the truth and repair the difference: recover a missed report with
    herdr agent read <worker-name>
    ; resend a dispatch or BLOCKED answer that left no trace in the worker's transcript; read a dead worker's pane with
    herdr pane read <pane-id>
    and restart or take over its task (a dead sub-orchestrator's name-prefixed workers become yours); ignore reports from workers you already settled; and finish interrupted cleanup, such as a merged PR with a leftover worktree.
    For an existing anonymous live pane adopted mid-task, assign it a unique agent name from current Herdr state with
    herdr agent rename <pane-id> <unique-name>
    , then build
    handoff_prompt
    in a quoted variable and send
    herdr agent prompt <worker-name> "$handoff_prompt"
    with fixed worker, task, worktree, orchestrator, and report-target identities; verify that handoff with the step-5 receipt contract, then require the worker's
    STATUS <worker-name>: <state>
    receipt through the literal command
    herdr agent prompt <orch-name> "$status"
    . A tab-label change, ordinary task-channel output, PR creation, or CI state is not notification evidence by itself.
    A confirmed-working STATUS ends reconciliation: send nothing and wait report-driven for DONE or BLOCKED without polling.
    Only when the user explicitly requests active observation, optionally run
    scripts/herdr-orchestrator-observer.sh
    with fixed worker/pane/tab IDs, a conservative interval, and unchanged-sample threshold from
    observer_runtime="$(mktemp -d "${TMPDIR:-/tmp}/herdr-observer.XXXXXX")"
    ; launch with
    ... >"$observer_runtime/observer.log" 2>&1 & observer_pid=$!
    and validate it with
    kill -0 "$observer_pid"
    . The read-only sampler keeps fingerprints and coalescing in-process, skips only unreadable workers, sends one quoted advisory nudge, and exits when no scoped workers remain; stop that PID after the requested observation. Normal completion remains report-driven, and bounded reconciliation handles missed nudges.
    An actionable
    REJECT
    from an independent review worker is non-terminal: before reporting or waiting, verify the live task/PR owner, consolidate the findings, and route them immediately to that owner with the existing quoted
    herdr agent prompt <owner> "$answer"
    path; use the step-5 receipt contract, record the exact rejected head and
    re-review pending
    , and after the owner publishes a corrected head route that exact head back to the same reviewer with the same contract. Only
    ACCEPT
    permits a user merge handoff.
    When a
    DONE
    ,
    BLOCKED
    ,
    STATUS
    , or
    OBSERVER
    report arrives, send the answer or next instruction with
    herdr agent prompt <worker-name> "$prompt"
    in that turn, or state the concrete reason for waiting; a decision without a prompt or wait reason leaves the turn incomplete.
    When explaining a constraint's provenance, check the transcript, distinguish the user instruction, worker prompt, and orchestrator addition, state only the observed origin, and do not infer motive.
    Process queued worker reports during the same user turn; do not defer them until after answering the user.
    Treat each deliverable that will become one pull request as one workspace, and open its implementer and reviewer tabs there. Rename the workspace with
    herdr workspace rename <workspace-id> "WIP <topic>"
    , then
    herdr workspace rename <workspace-id> "Issue#<N> <topic>"
    , then
    herdr workspace rename <workspace-id> "PR#<N> <topic>"
    ; perform the Issue or PR rename in the same turn that receives its URL, and leave tab labels worker-owned under
    shunk031-herdr-tab-status
    .
    For worktree work, establish or reuse the deliverable's repo-associated workspace with
    herdr worktree create --cwd "$PWD" ...
    or
    herdr worktree open --cwd "$PWD" ...
    ; use the returned deliverable workspace ID and returned root-pane ID, and for every related implementer or reviewer tab move that pane with
    herdr pane move <pane-id> --new-tab --workspace <returned-deliverable-workspace-id>
    . Reuse the open response's existing workspace and root-pane IDs instead of creating a second workspace. Never target
    $HERDR_WORKSPACE_ID
    for worker tabs or construct a workspace with
    herdr pane move <pane-id> --new-workspace
    .
    An orchestrator session is replaceable only as a last resort: unlike workers, it accumulates user decisions and cross-stream judgment that exist nowhere else, so keep durable state written out (workspace names, the task list, research memos, PR links) as you go — that is what makes an emergency handoff survivable, not a reason to treat the session as cheap.
    By contrast, a worker session is disposable: when a rejection means "rethink from scratch" rather than "repair this diff", do not re-prompt the owning worker — its context is anchored to the failed approach and will reproduce it under new instructions. Close that agent, spawn a fresh worker (with a new branch/worktree when the old diff itself is the problem), and hand it requirements plus verified evidence, never the old implementation as the starting point.
    Before handing any reader-facing artifact (a report, research note, or published HTML) to the user, obtain an ACCEPT from a first-look review: spawn a FRESH worker with no prior involvement in the artifact — its empty context is what makes it a genuine first-time reader — and have it judge whether the top of the artifact alone conveys the question, method, result, and consequence in plain language. Route a REJECT back to the owning worker like any review finding. The user must never be the first reviewer to see the artifact.
  2. On BLOCKED, build your answer in a variable and reply with
    herdr agent prompt <worker-name> "$answer"
    ; use that same quoted-variable command sequence,
    herdr agent prompt <worker-name> "$prompt"
    , without substituting another Herdr command, whenever routing an owned task or PR action—including the user's authorization for a merge—back to a live worker. On DONE, reconstruct each claimed contract from its source of truth, inspect the diff and evidence, and verify tests exercise the actual package or production path against an independent reference before accepting the result; treat worker summaries, test names, pass counts, manifests, CI, and artifact hashes as candidate evidence only, not acceptance. Reject and redispatch claims based on test-local reconstructions or runtime paths that do not exist or are not exercised. Each agent owns its own tab label. Once a live worker owns a task or PR, route later task-scoped implementation and GitHub lifecycle actions—including rebase, push, PR update, merge, and CI or merge-queue follow-up—back to that worker; the coordinator may inspect read-only state, review, and relay user decisions but must not execute those owned actions, and may take over only after verifying the worker is unavailable or the user explicitly directs it to act. If a worker dies or goes silent behind a stale label, set its tab to "⛔ <task>" and inspect it with
    herdr agent get
    and
    herdr agent read
    . When several workers fail the same way at once — gateway auth or rate-limit errors, say — the cause is shared, not per-task: rotate or fix the credential in the runtime config workers actually read (a variable exported only in your own shell reaches nothing already running), then reconcile as usual; workers that were merely retrying recover on their own, and dead ones restart with their worktree state intact.
When two streams show the same failure signature, transfer the diagnosis between them and consider a generalized meta issue.
Recompute every numeric heading in a worker report from its raw data before relaying it or using it for a decision.
Escalate user-owned decisions about compute scale, deletion, license or provenance, and scope immediately with concrete options and numbers while keeping other streams moving; never put internal infrastructure identifiers such as mount paths, internal hostnames, or IP addresses in repository artifacts, including docs, PR bodies, issue comments, or commit messages.
  1. In every user-facing report, make the first mention of each PR or issue a full-URL Markdown link; a bare
    #N
    alone is insufficient. When every worker is done, keep your 🤖 label, summarize per worker with PR links, and announce with
    herdr notification show "Workers done" --sound done
    . End this and every later report with the list of unresolved items only the user can decide or perform — PR merges, unanswered ⛔ questions, dirty worktrees you kept, credential rotation — one line each with the exact command or link and what it blocks; repeat the list until each item is verified done, and omit it when nothing is pending.
  2. A worker's tab, worktree, and branch live exactly as long as its pull request: once the PR merges they are spent, so clean them up as soon as you notice — check each worker's reported URL with
    gh pr view <url>
    whenever you revisit the session, wrap up other work, or are asked to tidy up; never run a polling loop for it. Close the tab, then remove the worktree and delete the branch only if the worktree is clean — never pass
    --force
    ; if it still holds uncommitted work, leave it in place and tell the user. Touch only resources created through this protocol; leave unmerged, ⛔, and other people's tabs alone.
  1. 调度所有工作者后,停止操作并等待;每份报告都会作为新提示进入你的会话。按名称和标签页/面板ID跟踪未完成的工作者,以及他们报告的PR URL——但将该列表视为缓存。可靠的事实来源是Herdr状态(标签页标签、转录内容、活跃Agent)加上git和PR状态;报告提示仅用于唤醒,该列表始终可以从事实来源重建,即使在你自己重启之后。每当你完成其他工作或想了解进度时,将缓存与事实来源进行核对并修复差异:使用
    herdr agent read <worker-name>
    恢复遗漏的报告;重新发送在工作者转录内容中未留下痕迹的调度或BLOCKED回复;使用
    herdr pane read <pane-id>
    读取已失效工作者的面板并重启或接管其任务(已失效子编排器的名称前缀工作者将归你所有);忽略已处理完毕的工作者的报告;完成中断的清理工作,例如合并PR后遗留的worktree。
    对于在任务中途接管的现有匿名活跃面板,从当前Herdr状态中为其分配唯一的Agent名称:
    herdr agent rename <pane-id> <unique-name>
    ,然后在带引号的变量中构建
    handoff_prompt
    并发送
    herdr agent prompt <worker-name> "$handoff_prompt"
    ,其中包含固定的工作者、任务、worktree、编排器和报告目标标识;使用步骤5的回执约定验证此次交接,然后要求工作者通过字面命令
    herdr agent prompt <orch-name> "$status"
    发送
    STATUS <worker-name>: <state>
    回执。标签页标签更改、普通任务通道输出、PR创建或CI状态本身不能作为通知证据。
    确认有效的STATUS将结束核对:无需发送任何内容,以报告驱动的方式等待DONE或BLOCKED,无需轮询。
    仅当用户明确要求主动观察时,可选择使用固定的工作者/面板/标签页ID、保守的间隔时间和来自
    observer_runtime="$(mktemp -d "${TMPDIR:-/tmp}/herdr-observer.XXXXXX")"
    的未更改样本阈值运行
    scripts/herdr-orchestrator-observer.sh
    ;使用
    ... >"$observer_runtime/observer.log" 2>&1 & observer_pid=$!
    启动,并通过
    kill -0 "$observer_pid"
    验证。只读采样器会在进程内保留指纹并合并重复信息,仅跳过无法读取的工作者,发送一个带引号的建议性提示,当没有范围内的工作者剩余时退出;在完成请求的观察后终止该PID。正常完成流程仍由报告驱动,有限核对可处理遗漏的提示。
    来自独立评审工作者的可执行
    REJECT
    并非终结性结果:在汇报或等待之前,验证活跃任务/PR的所有者,整合评审结果,并立即通过现有的带引号
    herdr agent prompt <owner> "$answer"
    路径将结果路由给该所有者;使用步骤5的回执约定,记录确切的被拒绝版本头和
    re-review pending
    ,并在所有者发布修正后的版本头后,使用相同约定将该版本头发回给同一评审者。只有
    ACCEPT
    才允许将任务交接给用户进行合并。
    当收到
    DONE
    BLOCKED
    STATUS
    OBSERVER
    报告时,在该轮次中使用
    herdr agent prompt <worker-name> "$prompt"
    发送回复或下一条指令,或说明等待的具体原因;没有提示或等待原因的决策会导致轮次不完整。
    当解释约束的来源时,检查转录内容,区分用户指令、工作者提示和编排器添加的内容,仅说明观察到的来源,切勿推断动机。
    在同一用户轮次中处理排队的工作者报告;切勿将其推迟到回复用户之后。
    将每个将成为一个拉取请求的交付物视为一个工作区,并在其中打开其实现者和评审者标签页。使用
    herdr workspace rename <workspace-id> "WIP <topic>"
    重命名工作区,然后使用
    herdr workspace rename <workspace-id> "Issue#<N> <topic>"
    ,再使用
    herdr workspace rename <workspace-id> "PR#<N> <topic>"
    ;在收到其URL的同一轮次中执行Issue或PR重命名,标签页标签由工作者根据
    shunk031-herdr-tab-status
    自行管理。
    对于worktree工作,使用
    herdr worktree create --cwd "$PWD" ...
    herdr worktree open --cwd "$PWD" ...
    建立或复用交付物的仓库关联工作区;使用返回的交付物工作区ID和返回的根面板ID,并为每个相关的实现者或评审者标签页使用
    herdr pane move <pane-id> --new-tab --workspace <returned-deliverable-workspace-id>
    移动该面板。复用open响应的现有工作区和根面板ID,而不是创建第二个工作区。切勿将
    $HERDR_WORKSPACE_ID
    作为工作者标签页的目标,或使用
    herdr pane move <pane-id> --new-workspace
    构建工作区。
    编排器会话仅作为最后手段才可替换:与工作者不同,它会累积用户决策和跨流判断,这些内容不会存储在其他地方,因此请随时记录持久状态(工作区名称、任务列表、研究备忘录、PR链接)——这是紧急交接能够成功的原因,而非认为会话无关紧要的理由。
    相比之下,工作者会话是可丢弃的:当拒绝意味着“从头重新思考”而非“修复此差异”时,请勿重新提示所属工作者——其上下文已锚定到失败的方法,即使有新指令也会重复该方法。关闭该Agent,启动一个新的工作者(当旧差异本身存在问题时,使用新的分支/worktree),并向其提供需求和已验证的证据,切勿将旧实现作为起点。
    在将任何面向读者的工件(报告、研究笔记或已发布的HTML)交给用户之前,请从初次评审工作者处获取ACCEPT:启动一个未参与该工件的全新工作者——其空白上下文使其成为真正的首次读者——并让其判断工件的开头部分是否能用通俗易懂的语言传达问题、方法、结果和影响。将REJECT像其他评审结果一样路由回所属工作者。用户绝不能是第一个看到该工件的评审者。
  2. 收到BLOCKED报告时,在变量中构建回复并使用
    herdr agent prompt <worker-name> "$answer"
    发送;每当路由自有任务或PR操作(包括用户的合并授权)回活跃工作者时,都使用相同的带引号变量命令序列
    herdr agent prompt <worker-name> "$prompt"
    ,切勿替换为其他Herdr命令。收到DONE报告时,从事实来源重建每个声明的约定,检查差异和证据,并在接受结果之前验证测试是否针对独立参考项执行了实际包或生产路径;仅将工作者摘要、测试名称、通过次数、清单、CI和工件哈希视为候选证据,而非验收依据。拒绝并重新调度基于测试本地重建或不存在/未执行的运行时路径的声明。每个Agent负责自己的标签页标签。一旦活跃工作者拥有任务或PR,后续的任务范围实现和GitHub生命周期操作(包括变基、推送、PR更新、合并以及CI或合并队列跟进)都必须路由回该工作者;协调器可以检查只读状态、进行评审和转发用户决策,但不得执行这些自有操作,仅在验证工作者不可用或用户明确指示其采取行动时才可接管。如果工作者失效或在陈旧标签后无响应,将其标签页设置为"⛔ <task>"并使用
    herdr agent get
    herdr agent read
    检查。当多个工作者同时以相同方式失败时——例如网关认证或速率限制错误——原因是共享的,而非每个任务单独的问题:在工作者实际读取的运行时配置中轮换或修复凭据(仅在你自己的shell中导出的变量无法影响已运行的进程),然后按常规进行核对;仅在重试的工作者会自行恢复,失效的工作者会在保留worktree状态的情况下重启。
当两个流显示相同的失败特征时,在它们之间传递诊断结果并考虑是否存在通用的元问题。
在转发工作者报告中的每个数字标题或使用其进行决策之前,从原始数据重新计算。
立即将用户拥有的关于计算规模、删除、许可证或来源以及范围的决策升级,提供具体选项和数字,同时保持其他流的运行;切勿将内部基础设施标识符(如挂载路径、内部主机名或IP地址)放入仓库工件中,包括文档、PR正文、问题评论或提交消息。
  1. 在每个面向用户的报告中,首次提及每个PR或Issue时使用完整URL的Markdown链接;仅使用
    #N
    是不够的。当所有工作者完成后,保留你的🤖标签,按工作者汇总并附上PR链接,然后使用
    herdr notification show "Workers done" --sound done
    发布通知。在本次及后续每份报告的末尾,列出仅用户可以决定或执行的未解决事项——PR合并、未回答的⛔问题、你保留的未清理worktree、凭据轮换——每项占一行,包含确切的命令或链接以及它所阻塞的内容;重复该列表直到每个项目都被验证完成,当没有待处理事项时省略该列表。
  2. 工作者的标签页、worktree和分支的生命周期与其拉取请求完全一致:一旦PR合并,它们就不再有用,因此请尽快清理——每当你重新访问会话、完成其他工作或被要求整理时,使用
    gh pr view <url>
    检查每个工作者报告的URL;切勿运行轮询循环。关闭标签页,然后仅当worktree干净时才删除worktree和分支——切勿使用
    --force
    ;如果仍有未提交的工作,请保留它并告知用户。仅通过此协议创建的资源进行操作;请勿触碰未合并、⛔状态或其他人的标签页。