muse-delegate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Muse Delegate

Muse Delegate

You are the orchestrator. This skill lets you hand a bounded coding task to a separate implementer — Muse Code (
muse
) — then review what it produced and land it yourself. You write the brief and own the judgment; Muse does the typing in its own
exec
run; you verify and commit.
Nothing here is specific to one orchestrating agent. The loop needs only the ability to run a shell command and read a file, so any agent with those two capabilities can drive it. The full delegate → review → commit loop has been run with Claude Code as the orchestrator. Other orchestrators remain unproven.
你是 orchestrator。此 skill 让你将范围明确的编码任务交给独立的 implementer——Muse Code(
muse
)——然后审查其产出并自行提交落地。你负责编写 brief 并作出判断;Muse 在自己的
exec
run 中负责编码;你负责验证和提交。
这里没有针对某一种编排型 Agent 的特定要求。该循环只需要运行 shell 命令和读取文件的能力,因此任何具备这两项能力的 Agent 都可以驱动它。完整的委派 → 审查 → 提交流程已使用 Claude Code 作为 orchestrator 运行过;其他 orchestrators 尚未得到验证。

When NOT to use this

何时不要使用

  • The task is small enough to just do inline — delegation overhead is not worth it.
  • The
    muse
    CLI is not installed or not authenticated (run
    muse login
    , or set
    META_API_KEY
    ).
  • You want to write the code yourself.
  • You are on native Windows and need a supported launcher. Upstream's
    muse
    launcher is Darwin/Linux only; this skill still ships in the Windows contract matrix, but a live Windows dispatch is not a supported Muse install.
  • 任务足够小,可以直接 inline 完成——委派开销不值得。
  • 未安装
    muse
    CLI 或尚未认证(运行
    muse login
    ,或设置
    META_API_KEY
    )。
  • 你想自己编写代码。
  • 你使用原生 Windows 且需要受支持的 launcher。上游
    muse
    launcher 仅支持 Darwin/Linux;此 skill 仍包含在 Windows 支持矩阵中,但在 Windows 上实际调度并不是受支持的 Muse 安装方式。

Read this before the first dispatch: the autonomy model

首次调度前必读:自主权模型

Headless Muse is
muse exec
only
.
muse resume
is the interactive TUI and is never invoked.
--resume-last
is rejected; continue a run with
--session <id>
(Muse's
--session-id
).
Write runs keep Muse's sandbox on and pass
--disable-approval
so a headless run cannot hang on a tool-approval prompt. They also pass
--trust-workspace
and
--user-input-auto-resolve
. That is not
--yolo
and not
--full-access
— do not invent either as the default.
--trust-workspace
loads the target repo's rules and skills into the implementer run, and nothing in the relay narrows the implementer's tool set inside the sandbox; the brief is what bounds it to the task.
--read-only
adds
--disable-write
(non-shell filesystem writes) and
--disable-shell
. Approval stays disabled so the review cannot block on a prompt either.
--provider echo|meta
is a relay-only flag for tests and explicit probes. It is not a fleet dial.
无头模式下 Muse 仅支持
muse exec
。
muse resume
是交互式 TUI,绝不会被调用。禁止使用
--resume-last
;请使用
--session <id>
(Muse 的
--session-id
)继续运行。
写入型 run 会保持 Muse 的 sandbox 开启,并传入
--disable-approval
,防止无头运行卡在工具审批提示上。它们还会传入
--trust-workspace
和
--user-input-auto-resolve
。这并不等同于
--yolo
或
--full-access
——不要将二者杜撰为默认值。
--trust-workspace
会将目标仓库的规则和 skills 加载到 implementer run 中;relay 不会缩减 implementer 在 sandbox 内的工具集,真正将任务限定在指定范围内的是 brief。
--read-only
会添加
--disable-write
(禁止非 shell 文件系统写入)和
--disable-shell
。审批仍保持禁用,因此审查过程也不会被审批提示阻塞。
--provider echo|meta
是仅供 relay 使用的 flag,用于测试和显式探测,并不是用于切换 fleet 的开关。

Prerequisites (check once)

前置条件(检查一次)

  1. muse --version
    succeeds. If not, install Muse Code and run
    muse login
    (or export
    META_API_KEY
    ).
  2. Confirm which
    muse
    is on PATH.
    command -v muse
    shows the active launcher. The relay records the version it ran into
    result.json
    .
  3. You are in (or will point
    --cd
    at) the target git repository.
  1. muse --version
    执行成功。如果失败,请安装 Muse Code 并运行
    muse login
    (或导出
    META_API_KEY
    )。
  2. 确认 PATH 中使用的是哪个
    muse
    。
    command -v muse
    会显示当前生效的 launcher。relay 会将其运行的版本记录到
    result.json
    中。
  3. 你当前位于目标 Git 仓库中,或将通过
    --cd
    指向该仓库。

Choose the implementer model

选择 implementer 模型

Muse has a configured default model, so a fresh run may omit
--model
. Pass
--model
or a fleet
--lane
that sets one when you need to pin a catalog id. On a resumed
--session
run, omit
--model
to keep the session's model. If the human has not named a usable set, ask before guessing a metered id.
More depth: references/writing-the-brief.md.
Muse 已配置默认模型,因此全新 run 可以省略
--model
。需要锁定 catalog id 时,传入
--model
,或使用可设置模型的 fleet
--lane
。在恢复
--session
的 run 中,应省略
--model
,以保持该 session 的模型。如果人员没有指定可用模型集合,请在猜测按量计费 id 之前先询问。
更多信息:references/writing-the-brief.md。

The loop

循环

Run these five steps per task. Steps 1, 4, and 5 are your judgment; 2 and 3 are mechanical.
每项任务执行以下五个步骤。步骤 1、4 和 5 需要你作出判断;步骤 2 和 3 则是机械操作。

1. Write the brief

1. 编写 brief

Muse sees only the text you send plus what it can read from the working tree — no chat history, no shared context. Everything the task needs goes in the brief: the goal, the current state, what to change, what to leave untouched, the project's actual gate commands (discover them from the repo's AGENTS.md/CLAUDE.md/Makefile — do not assume), and a report contract. Tell Muse it will not commit (you will). Keep one task per brief. Full guidance and a template: references/writing-the-brief.md.
Muse 只能看到你发送的文本以及它能从工作树中读取的内容——没有聊天历史,也没有共享上下文。任务所需的一切都必须包含在 brief 中:目标、当前状态、需要修改的内容、需要保持不变的内容、项目的实际门禁命令(从仓库的 AGENTS.md/CLAUDE.md/Makefile 中发现这些命令——不要臆测),以及报告约定。告知 Muse 它不会提交代码(由你提交)。每份 brief 只处理一项任务。完整指南和模板: references/writing-the-brief.md。

2. Dispatch

2. 调度

Send the brief to Muse with the bundled helper. It wraps
muse exec --json --prompt-file
, captures the run, and writes a structured
result.json
. (
<skill-dir>
below is this skill's installed directory — the folder containing this
SKILL.md
.)
bash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
使用内置 helper 将 brief 发送给 Muse。它会封装
muse exec --json --prompt-file
、捕获此次 run,并写入结构化的
result.json
。(下文的
<skill-dir>
指的是此 skill 的安装目录,即包含
SKILL.md
的文件夹。)
bash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo

optional model: add --model <id>

optional model: add --model <id>

fleet lane from delegate-setup: add --lane <name> (dials apply; flags still win)

fleet lane from delegate-setup: add --lane <name> (dials apply; flags still win)

reasoning intensity: add --effort none|minimal|low|medium|high|xhigh|max|ultra

reasoning intensity: add --effort none|minimal|low|medium|high|xhigh|max|ultra

read-only (no non-shell writes, no shell): add --read-only

read-only (no non-shell writes, no shell): add --read-only

continue a specific Muse session: add --session <id> (delta brief only; no --resume-last)

continue a specific Muse session: add --session <id> (delta brief only; no --resume-last)

hard time limit (watchdog): add --timeout 2h (default: off; implementation runs routinely need 1-2h)

hard time limit (watchdog): add --timeout 2h (default: off; implementation runs routinely need 1-2h)

see all options: node .../relay.mjs --help

see all options: node .../relay.mjs --help


The helper writes artifacts to a temp dir, so the repo under review stays clean. It **never commits**
— see step 5. Mechanics, flags, and the `result.json` shape:
[references/dispatch-and-poll.md](references/dispatch-and-poll.md).

helper 会将 artifacts 写入临时目录,因此待审查的仓库保持干净。它**从不提交代码**——参见步骤 5。机制、flags 和 `result.json` 结构:
[references/dispatch-and-poll.md](references/dispatch-and-poll.md)。

3. Wait for completion

3. 等待完成

The helper blocks until Muse finishes, so back it with whatever your orchestrator offers and resume when it returns:
  • Claude Code: run the Bash call with
    run_in_background: true
    ; you are notified on completion.
  • Plain shell / other agents: run it in the foreground for short tasks, or background it and poll the result file. The run is done when
    result.json
    exists with a
    status
    . (A pre-run usage error — bad args or an empty brief — instead exits with code 2 and writes no result file, so check the exit code too. A missing
    muse
    binary exits 127 but does write a
    result.json
    with status
    muse_unavailable
    .
    --resume-last
    is a usage error: headless resume is
    --session <id>
    .)
Do not trust progress trackers over reality: a run is finished when
result.json
is written and the process has exited. Muse can exit 0 without a
run.terminal.completed
event; the relay reports that as
failed
, not
completed
. The implementer's full report is the
finalMessage
field in
result.json
(also printed in full on stdout between the report markers).
helper 会阻塞直到 Muse 完成,因此应利用 orchestrator 提供的能力将其放到后台执行,并在返回时继续后续流程:
  • Claude Code: 使用
    run_in_background: true
    运行 Bash 调用;完成后你会收到通知。
  • 普通 shell/其他 Agents: 短任务可在前台运行,也可以放到后台并轮询结果文件。当
    result.json
    存在且包含
    status
    时,run 即已完成。(如果运行前发生用法错误,例如参数无效或 brief 为空,则会以代码 2 退出且不会写入结果文件,因此也要检查退出码。缺少
    muse
    binary 时会以 127 退出,但会写入包含
    muse_unavailable
    状态的
    result.json
    。
    --resume-last
    属于用法错误:无头恢复应使用
    --session <id>
    。)
不要相信进度跟踪器而忽视实际状态:当
result.json
已写入且进程已退出时,run 才算完成。Muse 可能在没有
run.terminal.completed
事件的情况下以 0 退出;relay 会将其报告为
failed
,而不是
completed
。implementer 的完整报告位于
result.json
的
finalMessage
字段中(也会在 stdout 的报告标记之间完整打印)。

4. Review — do not trust the self-report

4. 审查——不要相信自我报告

Muse's
result.json
includes its own final message and any gate claims. Re-verify, don't accept:
  • Re-run the project's gates yourself (the test/lint/build commands from step 1). Never take "gates passed" on faith.
  • Read the diff against the brief: did Muse do what was asked, nothing more (scope creep) and nothing less?
    touchedFiles
    in the result is your starting point.
  • Run the relevant guard skills on the diff if you have them installed (clean-code-guard, test-guard, etc. from
    guard-skills
    ) — this skill produces the work; those skills judge it.
  • For schema/migration changes, round-trip them; for removals, grep for dangling references.
Full checklist: references/review-and-land.md.
Muse 的
result.json
包含它自己的最终消息和各项门禁声明。请重新验证,不要直接接受:
  • 亲自重新运行项目的门禁(步骤 1 中的测试、lint 和构建命令)。绝不要盲目相信“门禁已通过”。
  • 对照 brief 阅读 diff:Muse 是否完成了要求的内容,没有超出范围(scope creep),也没有遗漏任何内容?result 中的
    touchedFiles
    是你的起点。
  • 如果已安装相关 guard skills,请对 diff 运行这些 skills(来自
    guard-skills
    的 clean-code-guard、test-guard 等)——此 skill 负责产出工作,而这些 skills 负责评判工作。
  • 对于 schema 或 migration 变更,执行 round-trip 验证;对于删除操作,使用 grep 搜索悬空引用。
完整检查清单:references/review-and-land.md。

5. Land it

5. 落地

The implementer edits the working tree; the orchestrator commits. Committing should be the act of the party that verified the work. Only after the gates pass and the diff holds:
  • Commit the verified work yourself, with a clear message.
  • If it needs changes, send a delta brief with
    --session <id>
    (don't restate the whole task) and review again. There is no headless
    --resume-last
    .
implementer 会修改工作树;由 orchestrator 提交。 提交应当由实际验证过工作的一方完成。仅在门禁通过且 diff 经得起审查后执行:
  • 使用清晰的消息,亲自提交已验证的工作。
  • 如果还需要修改,请使用
    --session <id>
    发送 delta brief(不要重述整个任务),然后再次审查。无头模式不支持
    --resume-last
    。

Authorization model

授权模型

Delegation is something the human opts into. Once they have ("run this queue", "proceed"), committing verified, gate-passing work is the agreed contract — that is the whole point. Two limits on that mandate: surface, don't absorb (report Muse's design decisions, defensible-but-unasked turns, and non-blocking nitpicks rather than silently keeping them) and stop for scope changes (if correct completion needs going beyond the brief, ask — don't expand the mandate yourself). The full treatment is in references/review-and-land.md.
委派需要由人员主动选择。一旦人员选择“运行这个队列”或“继续”,提交经过验证且通过门禁的工作便成为双方约定的 contract——这正是该流程的核心所在。这项授权存在两项限制:如实披露,不要默默接受(报告 Muse 的设计决策、合理但未被要求的改动,以及不阻塞流程的小问题,而不是静默保留这些内容),以及遇到范围变更时停止(如果正确完成任务需要超出 brief 的范围,应先询问,不要自行扩大授权)。完整说明见 references/review-and-land.md。

References

参考资料

  • references/writing-the-brief.md — how to write a brief Muse can execute blind: structure, XML blocks, the report contract, embedding the real gate commands.
  • references/dispatch-and-poll.md —
    relay.mjs
    flags, the
    result.json
    contract, backgrounding per orchestrator, and recovery when a run misbehaves.
  • references/review-and-land.md — the review checklist, the commit boundary, and the rework cycle via
    --session
    .
  • references/multi-task-queues.md — running a sequential queue: carrying constraints forward, progress tracking, and the end-of-run coherence check.
  • references/writing-the-brief.md——如何编写一份 Muse 能在缺少共享上下文时执行的 brief:结构、XML blocks、报告约定,以及嵌入真实门禁命令。
  • references/dispatch-and-poll.md——
    relay.mjs
    flags、
    result.json
    约定、针对不同 orchestrator 的后台运行方式,以及 run 异常时的恢复方法。
  • references/review-and-land.md——审查清单、提交边界,以及通过
    --session
    进行返工修改的循环。
  • references/multi-task-queues.md——如何运行顺序任务队列:延续约束、跟踪进度,以及执行结束前的一致性检查。