omp-delegate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Oh My Pi Delegate

Oh My Pi 任务委托

You are the orchestrator. Delegate a bounded coding task to a separate implementer - Oh My Pi (
omp
) - then review what it produced and land it yourself. You write the brief and own the judgment; the implementer makes changes in its own session; you verify and commit.
The loop needs only a shell command and file access, so any comparable orchestrator can drive it.
你作为协调者,将一个边界明确的编码任务委托给独立的实现工具——Oh My Pi(
omp
),之后审核其产出并自行完成提交。你编写任务简报并负责判断;实现工具在独立会话中进行修改;你负责验证并提交。
该流程仅需Shell命令和文件访问权限,因此任何类似的协调工具都可以驱动它。

The binary is
omp
, not
pi

二进制工具是
omp
,而非
pi

Oh My Pi is a fork of Pi. This skill drives
omp
(
@oh-my-pi/pi-coding-agent
). The original Pi CLI is a different binary (
pi
) with a different skill (
pi-delegate
). If
omp
is missing but
pi
is installed, you have Pi, not Oh My Pi.
Oh My Pi是Pi的分支版本。此技能驱动的是**
omp
**(
@oh-my-pi/pi-coding-agent
)。原始Pi CLI是另一个不同的二进制工具(
pi
),对应不同的技能(
pi-delegate
)。如果
omp
未安装但
pi
已安装,说明你使用的是Pi,而非Oh My Pi。

When NOT to use this

请勿使用此技能的场景

  • The task is small enough to do inline; delegation overhead is not worth it.
  • The
    omp
    CLI is not installed or authenticated.
  • The user asked for the original Pi CLI (
    pi
    ) — use
    pi-delegate
    .
  • You need a sandboxed implementer. Oh My Pi has no sandbox.
    --read-only
    restricts the tool surface; a write-capable run executes without prompts (
    --yolo
    ).
  • 任务小到可以直接完成;委托的开销得不偿失。
  • omp
    CLI未安装或未完成身份验证。
  • 用户要求使用原始Pi CLI(
    pi
    )——请使用
    pi-delegate
  • 你需要沙箱化的实现工具。Oh My Pi没有沙箱。
    --read-only
    参数会限制工具可用范围;允许写入的运行会无提示执行(
    --yolo
    参数)。

Prerequisites (check once)

前置条件(只需检查一次)

  1. Install omp with
    bun install -g @oh-my-pi/pi-coding-agent
    (or the install path from https://omp.sh).
  2. Authenticate:
    /login
    inside omp for a subscription provider, or an API-key environment variable for an API-key provider. Credentials live under
    ~/.omp/
    .
  3. Confirm
    omp --version
    succeeds.
  4. Work in, or point
    --cd
    at, the target git repository.
  1. 使用
    bun install -g @oh-my-pi/pi-coding-agent
    安装omp(或从https://omp.sh获取安装路径)。
  2. 身份验证:在omp内执行
    /login
    以使用订阅提供商,或设置API密钥环境变量以使用API密钥提供商。凭据存储在
    ~/.omp/
    目录下。
  3. 确认
    omp --version
    命令执行成功。
  4. 在目标Git仓库中工作,或使用
    --cd
    参数指定目标Git仓库路径。

Choose the model (optional)

选择模型(可选)

Omit
--model
(and
--provider
) to use omp's configured default for this project / profile. The catalog is this install's authenticated providers — not a fixed list in this skill.
To pick another model:
  1. List what this install can actually run. Do not pass
    omp --list-models
    — that flag is gone and omp treats it as an unknown flag (exit 2). Use the
    models
    subcommand:
    • omp models
      — every available model, grouped by provider
    • omp models --json
      — the same catalog, machine-readable
    • omp models find <substring>
      — filter by provider, id, or name (example:
      omp models find sonnet
      )
    • omp models <provider>
      — one provider's models
  2. Pass that id to the relay.
    --model <pattern>
    is omp's own
    --model
    : a fuzzy match against the catalog (provider/id, a bare id, or a unique substring).
    --provider <name>
    pins the provider when the pattern is ambiguous.
  3. The relay forwards only letters, digits, and
    . _ : / -
    . Glob patterns with
    *
    are rejected.
--thinking <level>
is a separate reasoning dial, not a model id. Allowed values:
off
,
auto
,
minimal
,
low
,
medium
,
high
,
xhigh
,
max
. The relay rejects anything else (including
inherit
) before dispatch — omp would otherwise warn and ignore a bad value.
A fleet lane (
--lane
) can set
provider
,
model
, and
effort
. Lane
effort
becomes
--thinking
; an explicit
--thinking
/
--model
/
--provider
flag wins over the lane.
The relay does not forward
--api-key
,
--smol
,
--slow
, or
--plan
. Those stay omp's own CLI.
省略
--model
(和
--provider
)参数将使用omp为当前项目/配置文件设置的默认模型。模型目录是当前安装已认证的提供商列表——并非此技能中的固定列表。
如需选择其他模型:
  1. 查看当前安装可实际运行的模型。请勿执行
    omp --list-models
    ——该参数已移除,omp会将其视为未知参数(退出码2)。请使用
    models
    子命令:
    • omp models
      ——按提供商分组显示所有可用模型
    • omp models --json
      ——以机器可读的JSON格式显示相同的模型目录
    • omp models find <substring>
      ——按提供商、ID或名称过滤模型(示例:
      omp models find sonnet
    • omp models <provider>
      ——显示指定提供商的所有模型
  2. 将模型ID传递给中继工具
    --model <pattern>
    是omp自身的
    --model
    参数:对模型目录进行模糊匹配(提供商/ID、纯ID或唯一子字符串)。当匹配模式存在歧义时,使用
    --provider <name>
    参数锁定提供商。
  3. 中继工具仅转发字母、数字以及
    . _ : / -
    字符。包含
    *
    的通配符模式会被拒绝。
--thinking <level>
是一个独立的推理级别参数,而非模型ID。允许的值包括:
off
,
auto
,
minimal
,
low
,
medium
,
high
,
xhigh
,
max
。中继工具在调度前会拒绝其他任何值(包括
inherit
)——否则omp会发出警告并忽略无效值。
集群通道(
--lane
)可以设置
provider
model
effort
参数。通道的
effort
参数会映射为
--thinking
;显式设置的
--thinking
/
--model
/
--provider
参数优先级高于通道设置。
中继工具不会转发
--api-key
--smol
--slow
--plan
参数。这些参数属于omp自身的CLI参数。

The loop

流程步骤

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

1. Write the brief

1. 编写任务简报

Oh My Pi sees only the text you send plus what it can inspect in the workspace - no chat history or shared context. Include the goal, current state, what to change, what to leave untouched, the project's actual gates, and a report contract. Tell omp not to commit. Keep one task per brief. omp auto-loads
AGENTS.md
/
CLAUDE.md
context files from the workspace and its parents, so repo instructions reach it without inlining. See references/writing-the-brief.md.
Oh My Pi只能看到你发送的文本以及它在工作区中可检查的内容——没有聊天历史或共享上下文。简报需包含目标、当前状态、需要修改的内容、需要保留的内容、项目的实际准入标准以及报告约定。告知omp不要提交。每个简报对应一个任务。omp会自动加载工作区及其父目录中的
AGENTS.md
/
CLAUDE.md
上下文文件,因此仓库中的说明无需内联到简报中。详情请查看references/writing-the-brief.md

2. Dispatch

2. 调度任务

Use the bundled relay. It pipes the brief to
omp --mode json
on stdin, captures the JSON event stream, and writes
result.json
. (
<skill-dir>
is the installed folder containing this
SKILL.md
.)
bash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo
使用内置的中继工具。它会将简报通过标准输入传递给
omp --mode json
,捕获JSON事件流并写入
result.json
文件。(
<skill-dir>
是包含此
SKILL.md
文件的技能安装目录。)
bash
node "<skill-dir>/scripts/relay.mjs" --brief brief.txt --cd /path/to/repo

list models first: omp models (or: omp models --json)

先列出模型: omp models (或: omp models --json)

choose a model: add --model <id from omp models>

选择模型: 添加 --model <omp models中获取的ID>

choose a provider: add --provider <name>

选择提供商: 添加 --provider <名称>

set thinking level: add --thinking high

设置推理级别: 添加 --thinking high

read-only run (review/diagnosis): add --read-only

只读运行(审核/诊断): 添加 --read-only

trust project .omp resources: add --approve

信任项目的.omp资源: 添加 --approve

resume the most recent session: add --resume-last (delta brief only)

恢复最近的会话: 添加 --resume-last (仅需增量简报)

resume a specific session: add --session <id> (delta brief only)

恢复指定会话: 添加 --session <id> (仅需增量简报)

hard time limit (watchdog): add --timeout 2h (the 30m default suits short runs; implementation briefs routinely need 1-2h)

硬超时限制(监控): 添加 --timeout 2h (默认30分钟适合短任务;实现类简报通常需要1-2小时)

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

查看所有选项: node .../relay.mjs --help


The child process's cwd pins the workspace. The relay writes artifacts under the system temp dir
by default and never commits. See [references/dispatch-and-poll.md](references/dispatch-and-poll.md).

子进程的当前工作目录会固定为工作区。中继工具默认将产物写入系统临时目录,且绝不会自动提交。详情请查看[references/dispatch-and-poll.md](references/dispatch-and-poll.md)。

3. Wait for completion

3. 等待任务完成

The relay blocks until omp finishes. Run it with the orchestrator's background-command facility, or background it in the shell and poll for
result.json
. A pre-run usage error exits 2 and writes no result; a missing
omp
exits 127 and writes
status: "omp_unavailable"
.
Trust process state and the working tree over a progress display. Completion means the process exited and
result.json
exists. omp's full report is the
finalMessage
field in
result.json
(also printed in full on stdout between the report markers).
中继工具会阻塞直到omp完成任务。可以使用协调工具的后台命令功能运行它,或者在Shell中将其后台运行并轮询
result.json
文件。预运行时的使用错误会以退出码2结束且不会生成结果;若
omp
未找到则会以退出码127结束并写入
status: "omp_unavailable"
优先信任进程状态和工作树,而非进度显示。任务完成意味着进程已退出且
result.json
文件已生成。omp的完整报告位于
result.json
finalMessage
字段中(也会在报告标记之间完整打印到标准输出)。

4. Review - do not trust the self-report

4. 审核——不要轻信自我报告

Treat omp's final message and gate claims as claims:
  • Re-run the project's gates yourself.
  • Read the diff against the brief, starting with
    touchedFiles
    .
  • Run relevant guard skills if installed.
  • Round-trip migrations and grep for dangling references after removals or renames.
See references/review-and-land.md.
将omp的最终消息和准入标准声明仅视为声明:
  • 自行重新运行项目的准入检查。
  • 根据简报审核差异,从
    touchedFiles
    开始查看。
  • 若已安装相关守护技能则运行它们。
  • 在删除或重命名后,往返迁移并搜索悬空引用。
详情请查看references/review-and-land.md

5. Land it

5. 完成提交

The implementer edits the working tree; the orchestrator commits. Commit only after the gates pass and the diff holds. If rework is needed, send a delta brief with
--resume-last
or
--session <id>
, then review again.
实现工具会编辑工作树;协调者负责提交。仅当准入检查通过且差异符合要求时再提交。若需要返工,使用
--resume-last
--session <id>
参数发送增量简报,之后再次审核。

Autonomy and permissions

自主性与权限

Oh My Pi has no sandbox. Print mode has no approval UI, so a write-capable relay run always passes
--yolo
(
tools.approvalMode: yolo
) — otherwise a user's
always-ask
or
write
config would stall until the watchdog. The other controls are:
  1. --read-only
    restricts omp's callable tools to
    --tools read,grep,glob
    . It does not pass
    --yolo
    . Installed extension code still runs with the user's host permissions if project resources are trusted.
  2. The relay passes
    --no-extensions --no-skills --no-rules
    by default, so project
    .omp
    extensions, skills, and rules stay undiscovered.
    --approve
    is the explicit opt-in for a repository the user trusts.
  3. touchedFiles
    and the diff are the record of what changed. Inspect them after every run.
Oh My Pi没有沙箱。打印模式没有审批UI,因此允许写入的中继工具运行会始终传递
--yolo
参数(
tools.approvalMode: yolo
)——否则用户的
always-ask
write
配置会导致任务停滞直到监控超时。其他控制措施包括:
  1. --read-only
    参数将omp可调用的工具限制为
    --tools read,grep,glob
    。它不会传递
    --yolo
    参数。若信任项目资源,已安装的扩展代码仍会以用户的主机权限运行。
  2. 中继工具默认传递
    --no-extensions --no-skills --no-rules
    参数,因此项目的
    .omp
    扩展、技能和规则不会被发现。
    --approve
    参数是用户信任某仓库时的显式选择项。
  3. touchedFiles
    和差异记录了所有变更内容。每次运行后都需检查它们。

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. Two limits remain: surface, don't absorb (report omp's design decisions, defensible-but-unasked turns, and non-blocking nitpicks) and stop for scope changes (if correct completion needs going beyond the brief, ask instead of expanding the mandate). See references/review-and-land.md.
委托是用户主动选择的操作。一旦用户确认(如“处理此队列”、“继续”),提交已验证且通过准入检查的工作就是约定的契约。仍有两个限制:披露而非隐瞒(报告omp的设计决策、合理但未要求的变更以及非阻塞性小问题)和范围变更时停止(若正确完成任务需要超出简报范围,需先询问用户而非自行扩展任务范围)。详情请查看references/review-and-land.md

References

参考资料

  • references/writing-the-brief.md - structure, report contract, real gates, stdin delivery, model listing, and delta briefs.
  • references/dispatch-and-poll.md - flags, artifacts,
    result.json
    , polling, and failure recovery.
  • references/review-and-land.md - review checklist, commit boundary, and rework through omp sessions.
  • references/multi-task-queues.md - sequential queues, constraint carry-forward, progress tracking, and the final coherence pass.
  • references/writing-the-brief.md - 简报结构、报告约定、实际准入标准、标准输入传递、模型列表以及增量简报。
  • references/dispatch-and-poll.md - 参数、产物、
    result.json
    、轮询以及故障恢复。
  • references/review-and-land.md - 审核清单、提交边界以及通过omp会话进行返工。
  • references/multi-task-queues.md - 顺序队列、约束传递、进度跟踪以及最终一致性检查。