ultragoal
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<Purpose>
Ultragoal breaks a brief into an ordered set of goals, records start/checkpoint/blocker/failure events in a durable append-only ledger, and tells the active Claude agent how to drive the Claude Code `/goal` slash command alongside the plan. It does not — and cannot — mutate Claude `/goal` state from the shell; it persists durable repo state and prints a model-facing handoff that the active agent must act on in-session.
</Purpose>
<Use_When>
- The user wants a durable, repo-native way to track an ultragoal across multiple Claude sessions or worktrees
- The work is large enough to warrant multiple ordered "stories" with attempt counts and per-story evidence
- The user wants the final completion gated behind ai-slop-cleaner + verification + $code-review
- The user wants the active Claude directive coordinated with the ledger so that a session restart does not lose progress </Use_When>
/goal
<Do_Not_Use_When>
- The task is a single small change — use direct delegation or instead
ralph - The user wants the assistant to literally invoke itself from the shell — that is not possible;
/goalonly writes artifacts and prints handoff textomc ultragoal - The user wants a planning-only artifact with no execution loop — use instead </Do_Not_Use_When>
plan
<Why_This_Exists>
Claude Code is a session-scoped Stop hook: it blocks the session from stopping until a condition holds, and auto-clears on success. That is a great single-session execution primitive, but it loses state across sessions and does not by itself enforce a final review gate. adds a durable plan, ledger, and gating layer so a long multi-step initiative can survive session restarts, fresh worktrees, and review iterations while still leveraging Claude to keep the active agent focused.
</Why_This_Exists>
/goalomc ultragoal/goal<How_To_Use>
-
Create a plan from a brief:
omc ultragoal create-goals --brief-file plan.mdOr with explicit stories:omc ultragoal create-goals --brief "ship the migration" \ --goal "Schema::Add new columns" \ --goal "Backfill::Backfill rows in batches" \ --goal "Cutover::Drop old columns and switch reads"The default mode is(one Claudeaggregatecovers the run). Pass/goalif you want each story to have its own--claude-goal-mode per-story./goalMulti-repo workspaces / parallel sessions: when several Claude sessions in the same workspace need to runconcurrently, pass either/ultragoalor--plan-id <stable-id>so the plan is written to--auto-plan-idinstead of the shared single-plan path. Without that flag, two sessions creating goals would clobber each other..omc/ultragoal/plans/{planId}/derives--auto-plan-idfrom the brief title. Then thread the same{epochMs}-{slug}through every subsequent subcommand in that session. Use--plan-id <id>to enumerate available planIds when needed.omc ultragoal list-plans -
Start (or resume) the next story:
omc ultragoal complete-goalsThis prints a model-facing handoff. The active Claude agent must read it and:- Set the native Claude for this session — in standalone Claude Code neither the shell nor the agent can do it, so ask the user to type
/goaland wait./goal <aggregate objective>(below) reconciles the ledger only and does not satisfy the PreToolUse--claude-goal-jsonguard, which blocks tool calls until it observes an active/goal./goal - Work the story.
- When the story is complete (and for the final story, after the full quality gate), share back a snapshot of the active state and call
/goal.checkpoint
- Set the native Claude
-
Checkpoint a story:
omc ultragoal checkpoint --goal-id G001-... --status complete \ --evidence "tests/files/PR evidence" \ --claude-goal-json '{"goal":{"objective":"...","status":"active"}}'For the final story, also passcontaining--quality-gate-json,aiSlopCleaner, andverificationevidence (all clean).codeReview -
If the final review is not clean, do NOT mark complete. Record blockers:
omc ultragoal record-review-blockers --goal-id G00X-... \ --title "Resolve final code-review blockers" \ --objective "Fix the listed review findings and rerun final gates" \ --evidence "<the review findings>" \ --claude-goal-json '{"goal":{"objective":"...","status":"active"}}'This appends a new blocker story and keeps the Claudeactive./goal -
Inspect state at any time:
omc ultragoal status
</How_To_Use>
<Important_Limitations>
- The shell cannot invoke or mutate Claude Code state.
/goalonly persists durable artifacts and prints instructions that the active Claude agent reads and acts on in-session.omc ultragoal - Snapshots passed via are model-supplied proof of the active
--claude-goal-jsonstate; OMC validates them for textual consistency with the plan's expected objective and ledger event, but it cannot independently observe Claude/goalstate. They do not satisfy the PreToolUse/goalguard, which requires an actual active/goal— a host-injected snapshot or the native/goalthe user set in-session./goal - If the Claude slash command is renamed or restructured, only the handoff wording needs to change; the reconciliation logic is name-agnostic. </Important_Limitations>
/goal
<Purpose>
Ultragoal会将任务简报拆解为有序的目标集合,在持久化的追加式账本中记录开始/检查点/阻塞/失败事件,并告知当前的Claude代理如何结合计划使用Claude Code的`/goal`斜杠命令。它无法(也不能)从Shell端修改Claude的`/goal`状态;它仅持久化仓库状态,并打印供模型查看的交接说明,由当前代理在会话内执行。
</Purpose>
<Use_When>
- 用户需要一种持久化、仓库原生的方式,跨多个Claude会话或工作树跟踪ultragoal
- 工作规模足够大,需要多个有序的“任务单元”,并记录尝试次数和每个任务单元的证据
- 用户希望最终完成需经过ai-slop-cleaner + 验证 + $code-review的质量关卡
- 用户希望当前的Claude 指令与账本协同,避免会话重启后丢失进度 </Use_When>
/goal
<Do_Not_Use_When>
- 任务是单一的小改动——改用直接委托或工具
ralph - 用户希望助手直接从Shell调用——这是不可能的;
/goal仅生成文件并打印交接文本omc ultragoal - 用户只需要计划文件,不需要执行循环——改用工具 </Do_Not_Use_When>
plan
<Why_This_Exists>
Claude Code的是会话级别的停止钩子:它会阻止会话结束,直到满足指定条件,成功后自动清除。这是一个很棒的单会话执行原语,但跨会话会丢失状态,且本身无法强制实施最终的审核关卡。添加了持久化计划、账本和关卡层,让长期的多步骤任务能够在会话重启、新工作树和审核迭代中保留进度,同时仍能利用Claude 保持当前代理的专注度。
</Why_This_Exists>
/goalomc ultragoal/goal<How_To_Use>
-
从任务简报创建计划:
omc ultragoal create-goals --brief-file plan.md或使用明确的任务单元:omc ultragoal create-goals --brief "完成迁移部署" \ --goal "Schema::添加新列" \ --goal "Backfill::分批回填数据行" \ --goal "Cutover::删除旧列并切换读取源"默认模式为(一个Claudeaggregate覆盖整个运行过程)。 如果希望每个任务单元都有独立的/goal,请传递/goal参数。--claude-goal-mode per-story多仓库工作区/并行会话:当同一工作区中的多个Claude会话需要同时运行时,请传递/ultragoal或--plan-id <稳定ID>参数,这样计划会被写入--auto-plan-id目录,而非共享的单计划路径。 如果没有该参数,两个创建目标的会话会互相覆盖。.omc/ultragoal/plans/{planId}/会根据简报标题生成--auto-plan-id格式的ID。之后在该会话的所有后续子命令中都要传递相同的{epochMs}-{slug}参数。 必要时可使用--plan-id <id>命令枚举可用的planId。omc ultragoal list-plans -
启动(或恢复)下一个任务单元:
omc ultragoal complete-goals这会打印供模型查看的交接说明。当前的Claude代理必须阅读并执行以下操作:- 设置当前会话的原生Claude ——在独立的Claude Code中,Shell和代理都无法完成此操作,因此需要让用户输入
/goal并等待。下文的/goal <聚合目标>仅用于协调账本,无法满足PreToolUse--claude-goal-json防护要求,该防护会阻止工具调用,直到检测到活跃的/goal。/goal - 执行任务单元。
- 任务单元完成后(最终任务单元需在通过完整质量关卡后),分享当前状态的快照并调用
/goal。checkpoint
- 设置当前会话的原生Claude
-
为任务单元创建检查点:
omc ultragoal checkpoint --goal-id G001-... --status complete \ --evidence "tests/files/PR证据" \ --claude-goal-json '{"goal":{"objective":"...","status":"active"}}'对于最终任务单元,还需传递包含、aiSlopCleaner和verification证据(全部通过)的codeReview参数。--quality-gate-json -
如果最终审核未通过,请勿标记为完成。记录阻塞项:
omc ultragoal record-review-blockers --goal-id G00X-... \ --title "解决最终代码审核阻塞项" \ --objective "修复列出的审核问题并重新运行最终关卡" \ --evidence "<审核问题内容>" \ --claude-goal-json '{"goal":{"objective":"...","status":"active"}}'这会追加一个新的阻塞任务单元,并保持Claude处于活跃状态。/goal -
随时查看状态:
omc ultragoal status
</How_To_Use>
<Important_Limitations>
- Shell无法调用或修改Claude Code的状态。
/goal仅持久化文件并打印说明,由当前的Claude代理在会话内读取并执行。omc ultragoal - 通过传递的快照是模型提供的活跃
--claude-goal-json状态证明;OMC会验证其与计划预期目标和账本事件的文本一致性,但无法独立观察Claude的/goal状态。这些快照无法满足PreToolUse/goal防护要求,该防护需要实际的活跃/goal——即宿主注入的快照或用户在会话内设置的原生/goal。/goal - 如果Claude 斜杠命令被重命名或重构,仅需修改交接文本的措辞;协调逻辑与命令名称无关。 </Important_Limitations>
/goal