worker
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorker Skill
工作者技能
This skill is for a Codex session that was started as an OMX Team worker (a tmux pane spawned by ).
$team本技能适用于作为OMX团队工作者启动的Codex会话(由生成的tmux窗格)。
$teamIdentity
身份
You MUST be running with set. It looks like:
OMX_TEAM_WORKER<team-name>/worker-<n>Example:
alpha/worker-2你必须在已设置的环境下运行,格式如下:
OMX_TEAM_WORKER<team-name>/worker-<n>示例:
alpha/worker-2Load Worker Skill Path (Claude/Codex)
加载工作者技能路径(Claude/Codex)
When a worker inbox tells you to load this skill, resolve the first existing path:
${CODEX_HOME:-~/.codex}/skills/worker/SKILL.md~/.codex/skills/worker/SKILL.md<leader_cwd>/.codex/skills/worker/SKILL.md- (repo fallback)
<leader_cwd>/skills/worker/SKILL.md
当工作者收件箱要求你加载本技能时,按顺序查找第一个存在的路径:
${CODEX_HOME:-~/.codex}/skills/worker/SKILL.md~/.codex/skills/worker/SKILL.md<leader_cwd>/.codex/skills/worker/SKILL.md- (仓库兜底路径)
<leader_cwd>/skills/worker/SKILL.md
Startup Protocol (ACK)
启动协议(ACK)
- Parse into:
OMX_TEAM_WORKER- (before the
teamName)/ - (after the
workerName, usually/)worker-<n>
- Send a startup ACK to the lead mailbox before task work:
- Recipient worker id:
leader-fixed - Body: one short deterministic line (recommended: ).
ACK: <workerName> initialized
- Recipient worker id:
- After ACK, proceed to your inbox instructions.
The lead will see your message in:
<team_state_root>/team/<teamName>/mailbox/leader-fixed.jsonUse CLI interop:
- with
omx team api send-message --input <json> --json{team_name, from_worker, to_worker:"leader-fixed", body}
Copy/paste template:
bash
omx team api send-message --input "{\"team_name\":\"<teamName>\",\"from_worker\":\"<workerName>\",\"to_worker\":\"leader-fixed\",\"body\":\"ACK: <workerName> initialized\"}" --json- 解析得到两个字段:
OMX_TEAM_WORKER- (
teamName前面的部分)/ - (
workerName后面的部分,通常为/)worker-<n>
- 在开始处理任务前,向负责人邮箱发送启动ACK:
- 接收方工作者ID:
leader-fixed - 内容:一行简短固定格式的内容(推荐:)
ACK: <workerName> initialized
- 接收方工作者ID:
- 发送ACK后,再按照收件箱的指令执行后续操作。
负责人会在以下路径看到你的消息:
<team_state_root>/team/<teamName>/mailbox/leader-fixed.json使用CLI互操作命令:
- 执行,参数为
omx team api send-message --input <json> --json{team_name, from_worker, to_worker:"leader-fixed", body}
复制粘贴模板:
bash
omx team api send-message --input "{\"team_name\":\"<teamName>\",\"from_worker\":\"<workerName>\",\"to_worker\":\"leader-fixed\",\"body\":\"ACK: <workerName> initialized\"}" --jsonInbox + Tasks
收件箱与任务
- Resolve canonical team state root in this order:
- env
OMX_TEAM_STATE_ROOT - worker identity
team_state_root - team config/manifest
team_state_root - local cwd fallback ()
.omx/state
- Read your inbox:
<team_state_root>/team/<teamName>/workers/<workerName>/inbox.md - Pick the first unblocked task assigned to you.
- Read the task file:
(example:
<team_state_root>/team/<teamName>/tasks/task-<id>.json)task-1.json - Task id format:
- The MCP/state API uses the numeric id (), not
"1"."task-1" - Never use legacy wording.
tasks/{id}.json
- The MCP/state API uses the numeric id (
- Claim the task (do NOT start work without a claim) using claim-safe lifecycle CLI interop ().
omx team api claim-task --json - Do the work.
- Complete/fail the task via lifecycle transition CLI interop () from
omx team api transition-task-status --jsontoin_progressorcompleted.failed- Do NOT directly write lifecycle fields (,
status,owner,result) in task files.error
- Do NOT directly write lifecycle fields (
- Use only for rollback/requeue to
omx team api release-task-claim --json(not for completion).pending - Update your worker status:
with
<team_state_root>/team/<teamName>/workers/<workerName>/status.json{"state":"idle", ...}
- 按以下优先级解析规范的团队状态根目录:
- 环境变量
OMX_TEAM_STATE_ROOT - 工作者身份配置中的
team_state_root - 团队配置/清单中的
team_state_root - 本地当前工作目录兜底路径()
.omx/state
- 读取你的收件箱:
<team_state_root>/team/<teamName>/workers/<workerName>/inbox.md - 选取分配给你的第一个未阻塞的任务。
- 读取任务文件:
(示例:
<team_state_root>/team/<teamName>/tasks/task-<id>.json)task-1.json - 任务ID格式说明:
- MCP/状态API使用数字ID(),而非
"1"。"task-1" - 禁止使用旧版的写法。
tasks/{id}.json
- MCP/状态API使用数字ID(
- 认领任务(未认领前禁止开始工作),使用支持安全认领生命周期的CLI互操作命令()。
omx team api claim-task --json - 执行任务工作。
- 通过生命周期切换CLI互操作命令()将任务状态从
omx team api transition-task-status --json更新为in_progress或completed,标记任务完成/失败。failed- 禁止直接修改任务文件中的生命周期字段(、
status、owner、result)。error
- 禁止直接修改任务文件中的生命周期字段(
- 仅当需要回滚/将任务重新排入队列时使用
pending(不可用于标记任务完成)。omx team api release-task-claim --json - 更新你的工作者状态:
向写入
<team_state_root>/team/<teamName>/workers/<workerName>/status.json{"state":"idle", ...}
Mailbox
邮箱
Check your mailbox for messages:
<team_state_root>/team/<teamName>/mailbox/<workerName>.jsonWhen notified, read messages and follow any instructions. Use short ACK replies when appropriate.
Note: leader dispatch is state-first. The durable queue lives at:
Hooks/watchers may nudge you after mailbox/inbox state is already written.
<team_state_root>/team/<teamName>/dispatch/requests.jsonUse CLI interop:
- to read
omx team api mailbox-list --json - to acknowledge delivery
omx team api mailbox-mark-delivered --json
Copy/paste templates:
bash
omx team api mailbox-list --input "{\"team_name\":\"<teamName>\",\"worker\":\"<workerName>\"}" --json
omx team api mailbox-mark-delivered --input "{\"team_name\":\"<teamName>\",\"worker\":\"<workerName>\",\"message_id\":\"<MESSAGE_ID>\"}" --json在以下路径查看你的邮箱消息:
<team_state_root>/team/<teamName>/mailbox/<workerName>.json收到通知时,读取消息并遵循所有指令,合适情况下发送简短的ACK回复。
注意:负责人调度以状态为优先级,持久化队列存储在:
钩子/监听器会在邮箱/收件箱状态写入完成后提醒你。
<team_state_root>/team/<teamName>/dispatch/requests.json使用CLI互操作命令:
- 执行读取消息
omx team api mailbox-list --json - 执行确认消息已送达
omx team api mailbox-mark-delivered --json
复制粘贴模板:
bash
omx team api mailbox-list --input "{\"team_name\":\"<teamName>\",\"worker\":\"<workerName>\"}" --json
omx team api mailbox-mark-delivered --input "{\"team_name\":\"<teamName>\",\"worker\":\"<workerName>\",\"message_id\":\"<MESSAGE_ID>\"}" --jsonDispatch Discipline (state-first)
调度规则(状态优先)
Worker sessions should treat team state + CLI interop as the source of truth.
- Prefer inbox/mailbox/task state and operations.
omx team api ... --json - Do not rely on ad-hoc tmux keystrokes as a primary delivery channel.
- If a manual trigger arrives (for example nudge), treat it only as a prompt to re-check state and continue through the normal claim-safe lifecycle.
tmux send-keys
工作者会话应当将团队状态+CLI互操作作为唯一可信源。
- 优先使用收件箱/邮箱/任务状态和操作。
omx team api ... --json - 禁止将临时的tmux按键作为主要的指令传递渠道。
- 如果收到手动触发指令(例如提醒),仅将其作为重新检查状态的提示,仍需按照常规的安全认领生命周期流程执行。
tmux send-keys
Shutdown
关闭
If the lead sends a shutdown request, follow the shutdown inbox instructions exactly, write your shutdown ack file, then exit the Codex session.
如果负责人发送了关闭请求,严格遵循收件箱中的关闭指令,写入关闭ACK文件后退出Codex会话。