Logo Herdr Orchestration

Herdr Orchestration

Cộng đồng
pedronauck
herdr-orchestration

Điều phối các TUI worker Claude và Codex từ một tác nhân điều khiển — mỗi tab herdr được đặt tên có một worker, chạy qua CLI socket herdr.

Tổng quan

Nhà phát hànhpedronauck
Kho mãskills
Tên kỹ năngherdr-orchestration
Sao
635
Bản fork
89
Tệp đi kèm
2
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 2 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được pedronauck công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Herdr Orchestration trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/pedronauck/skills/tree/main/skills/mine/herdr-orchestration
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/pedronauck/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/mine/herdr-orchestration .claude/skills/herdr-orchestration
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Herdr Orchestration trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Herdr Orchestration ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Herdr Orchestration với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

herdr Orchestration

The top-level agent is the controller (Codex, Claude, Fable, or another); it delegates to worker TUIs that gather evidence, draft bounded patches, run tests, and report. The controller owns assignment, state, conflict control, verification, integration, and the final user-facing answer. herdr is the substrate: each worker TUI owns a named tab, and the socket CLI (herdr …) gives the controller placement, input, screen reads, and native agent-status waits.

One worker, one named tab

Every worker gets its own tab, labeled at creation with tab create --label. The tab bar is the controller's dashboard: a labeled tab says which model is running which slice, and stays readable no matter how many workers are live.

Tabs also cost no screen area. A split pane divides the caller's screen with every worker, and on a laptop the third worker leaves every pane too narrow to read. Split a pane only when the user explicitly asks to watch a worker beside the caller.

Two names per worker, both required at launch:

  • tab label — <model>: <slice>, e.g. opus: fix loops, codex: audit auth. Free text; keep it short, tab bars truncate.
  • agent name — the slice as a slug, e.g. fix-loops. Must match [a-z][a-z0-9_-]{0,31} and be unique among live agents. Every agent … verb accepts it in place of a pane id.

Workers are TUIs — no headless runners

A worker is an interactive TUI — claude or codex — started with herdr agent start, which validates the agent's identity and returns only once herdr sees it ready for input. herdr's agent-state integrations hook those TUIs, so agent wait, agent list, and blocked/done detection exist only while a real TUI is on screen.

Headless runners — claude -p, codex exec, anything that streams JSON events into a pane — never report state, so waits never fire and the delegation dies silently. A worker tab filling with raw JSON event lines is a broken delegation: interrupt it (rtk herdr pane send-keys <pane_id> ctrl+c) and relaunch through agent start.

Invariants

  • Scope every action to the caller workspace unless the user names another target.
  • Resolve caller context from HERDR_WORKSPACE_ID, HERDR_TAB_ID, and HERDR_PANE_ID (injected into every herdr pane) before any focused-window fallback.
  • Address workers by ids parsed from command JSON — agent name for agent … verbs, w2:t3 / w2:p4 for tab and pane verbs — never by guessed position.
  • Pass --no-focus on every creating verb (tab create, workspace create, worktree create, pane split); use focus verbs only when the user asks.
  • Retire every worker you launch when its assignment and planned integration follow-ups are finished (see Retire workers).

Preflight

Inspect the daemon, integrations, and caller context:

bash
rtk herdr status                 # server running + socket path
rtk herdr integration status     # selected worker runtime must show `current`
rtk herdr pane current --current # caller pane / tab / workspace ids
rtk herdr agent list             # agents already running

Check/install only the integration for each selected runtime. Reuse this preflight in the same workspace while the daemon and integrations are unchanged; a new packet alone does not require repeating it.

Launch workers

Use each worker runtime's configured model unless the user requests an override. Launch is two commands: create the named tab, then start the TUI in that tab's root pane.

bash
# 1. named tab — returns .result.tab.tab_id and .result.root_pane.pane_id
rtk herdr tab create --workspace "$HERDR_WORKSPACE_ID" --cwd "$PWD" \
  --label "opus: fix loops" --no-focus

# 2. worker TUI in that tab's root pane; native flags follow `--`
rtk herdr agent start fix-loops --kind claude --pane <root_pane_id> -- \
  --dangerously-skip-permissions "<packet>"

rtk herdr agent start audit-auth --kind codex --pane <root_pane_id> -- \
  --yolo

Capture tab_id, pane_id, and the agent name in the registry — retiring and screen reads need all three.

Claude always launches with --dangerously-skip-permissions and Codex with --yolo — workers run unattended and must not stall on permission prompts. Plan-first runs add Claude's --permission-mode plan; the flags compose (see Plan-first delegation).

agent start returns success only after herdr detects the agent ready, so a non-zero exit is the launch failure — read the tab's root pane (rtk herdr pane read <pane_id> --source visible) before retrying. Confirm the label stuck with rtk herdr tab list --workspace "$HERDR_WORKSPACE_ID"; if the tab shows a default label, restore it:

bash
rtk herdr tab rename <tab_id> "opus: fix loops"

Sending prompts to running TUIs

Prefer passing the initial packet as launch argv (shown above) — the session starts working immediately and skips the TUI-ready race. Exception: Codex plan-first launches bare (see Plan-first delegation).

For any follow-up, use agent prompt — it submits text plus Enter atomically, honoring the pane's live bracketed-paste mode, and --wait blocks until the worker settles:

bash
rtk herdr agent prompt fix-loops "<follow-up prompt>" --wait --timeout 300000

A trailing \n in pane send-text does not submit — a TUI renders it as a soft newline and the prompt sits unsubmitted. An unconfirmed send is not delivered: if --wait returns agent_prompt_stalled, the worker never changed state — read the screen and resend.

Plan-first delegation (opt-in)

Plan-first runs only when the user activates it — an explicit ask ("plan first", "plan mode") or a --plan-mode flag on the invocation. The default delegation is direct: launch and run hands-off. Investigation complexity alone does not add a planning approval step.

Once activated, the worker plans, the controller reviews and accepts, then it runs hands-off. The launch flags, shift+tab sequences, status checks, and acceptance menus are exact and differ per TUI. Read references/plan-mode.md in full before launching a plan-first worker.

Delegation packets

Send each worker prompt as a standalone contract. Include:

  • repo path and exact objective
  • worker role and model
  • execution mode: direct (default) or plan-first (user-activated)
  • files, packages, or surfaces in scope
  • files and behaviors explicitly out of scope
  • claimed files or work slice, to avoid conflicts
  • dependencies and the current interface/contract the worker can rely on
  • expected evidence needed for this claim: changed files, commands with results and checked inputs, relevant artifacts, and remaining uncertainty
  • verification ownership: worker checks, controller integration checks, and any final delivery checks owned by the enclosing workflow
  • stop conditions: unexpected code shape, repeated command failure, auth/model blocker, or need for out-of-scope edits

Assign coherent outcomes that can proceed independently. If a consumer depends on an unsettled interface, resolve that interface first or keep producer and consumer under one owner. File count alone is not a reason to split work. Tell workers they share the codebase, must preserve others' changes, and must report interface changes before dependent work proceeds. Reuse the same worker for related integration fixes; send the changed contract and remaining work instead of a fresh discovery assignment.

Worktree isolation

When workers must edit overlapping files in parallel, give each an isolated worktree — herdr manages them natively, as its own labeled workspace:

bash
rtk herdr worktree create --workspace "$HERDR_WORKSPACE_ID" \
  --branch <slug> --label "<slug>" --no-focus --json

Create the worker's tab inside that workspace (tab create --workspace <worktree_workspace_id>) so its cwd is the isolated checkout.

Track workers

Orchestrations are long-running — worker slices take minutes to hours, and a worker is never abandoned because a wait expired. Block on herdr's native agent status in check-in intervals of 3–5 minutes (sized to the slice — longer for heavier slices) instead of polling screens:

bash
rtk herdr agent wait fix-loops --until done --timeout 300000     # completion check-in
rtk herdr agent wait fix-loops --until blocked --timeout 300000  # question or menu
rtk herdr pane wait-output <pane_id> --match "<text>" --timeout 300000

Controller reads never mark a tab seen, so an unfocused worker settles as done, not idle — wait on done. --timeout is the check-in interval, never a deadline on the worker. On expiry, read the screen (rtk herdr agent read fix-loops --source recent-unwrapped --lines 120) and re-enter the wait — loop until the worker reaches a terminal state, asks a question, or a stop condition fires. When a reported status looks wrong, debug detection with rtk herdr agent explain <pane_id> --json.

Maintain a compact registry in the existing task notes or handoff: controller identity; worker agent name, tab label, role, model; workspace/tab/pane ids; objective sent and start time; status (starting, planning, plan-review, plan-accepted, running, blocked, reported, verified, retired); claimed files or work slice; worker-reported commands and results; controller verification performed; final disposition (accepted, rejected, superseded, or blocked).

Keep the tab label current as a slice changes, and announce milestones without stealing focus:

bash
rtk herdr tab rename <tab_id> "opus: fix loops (verifying)"
rtk herdr notification show "Workers done" --body "2/2 verified" --sound done

Verify worker output

Treat worker output as untrusted until verified. Monitor and verify without changing focus:

  • Read worker tabs read-only (agent read <name> --source recent-unwrapped --lines 200); ask a worker for a concise status summary when output is unclear.
  • Re-open cited files locally to verify high-impact findings. For visual output, open the delivered images and their named visual references side by side; file counts, dimensions, and a worker's verdict do not establish visual fit. Check one representative image before expanding an expensive generation batch.
  • Inspect command results, exit status, checked inputs, and evidence paths. Reuse trustworthy worker evidence for unchanged inputs; rerun missing, stale, contradictory, or unverifiable checks. The controller runs integration checks the worker did not cover, plus any checks required by project policy. A worker handoff alone does not invalidate evidence or require a second full suite.
  • Review the final diff before accepting any worker patch.
  • If a worker edits outside its claim, pause integration and decide: accept, request user-approved cleanup, or supersede with controller edits.

When --lines stops revealing more of a completed response, the TUI is on the terminal's alternate screen and those rows are gone. Ask the worker to write its full report as Markdown in a temp directory and reply with the path, then read the file.

Retire workers

A delegation ends with the worker retired — tab closed. Keep a reported worker available while reviewing or integrating its outcome when related follow-ups are expected. Retire it once the disposition is recorded and that work is done:

bash
rtk herdr tab close <tab_id>

Closing the tab ends the TUI session and its scrollback, so record what the registry needs first — report text, cited line refs, command output. Files, diffs, and worktrees survive on disk.

A worker stays open while mid-run, blocked, awaiting planned integration follow-ups, while its screen is evidence for an unresolved failure, or when the user asks to inspect it — record the reason in the registry. The orchestration is complete only when rtk herdr agent list shows none of this controller's workers still running: every worker retired, or its open tab justified in the registry.

Stop conditions

Stop and report instead of improvising when:

  • herdr rejects a valid workspace, tab, or pane ref, or rtk herdr status shows no running server.
  • a worker TUI rejects the model alias, auth state, working directory, or a startup flag — report the exact blocker, and get user approval before downgrading a model or switching tools.
  • authentication blocks the TUI.
  • a worker's status stays unknown while output scrolls and agent explain shows no matched rule — detection is broken or the pane is running a headless process.
  • a plan-mode status line or acceptance menu cannot be confirmed via agent read or pane wait-output, or a worker's plan stays out of scope after a re-planning round.
  • workers need overlapping edits the controller cannot integrate safely.
  • a task needs focus-changing herdr verbs the user has not approved.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Herdr Orchestration làm được gì?

Điều phối các TUI worker Claude và Codex từ một tác nhân điều khiển — mỗi tab herdr được đặt tên có một worker, chạy qua CLI socket herdr.

Vì sao nên dùng Herdr Orchestration trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Herdr Orchestration là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Herdr Orchestration trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/pedronauck/skills/tree/main/skills/mine/herdr-orchestration. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Herdr Orchestration?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Herdr Orchestration với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Herdr Orchestration với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Herdr Orchestration có miễn phí không?

Kỹ năng này được pedronauck phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇