一键导入
harn-orchestration
Use for Harn orchestration workflows, agent_loop usage, tool middleware, and handoff design.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for Harn orchestration workflows, agent_loop usage, tool middleware, and handoff design.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate, validate, preview, and run portable Harn workflow bundle JSON for monitoring and repairing pull requests, deploys, logs, and other event-driven engineering work. Optimized for smaller models (qwen, gemma, llama.cpp) with explicit XML sections, strict JSON output, and a validation-and-retry loop.
Use for Harn language syntax, typechecking, modules, imports, and idiomatic script authoring.
Use for autonomous Harn agent work, task decomposition, capability boundaries, and host interaction patterns.
Use for Harn provider setup, model routing, provider capability matrices, and llm_call options.
Run a cron eval pack, gate against prior ledger rows, and post Slack only on gate flips.
Demonstrates the same issue-triage handler behind local and remote A2A trigger manifests.
| name | harn-orchestration |
| short | Agent loops, tool middleware, handoffs, and orchestration patterns. |
| description | Use for Harn orchestration workflows, agent_loop usage, tool middleware, and handoff design. |
| when_to_use | Use when building or reviewing agent orchestration, persona handoffs, tool dispatch, or runtime control flow. |
Use this skill when designing or changing workflows that coordinate agents, tools, sessions, approvals, and host capabilities.
Pair it with [[harn-agent]] for autonomous execution and [[harn-tracing]] for transcript and replay contracts.
docs/llm/harn-quickref.md for agent_loop, llm_call, streams, and concurrency.docs/llm/harn-triggers-quickref.md for trigger manifests and route audits.crates/harn-vm/src/orchestration/.crates/harn-cli/src/commands/.llm_call = one request < agent_loop = one goal (one transcript,
run to completion) < workflow = more than one goal, attempt, or model.while around llm_call. A single goal that needs
several tool round-trips is agent_loop, not a hand-rolled loop.agent_preset(kind, options?) builds agent_loop options (fill-nil
packs) — it is NOT a tier. You still call agent_loop with its result.docs/src/concepts/abstraction-ladder.md (the placement
contract table names the canonical home for every cross-cutting mechanism).agent_loop drives iterative LLM/tool workflows.llm_call and llm_stream_call perform direct model calls.LlmCallOptions or llm_options({...}). The same
registry validates direct calls, streams, and agent dispatch. Use only
output, system, effort, speed, timeout_ms, and namespaced
provider_options; removed spellings are errors, not aliases.models: / ladder: on llm_call and agent_loop is a cheap-first
fallback that advances only on transport-class failures (429/5xx/timeout),
never on schema failures; named ladders resolve from catalog [model_ladders.*]
rows. It is mutually exclusive with explicit model:/routing:.agent_edit_tools(registry?, opts?) (std/agent/host_tools) is the canonical
default mutation toolset — write_file / edit_file / create_directory /
delete_path. Customize through the existing tool-middleware seams; do not
re-invent per-agent mutation tools.agent_spawn and handoffs should carry explicit session context.retry_policy: {max_attempts, feedback} turns a blind retry into a
repair loop; feedback: true threads the prior attempt's findings into the
next task. A repair_prompt_builder closure takes full control and receives
{task, attempt, findings, verification, error, prior_text, stage}.verify may be a closure returning a bool or
{ok, findings?}; a failing verdict forces the retry-eligible failed branch
and threads findings into the repair prompt.workflow_stages(spec) (std/workflow/patterns) is pure sugar for a linear
stage graph — byte-identical to the hand-authored {entry, nodes, edges}.workflow_run_repair(config) (std/workflow/repair) runs the one-node
run→validate→repair loop for you (owns no loop of its own).executor: { ctx -> ... } to workflow_run_repair
(or set executor on any stage node) to run a caller-supplied closure as the
stage leaf instead of spawning a delegated worker — the hook for a bespoke
in-process agent loop. The closure receives
{task, attempt, prior_findings, prior_verification, prior_text, artifacts}
and returns {result | text, artifacts?, transcript?, verification?}; verify,
retry, feedback threading, and sole-writer attempt recording run around it
unchanged. Omit it to keep the default delegated-worker leaf.std/llm/safe: strip_think_blocks,
strip_code_fences, extract_first_json_object, extract_first_json_value,
parse_first_json.Import the home module instead of re-deriving the behavior inline in a loop body:
std/agent/judge (agent_completion_gate).std/agent/governors (with_governance).std/agent/stall
(agent_stall_initial_state + agent_stall_observe_tool_calls).std/agent/lanes (lane_policy).std/agent/overlays (with_overlay;
overlay_policy is a deprecated alias).std/agent/autocompact (agent_autocompact_if_needed).std/agent/scratchpad.std/agent/presets (agent_preset);
the pack keys are budget, completion_gate, fallback_chain, lane_policy,
models, overlay_policy, provider, timeout_ms.llm_retries / llm_backoff_ms are gone — compose transport retry on the
caller seam with with_retry from std/llm/handlers, or let agent_preset
bake the default bounded retry. transcript_policy is gone — sessions are the
sole surface. See docs/src/migrations/v0.10.md.max_concurrent.cargo test -p harn-vm orchestration.cargo test -p harn-vm agent.cargo test -p harn-cli --test <test-name>.cargo run --quiet --bin harn -- check <path>.cargo run --quiet --bin harn -- test conformance --filter <name>.npm run portal:lint, portal:test, and portal:build.make test.make check-docs-snippets.