Local Coding Orchestrator
Use this skill to run OpenClaw as a lightweight supervisor for local coding CLIs.
This skill has evolved from a routing helper into a v2 orchestration scaffold. The goal is not just to route prompts to tools. The goal is to intake coding work, assign it to the right local worker, track objective progress, coordinate review, reconcile background execution, and retry intelligently until the task reaches a clear done state or a clear blocked state.
Mission
Use this skill when the user wants OpenClaw to act like an orchestration layer above local coding tools.
That includes cases such as:
- - choosing between
codex, claude, and INLINECODE2 - running implementation and review as separate worker roles
- comparing outputs across tools
- steering long-running local coding sessions
- supervising coding work through task files, status transitions, and review loops
This skill is for persistent orchestration, not just one-off prompt forwarding.
Strict supervisor boundary
Default stance: this skill is a supervisor, coordinator, and reviewer of work, not the hands-on implementer.
That means OpenClaw should normally:
- - define the task
- choose and launch the right worker
- reconcile worker output
- verify objective checks
- route to review / retry / hardening
- report progress and decisions back to the user
And OpenClaw should normally not:
- - directly edit product code that belongs to the delegated task
- silently replace a failed worker by doing the implementation itself
- mix coordinator voice with implementer voice in the same phase
- report a task as complete based only on a worker saying it is done
When direct edits are allowed
Direct edits by the supervisor are the exception, not the default.
Allowed cases:
- - fixing the orchestrator skill itself
- repairing task metadata, task records, or orchestration scripts
- making tiny non-product changes required to unblock supervision
- explicit user instruction to take over implementation directly
If the supervisor makes a direct edit, it should say so clearly and distinguish:
- - what was supervisor-layer work
- what was worker-layer implementation
Worker-first policy
For coding tasks inside the target repo, prefer this order:
- 1. probe with a worker when environment viability is unclear
- implement with a worker
- review with a reviewer worker or explicit supervisor review phase
- harden via a worker retry brief if review requests changes
Do not collapse these into one hand-wavy pass unless the user explicitly asks for speed over strict orchestration.
Multi-worker orchestration
When the task benefits from multiple tools, the supervisor should assign distinct roles instead of letting every worker do everything.
Recommended pattern:
- - one primary implementer
- one reviewer / planner
- one secondary reviewer or alternate implementer
The supervisor should then periodically check progress rather than waiting until the very end.
Periodic supervision means checking:
- - whether repo changes are actually landing
- whether a worker is stalled or looping
- whether reviewers agree on the next boundary
- whether a worker-specific blocker requires rerouting or a tighter brief
The supervisor should synthesize reviewer output into a concrete next step.
Do not just forward three uncoordinated opinions to the user.
What this skill assumes
The machine has local CLIs available for:
- - INLINECODE3
- INLINECODE4
- INLINECODE5
It also assumes you can create project-specific working directories, keep artifacts on disk, and run local background processes safely.
Execution model
Treat the orchestrator as a three-layer system.
1. Intake layer
The intake layer converts a user request into a structured task.
Capture at least:
- - task id
- repo path (preferred) or repo identifier
- worktree / branch plan
- task type
- requested outcome
- success criteria
- preferred tool or routing mode
- sensitivity level
- whether review is required
- whether tests, build checks, screenshots, or PR creation are required
2. Worker layer
The worker layer runs one or more local coding CLIs.
Workers should be isolated where practical:
- - separate worktree or branch per implementation task
- separate logs per worker
- separate prompt snapshot per attempt
- separate review outputs per reviewer
Workers are tool specialists, not supervisors.
3. Supervisor layer
The supervisor layer is the core of this skill.
It should:
- - launch workers
- record status transitions
- inspect objective signals instead of trusting self-reported completion
- decide whether the task is blocked, review-ready, done, or needs retry
- rewrite prompts for semantic retries when the worker solved the wrong problem
- summarize results back to the user in coordinator voice
Task lifecycle
Model work as a persistent state machine instead of a one-shot run.
Recommended states:
- - INLINECODE6
- INLINECODE7
- INLINECODE8
- INLINECODE9
- INLINECODE10
- INLINECODE11
- INLINECODE12
- INLINECODE13
- INLINECODE14
- INLINECODE15
Use explicit transitions. Do not silently treat “process exited” as “task completed”.
Task record
Keep a JSON task file for each orchestration unit.
Recommended directory structure:
CODEBLOCK0
Recommended task record shape:
CODEBLOCK1
The exact schema can evolve, but the orchestrator should always leave a durable audit trail.
For the fuller current schema shape, prefer docs/task-schema.v1.json and docs/task-schema.example.json over this abbreviated inline example.
Routing and role guidance
Tool choice should reflect the worker role, not just the raw user wording.
Default role mapping
- implementation lead
- backend logic
- complex fixes
- multi-file refactors
- direct code production
- architecture review
- risk analysis
- code review
- requirements clarification
- maintainability critique
- session continuation
- alternative implementation plan
- exploratory or agent-style follow-up work
Intent model
When routing automatically, first classify the request into a supervisor mode.
- signals: continue, session, resume, agent
- default tool: INLINECODE18
- signals: analyze, explain, review, compare, risk, audit, architecture
- default tool: INLINECODE19
- signals: implement, build, create, modify, refactor, fix, generate, develop
- default tool: INLINECODE20
- signals: demo, prototype, quick, lightweight, MVP, browser toy
- default tool:
codex, optionally followed by
claude review
- signals: production, maintainable, scalable, long-term, structured
- default tool:
claude first for stack and risk validation, then
codex for implementation
If the task is ambiguous between rapid delivery and long-term maintainability, decide explicitly and state that bias in the user-facing summary.
Pipelines
Do not treat multi-tool orchestration as “run everything and compare”. Prefer explicit worker roles.
1. implement_and_review
Use when the user wants a reliable default delivery flow.
- - Codex: implement
- Claude Code: architecture / review / risk check
- OpenCode: optional alternative plan or follow-up patch strategy
2. design_then_build
Use when UI, UX, or solution framing needs a first pass before coding.
- - planning / design worker: Claude Code or another design-capable tool if available
- Codex: implementation
- Claude Code: post-implementation review
3. investigate_then_fix
Use when the failure mode is unclear.
- - Claude Code or OpenCode: isolate cause, inspect risks, propose strategy
- Codex: implement fix
- reviewer: verify regression coverage and edge cases
4. parallel_compare
Use only when the user explicitly wants comparison, diversity of solutions, or tool benchmarking.
- - run multiple tools against the same scoped task
- compare outputs by correctness, maintainability, risk, and delivery speed
5. pr_hardening
Use after an implementation worker has produced a candidate result.
- - reviewers run in parallel or sequence
- collect blocking vs non-blocking issues
- if needed, hand a repair brief back to the implementation worker
Done policies
Completion must be defined by objective signals, not worker self-report.
Feature task
Recommended checks:
- - intended files changed
- build passes
- tests pass
- review completed or explicitly waived
- PR created when requested
- screenshot attached when UI changed and a screenshot requirement exists
Bugfix task
Recommended checks:
- - defect scope identified
- fix applied in intended area
- relevant tests pass or regression coverage added
- no new lint / type failures introduced
Review-only task
Recommended checks:
- - review artifact produced
- issues classified into blocking / non-blocking
- recommendation clearly stated
Prototype task
Recommended checks:
- - runnable artifact exists
- usage or launch instructions exist
- result is demonstrable even if production hardening is deferred
Always report:
- - checks passed
- checks still pending
- checks failed
- whether the result is actionable now
Retry policy
Not all retries are the same.
Mechanical retry
Use when the failure is environmental or operational.
Examples:
- - CLI startup glitch
- transient shell error
- workdir mismatch
- temporary tool availability issue
- one-off install or permission hiccup
In this case, retry the same task with corrected execution conditions.
Semantic retry
Use when the worker moved in the wrong direction.
Examples:
- - solved Y instead of X
- ignored required file or type definition
- produced an overbuilt design when a narrow fix was needed
- skipped tests or changed the wrong surface
In this case, do not just rerun the same prompt.
Generate a retry brief that includes:
- - what the previous attempt did
- evidence of failure or mismatch
- what to preserve
- what to change
- extra context to inject
- the new acceptance focus
Example structure:
CODEBLOCK2
Progress reporting
Report objective state changes, not chatter.
Include
- - worker status per tool: queued / running / completed / failed
- current task lifecycle state
- whether work landed in the intended directory
- key artifact created
- done criteria met / unmet
- blocking issue if one exists
- recommended next action
Report on
- - major state change
- worker completion
- worker failure
- transition into review
- transition into retry
- final completion or terminal failure
Stay concise when
- - nothing material changed
- only timestamps changed
- the user did not request detailed check-ins
Resource scheduling
The likely bottleneck is often local machine capacity, not model intelligence.
Supervise concurrency intentionally.
Suggested weighting
- - review-only task = weight 1
- implementation task = weight 2
- build/test-heavy task = weight 3
Suggested policy
- - keep a configurable max total weight in flight
- queue additional tasks instead of launching everything at once
- avoid overlapping heavy installs/builds unless the machine can handle them
- isolate implementation tasks into separate worktrees
If RAM, CPU, or disk pressure becomes the real limit, treat that as a scheduler concern rather than a worker failure.
Bundled scripts
Read and use these files from the skill assets when they exist:
- - INLINECODE30
- INLINECODE31
- INLINECODE32
- INLINECODE33
- INLINECODE34
- INLINECODE35
- INLINECODE36
- INLINECODE37
- INLINECODE38
- INLINECODE39
- INLINECODE40
- INLINECODE41
The scripts are worker adapters. The orchestration logic should live at the supervisor level.
Operator controls
The orchestrator should support intervention.
Useful controls include:
- - steer a running worker
- pause or stop a task
- cancel a task
- relaunch from a corrected workdir
- reassign the task to another tool
- trigger review-only follow-up
- promote a failed implementation into an investigate-first pipeline
Known issues and mitigation
1. Path drift across mounted workspaces
Problem:
A tool may not see the intended OpenClaw workspace path and may silently continue in another mounted path.
Mitigation:
- - inspect the actual reachable workdir before delegating
- verify output landed in the intended project directory
- if drift is detected, stop and relaunch with a corrected directory
2. Noisy wrapper output
Problem:
Wrapper output can still include startup banners, MCP warnings, and shell-specific error framing.
Mitigation:
- - treat cleaned summaries as best-effort
- inspect raw excerpts when results look suspicious
- tighten cleaning rules over time based on real outputs
3. False completion
Problem:
A worker process can exit even though the real task is not review-ready or done.
Mitigation:
- - use done policies tied to objective checks
- separate worker exit from task completion state
- require explicit supervisor transition to INLINECODE42
- if a worker only produces analysis or a patch plan, do not mark implementation complete unless repo changes actually landed
4. Adapter-layer execution failure
Problem:
A worker adapter or wrapper may fail even when the underlying worker logic is still usable.
Examples include PowerShell wrapper framing, stdout/stderr capture quirks, or PTY / shell integration issues.
Mitigation:
- - classify wrapper failures separately from task failures
- distinguish adapter failure from implementation failure in supervisor summaries
- if needed, relaunch the same worker brief through a simpler execution path while preserving supervisor-only boundaries
- do not silently rewrite task history to make an adapter failure look like product progress
5. Static retries
Problem:
Blindly rerunning the same prompt wastes time and tokens when the first attempt misunderstood the task.
Mitigation:
- - classify retries as mechanical vs semantic
- generate retry briefs for semantic failures
- preserve evidence from the failed attempt
6. Lightweight prototype bias
Problem:
The orchestrator may prefer a lightweight prototype path when the task is ambiguous, even if the user would benefit from a more structured stack.
Mitigation:
- - ask or decide explicitly between rapid prototype and maintainable project modes
- use review output to validate stack choice before implementation
7. Write-blocked worker runtimes
Problem:
A worker may be able to inspect and reason about the target repo but still be unable to apply edits because the runtime is read-only or policy-blocked.
Mitigation:
- - classify this as an environment or policy blocker, not a semantic task failure
- preserve the worker's exact patch plan as an artifact
- mark implementation checks as pending when no repo changes landed
- let the supervisor report that the task is blocked-by-runtime-write-capability rather than blocked-by-unclear-requirements
Practical patterns learned
Implementation + audit split
A strong default for real coding work is:
- - Codex: implementation lead
- Claude Code: architecture / audit / review
- OpenCode: alternative plan or session-style supplement
Reviewers are role-based, not democratic
The point of multiple workers is not equal voting. The point is specialized pressure from different angles.
Prefer:
- - one implementation lead
- one architecture/risk reviewer
- one optional alternative-plan or repair worker
Objective completion beats conversational completion
Do not ask a worker “are you done?” when you can inspect:
- - process state
- files created
- git diff
- test results
- review artifact existence
- PR existence
Start narrow, then automate discovery
Before adding proactive task discovery from meeting notes, bug trackers, or logs, first make sure the orchestrator can:
- - persist tasks
- supervise retries
- enforce done policies
- schedule safely
Output contract
When reporting back to the user, prefer this shape:
- - current lifecycle state
- what each worker contributed
- objective checks passed / failed / pending
- consensus
- differences
- recommendation
- next action
- blocker classification when relevant
- whether implementation actually landed in the repo or only an analysis/patch artifact was produced
Blocker classification
When a task cannot advance, classify the blocker explicitly.
Do not collapse all failures into a generic blocked state.
Recommended blocker types:
- runtime missing required capability
- repo path unavailable
- missing dependencies in allowed environment
- write commands blocked
- execution path denied by sandbox or policy gate
- wrapper script failure
- PTY or stdout/stderr integration failure
- orchestration-layer execution bug
- worker found a real product/code issue that still needs changes
- worker misunderstood the task or changed the wrong scope
- multiple blocker classes materially apply
Supervisor reporting should name:
- - blocker type
- evidence
- whether retrying unchanged would help
- recommended next action
Terminal and near-terminal supervisor outcomes
Use explicit end-state wording in summaries even when the internal task state machine remains simple.
Recommended outcome labels:
- - INLINECODE49
- INLINECODE50
- INLINECODE51
- INLINECODE52
- INLINECODE53
- INLINECODE54
- INLINECODE55
- INLINECODE56
- INLINECODE57
Notes:
- -
completed-with-analysis-only is useful when the worker produced a valid artifact, review, or patch plan, but did not land repo changes. - INLINECODE59 is useful when implementation scope is clear and bounded, but no writable worker runtime is available.
- INLINECODE60 should be used when the worker path failed in the orchestration wrapper layer and the product task itself may still be viable.
Operator quick start
For the current v2 scaffold, the practical operator flow is:
- 1. initialize a task record
- move it to INLINECODE61
- run
supervise-task.ps1 with -AutoLaunch for safe automatic worker launch - add
-AutoProbe when you want a lightweight repo/runtime probe before deeper execution - run
reconcile-worker.ps1 or supervise-task.ps1 again to fold background worker state back in - only use retry generation when the problem is semantic rather than environmental
See also:
- - INLINECODE67
- INLINECODE68
- INLINECODE69
- INLINECODE70
- INLINECODE71
- INLINECODE72
- INLINECODE73
- INLINECODE74
- INLINECODE75
- INLINECODE76
Publishing workflow
After stabilizing the local skill:
- 1. update
SKILL.md and bundled scripts - verify local folder structure and task artifact paths
- publish with INLINECODE78
- install/sync and validate in the local OpenClaw environment
本地编码编排器
使用此技能将OpenClaw作为本地编码CLI的轻量级监督器运行。
此技能已从路由助手演变为v2编排脚手架。目标不仅仅是向工具路由提示。目标是接收编码工作,将其分配给正确的本地工作器,跟踪目标进度,协调审查,协调后台执行,并智能重试,直到任务达到明确的完成状态或明确的阻塞状态。
使命
当用户希望OpenClaw作为本地编码工具之上的编排层运行时,使用此技能。
这包括以下情况:
- - 在codex、claude和opencode之间选择
- 将实现和审查作为独立的工作器角色运行
- 跨工具比较输出
- 引导长时间运行的本地编码会话
- 通过任务文件、状态转换和审查循环监督编码工作
此技能用于持久编排,而不仅仅是一次性的提示转发。
严格的监督边界
默认立场:此技能是工作的监督者、协调者和审查者,而不是动手实现者。
这意味着OpenClaw通常应:
- - 定义任务
- 选择并启动正确的工作器
- 协调工作器输出
- 验证目标检查
- 路由到审查/重试/加固
- 向用户报告进度和决策
而OpenClaw通常应不:
- - 直接编辑属于委派任务的产品代码
- 通过自行实现来静默替换失败的工作器
- 在同一阶段混合协调者声音和实现者声音
- 仅基于工作器声称完成就报告任务完成
何时允许直接编辑
监督者直接编辑是例外,而非默认。
允许的情况:
- - 修复编排器技能本身
- 修复任务元数据、任务记录或编排脚本
- 进行解除监督阻塞所需的小型非产品变更
- 用户明确指示直接接管实现
如果监督者进行了直接编辑,应明确说明并区分:
工作器优先策略
对于目标仓库内的编码任务,优先采用此顺序:
- 1. 当环境可行性不明确时,使用工作器进行探测
- 使用工作器进行实现
- 使用审查工作器或明确的监督审查阶段进行审查
- 如果审查要求更改,通过工作器重试简报进行加固
除非用户明确要求速度而非严格编排,否则不要将这些步骤合并为一个模糊的通行。
多工作器编排
当任务受益于多个工具时,监督者应分配不同的角色,而不是让每个工作器做所有事情。
推荐模式:
- - 一个主要实现者
- 一个审查者/规划者
- 一个次要审查者或备选实现者
监督者应定期检查进度,而不是一直等到最后。
定期监督意味着检查:
- - 仓库更改是否实际落地
- 工作器是否停滞或循环
- 审查者是否同意下一个边界
- 工作器特定的阻塞是否需要重新路由或更精确的简报
监督者应将审查输出综合为具体的下一步行动。
不要只是将三个不协调的意见转发给用户。
此技能的假设
机器具有以下本地CLI可用:
它还假设您可以创建项目特定的工作目录,将工件保留在磁盘上,并安全地运行本地后台进程。
执行模型
将编排器视为三层系统。
1. 接收层
接收层将用户请求转换为结构化任务。
至少捕获:
- - 任务ID
- 仓库路径(首选)或仓库标识符
- 工作树/分支计划
- 任务类型
- 请求的结果
- 成功标准
- 首选工具或路由模式
- 敏感级别
- 是否需要审查
- 是否需要测试、构建检查、截图或PR创建
2. 工作器层
工作器层运行一个或多个本地编码CLI。
工作器应在可行的情况下隔离:
- - 每个实现任务使用单独的工作树或分支
- 每个工作器使用单独的日志
- 每次尝试使用单独的提示快照
- 每个审查者使用单独的审查输出
工作器是工具专家,而非监督者。
3. 监督层
监督层是此技能的核心。
它应:
- - 启动工作器
- 记录状态转换
- 检查客观信号,而不是信任自我报告的完成
- 决定任务是阻塞、准备审查、完成还是需要重试
- 当工作器解决了错误问题时,为重试重写提示
- 以协调者的声音向用户总结结果
任务生命周期
将工作建模为持久状态机,而不是一次性运行。
推荐状态:
- - 草稿
- 已排队
- 运行中
- 等待审查
- 已请求更改
- 重试中
- 已阻塞
- 已完成
- 已失败
- 已取消
使用显式转换。不要静默地将进程已退出视为任务已完成。
任务记录
为每个编排单元保留一个JSON任务文件。
推荐目录结构:
text
local-orchestrator/
tasks/
logs/
prompts/
reviews/
state/
推荐任务记录格式:
json
{
id: feat-custom-templates,
repo: my-repo,
worktree: ../worktrees/feat-custom-templates,
branch: feat/custom-templates,
taskType: feature,
role: implementer,
agent: codex,
status: running,
attempt: 1,
maxAttempts: 3,
createdAt: 1772958600000,
updatedAt: 1772959200000,
successCriteria: [
build passes,
tests pass,
review complete
],
artifacts: {
logPath: local-orchestrator/logs/feat-custom-templates.log,
promptPath: local-orchestrator/prompts/feat-custom-templates-attempt-1.md,
reviewPath: local-orchestrator/reviews/feat-custom-templates.md,
prUrl: null
}
}
确切模式可以演变,但编排器应始终留下持久的审计跟踪。
对于更完整的当前模式形状,优先使用docs/task-schema.v1.json和docs/task-schema.example.json,而不是此简化的内联示例。
路由和角色指导
工具选择应反映工作器角色,而不仅仅是用户的原始措辞。
默认角色映射
- 实现主导
- 后端逻辑
- 复杂修复
- 多文件重构
- 直接代码生产
- 架构审查
- 风险分析
- 代码审查
- 需求澄清
- 可维护性评估
- 会话延续
- 备选实现计划
- 探索性或代理式后续工作
意图模型
自动路由时,首先将请求分类为监督模式。
- 信号:继续、会话、恢复、代理
- 默认工具:opencode
- 信号:分析、解释、审查、比较、风险、审计、架构
- 默认工具:claude
- 信号:实现、构建、创建、修改、重构、修复、生成、开发
- 默认工具:codex
- 信号:演示、原型、快速、轻量、MVP、浏览器玩具
- 默认工具:codex,可选后跟claude审查
- 信号:生产、可维护、可扩展、长期、结构化
- 默认工具:先使用claude进行堆栈和风险验证,然后使用codex进行实现
如果任务在快速交付和长期可维护性之间模糊不清,请明确决定并在面向用户的摘要中说明该偏向。
流水线
不要将多工具编排视为运行所有内容并比较。优先使用明确的工作器角色。
1. 实现并审查
当用户想要可靠的默认交付流程时使用。
- - Codex:实现
- Claude Code:架构/审查/风险检查
- OpenCode:可选的备选计划或后续补丁策略
2. 设计然后构建
当UI、UX或解决方案框架在编码前需要初步设计时使用。
- - 规划/设计工作器:Claude Code或其他可用的设计能力工具
- Codex:实现
- Claude Code:实现后审查
3. 调查然后修复
当故障模式不明确时使用。
- - Claude Code或OpenCode:隔离原因、检查风险、提出策略
- Codex:实现修复
- 审查者:验证回归覆盖和边缘情况
4. 并行比较
仅在用户明确要求比较、解决方案多样性或工具基准测试时使用。