Executes a written ulw-plan work plan with Boulder state, evidence ledger, worktree discipline, and parallel subagents. Use when the user says ulw-execute or as
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-ulw-execute-b98e47640231 ,按照其中的说明把「ulw-execute」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
YOU DO NOT WRITE CODE. YOU DO NOT EDIT PRODUCT FILES. YOU DO NOT RUN QA YOURSELF. EVERY unit of implementation, test, QA, and review work MUST be delegated to a spawned subagent. NO EXCEPTIONS. Your hands touch only plan selection, .omo/ state (Boulder, ledger, plan checkboxes), decomposition, dispatch, verdicts, and evidence records. About to edit a product file or run an implementation command yourself? STOP. SPAWN A WORKER INSTEAD. Orchestrate at MAXIMUM PARALLELISM: every independent unit runs concurrently; only named dependencies serialize.
Translate any OpenCode-only tool name in an inherited example to its Codex equivalent:
| OpenCode example | Codex tool to use |
|---|---|
final-review task(...) | multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false}) |
worker task(...) | multi_agent_v1.spawn_agent({"message":"TASK: act as <role>. ...","fork_context":false}) — for implementation workers add `agent_type: "lazycodex-worker-<low |
background_output(task_id="...") | multi_agent_v1.wait_agent(...) for mailbox signals |
team_*(...) | multi_agent_v1.spawn_agent + multi_agent_v1.send_input + multi_agent_v1.wait_agent + multi_agent_v1.close_agent |
When translating load_skills=[...], name the skills inside the spawned agent's message. If a code block below conflicts with this section, this section wins.
Codex exposes ONE of two subagent tool surfaces per session; check your own tool list and route accordingly. If multi_agent_v1.* tools exist, use the table above as written. If instead a flat spawn_agent with a required task_name exists (multi_agent_v2), rewrite every multi_agent_v1.* example: multi_agent_v1.spawn_agent({...,"fork_context":false}) becomes spawn_agent({"task_name":"<lowercase_digits_underscores>","message":...,"agent_type":...,"fork_turns":"none"}) ("all" only when full parent history is truly required); send_input becomes send_message; do not call close_agent/resume_agent (finished agents end on their own; followup_task re-tasks one, interrupt_agent stops one); wait_agent takes only timeout_ms and returns on any child mailbox activity. On the v2 surface agent_type may be absent from the spawn schema — when absent, omit it and describe the role inside message. If a code block below conflicts with this section, this section wins.
When tier worker agents are installed, map the delegation router's parenthesized difficulty to agent_type: (low) -> lazycodex-worker-low; (medium) -> lazycodex-worker-medium; (high) -> lazycodex-worker-high. Explorer/librarian research lanes keep their own roles. On spawn surfaces without agent_type, state the tier inside message. Difficulty (model power) is orthogonal to the LIGHT/HEAVY rigor tier in step 4 — judge each on its own facts.
Every multi_agent_v1.spawn_agent message is a self-contained executable assignment: TASK: <imperative assignment>, then DELIVERABLE, SCOPE, and VERIFY, with role instructions inside message. Use fork_context: false unless full history is truly required; paste only the context the child needs.
Plan and reviewer agents may run for a long time: spawn them in the background and keep doing independent root work. Between multi_agent_v1.wait_agent calls, back off — double the timeout up to ~5 minutes — instead of spinning short cycles. A timeout only means no new mailbox update arrived; treat a running child as alive. Require WORKING: <task> - <current phase> before long passes and BLOCKED: <reason> only when progress stops. Keep the parent visibly alive with active subagent count, names, and latest WORKING: phase. Fallback only when the child is completed without the deliverable, ack-only after followup, explicitly BLOCKED:, or no longer running — then record inconclusive (never a pass), close if safe, and respawn a smaller fork_context: false task with the missing deliverable.
Execute a work plan until every top-level checkbox is complete. This skill pairs with the harness's ulw-execute continuation hook, which re-injects the next turn while .omo/boulder.json says this codex:<session_id> still has unchecked plan work.
$ulw-execute [plan-name] [--worktree <absolute-path>] [--make-pr] [--ship]
plan-name (optional): a full or partial file stem under .omo/plans/.--worktree (optional): reuse an existing task-owned worktree for the first phase instead of creating one; every phase runs in a task-owned worktree regardless.--make-pr (optional): deliver each phase's worktree as a pull request — push the branch, open a reviewer-readable PR, hand off with the URL, and merge only if the user asks.--ship (optional): full delivery lifecycle; implies --make-pr. After the PR opens, stay on the job until it is MERGED: watch CI and review gates, fix failures and address feedback from the worktree (fresh QA evidence for behavior changes), merge per the repository's merge policy, then remove the worktree and sync .omo/ state back.Do ALL of this immediately after the plan is selected, BEFORE the first implementation dispatch. Skipping any step is a defect.
create_goal), call it with a DETAILED objective: the plan name and path, the concrete end state, the phase and task counts, the delivery mode (direct, --make-pr, or --ship), and how completion will be verified. One work session = one registered goal (the goal tool holds one active goal); each phase then carries its own concrete goal — the ledger entry Phase 2 records before the wave's first dispatch, defined from the previous phase's landed and verified evidence. No goal tool -> record the same objective as the first ledger entry..omo/boulder.json if it exists..omo/plans/.plan-name was provided, select the matching plan.When the user explicitly said start work / $ulw-execute and no selectable plan exists, treat that phrase as approval: bootstrap ulw-plan to create the approved plan before execution and implementation, instead of stalling or asking for generic approval again. A brief or notes file without waves, checkboxes, and acceptance criteria is NOT decision-complete — enter this bootstrap too.
ulw-plan skill from the current request and require its dynamic adversarial workflow: collect, verify, design, adversarial plan-review, synthesize..omo/plans/<slug>.md before implementation or Boulder state writes that point at plan work.Write .omo/boulder.json before implementation starts. Prefix session ids with codex: so the continuation hook can identify its own session.
{
"schema_version": 2,
"active_work_id": "<work-id>",
"works": {
"<work-id>": {
"work_id": "<work-id>",
"active_plan": ".omo/plans/<plan-name>.md",
"plan_name": "<plan-name>",
"session_ids": ["codex:<session_id>"],
"status": "active",
"worktree_path": null
}
}
}
Every phase (plan wave) runs in its own task-owned worktree with its own goal: before the wave's first dispatch, record the wave's goal — its checkboxes and their acceptance criteria — as a ledger entry, then git worktree add <repo>-wt/<plan>-<wave> <branch off the integration base> (or verify a --worktree path with git worktree list --porcelain), store the absolute path as worktree_path, run every edit, command, test, and evidence capture inside it; the wave lands on the integration base once its checkboxes are verified (direct merge, or the PR under --make-pr/--ship), and the next wave branches from that landed base.
Solo orchestration with parallel background workers is the default topology. Decide once, when the wave's lanes are known, and record the verdict in the ledger:
workflow run per wave. Sub-tasks with real ordering between them (C needs A and B finished first) and a harness with a native workflow tool: dispatch the wave as ONE run (one producer node per lane plus a verification node); recover inside it with retry/amend/send; let node completions wake you instead of arming per-lane watchers; the next wave is a NEW run (or amend when only the definition changed) — never one graph for the whole plan. Read the mass-ulw skill's SKILL.md and references/planning.md IN FULL before defining any graph.--make-pr/--ship, when a wave holds independent checkboxes, give each lane its own branch and task-owned worktree, delivered as its own PR.Landing rules, regardless of topology:
## TODOs or ## Final Verification Wave.A spawned worker is not fire-and-forget. For EACH subagent in the burst, name the observable state that ends its lane — the file written, the PR opened, the checkbox's gates green — and put a watcher on THAT state, never on a clock.
monitor on top of it only when the lane's completion condition lives OUTSIDE the child's final message — CI turning green, a log line, a build artifact appearing, a branch landing. Watch the state itself (monitor with a command that exits or emits on that condition), and keep the burst's watchers distinct so one lane firing never reads as another's.sleep, no timed retry loop, no re-reading the same status hoping it changed. Between waves, do independent root work or end the turn; an idle session is always woken. A single task_output({ mode: "tail" }) peek is allowed only when a midpoint decision genuinely depends on it.kill_bash and say so in the ledger. A stale watcher re-fires on unrelated output and corrupts the next wave's verdict.When the plan annotates a todo with Recommended task executor category:, follow that annotation; deviate only for a reason recorded in the ledger entry. Otherwise route by shape, in the omo category vocabulary (category-capable harnesses pass it directly on the worker-spawn tool, e.g. task(category="quick", ...); others map the parenthesized difficulty):
| Category | Route here |
|---|---|
quick (low) | mechanical, single-file, boilerplate, config/copy — the default for every splittable piece |
unspecified-low (low) | small tasks that fit no other category |
unspecified-high (medium) | standard features across a few files with known patterns |
visual-engineering (medium) | frontend, UI/UX, styling, animation |
writing (low) | documentation and prose |
git (low) | git operations |
deep-low (medium) | hairy debugging, research-heavy or subtle cross-module work the worker can settle from what it reads |
deep-high (high) | the same, when the central decision cannot be settled from evidence: a trade-off, a cross-package contract, or correctness argued from invariants |
ultrabrain (high) | ONE genuinely hard, logic-heavy problem — hand it the goal, not step-by-step instructions |
Sizing is a two-branch decision made per checkbox, before dispatch:
quick/unspecified-low workers in ONE parallel burst — many small cheap workers in parallel beat one large delegation.deep-low, deep-high or ultrabrain as ONE delegation. Never force-split work whose parts share one insight.Each sub-task message must include:
curl, send-keys, page.click / session.click, payload, selectors, and the binary observable that decides PASS/FAIL), not "verify it works". A LIGHT checkbox needs one real-surface proof of its deliverable, and auxiliary surfaces (CLI stdout, DB state diff, parsed config dump) are first-class when the surface is CLI- or data-shaped:
curl -i against the live endpoint.tmux send-keys is fine for a boot/behavior smoke, but color/layout/CJK evidence goes through the xterm.js web terminal below, NEVER tmux capture-pane.browser skill) — the owned engine (connectPipe on a task-owned profile, connectCloakProfile for bot-scored targets) for unauthenticated pages, the attached engine (connectBrowserSkill() in the user's signed-in browser) when the page needs their login; never a clone of or a launch against the live profile.bun script/qa/web-terminal-visual-qa.mjs --command "<cmd>" --input "{Enter}" --evidence-dir <dir> (real pty rendered through xterm.js in Chrome) and attach terminal.png plus metadata.json.The 9 ultraqa classes are trigger-mapped: new input parsing → malformed input; untrusted external text → prompt injection; resumable or long-running flows → cancel/resume; generated or cached artifacts → stale state; uncommitted user files in scope → dirty worktree; long external commands → hung or long commands; new or timing-sensitive tests → flaky tests; log-based success claims → misleading success output; mid-operation interrupts → repeated interruptions. A class applies when its trigger fact holds. Probe each applicable class; record the rest as not-applicable with a one-line reason.
For each checkbox, complete all five gates before marking it done:
Append evidence to .omo/ulw-execute/ledger.jsonl, one JSON object per line. Include at least event, plan, task, session_id, commands, artifact, adversarial_classes, and cleanup fields. adversarial_classes lists each probed class with its observable result and each ruled-out class with a one-line reason.
A worker done claim is never final: each implementation sub-task returns a DoneClaim, a different context runs AdversarialVerify probing or reproducing the claim, failures loop back to the executor, and only a confirmed verifier verdict becomes FullyDone.
{
"DoneClaim": {
"task": "<task id/title>",
"changed_files": ["path"],
"tests": ["exact command + result"],
"manual_qa": ["artifact path"],
"cleanup": ["receipt"],
"risks": ["known risk or none"]
},
"AdversarialVerify": {
"verdict": "confirmed | false-positive | needs-fix | needs-human-review",
"evidence": ["file path, command, log, artifact, or explicit not inspected"],
"repro": "exact command or manual steps when available",
"confidence": 0.0
}
}
Rules:
confirmed is the only pass verdict. false-positive, needs-fix, and needs-human-review all block checkbox completion.stale_state, dirty_worktree, and misleading_success_output, before allowing FullyDone.Only after verification passes:
- [ ] to - [x].task-completed ledger entry.When all top-level checkboxes in ## TODOs and ## Final Verification Wave are complete:
.omo/ state back to the main repo, create or update the PR, wait for review/verification gates, merge by default unless explicitly opted out, and remove the worktree only after successful merge or explicit handoff.ORCHESTRATION COMPLETE block with the plan path, verification commands, artifacts, and cleanup receipts.--dry-run as completion evidence.codex:<session_id>.