local-coding-orchestrator
by @lijiejoy
Use OpenClaw as a supervisor-driven orchestration scaffold for local coding CLIs such as Codex, Claude Code, and OpenCode. Supports task records, lifecycle t...
clawhub install local-coding-orchestrator📖 About This Skill
name: local-coding-orchestrator description: Use OpenClaw as a supervisor-driven orchestration scaffold for local coding CLIs such as Codex, Claude Code, and OpenCode. Supports task records, lifecycle transitions, worker launch and reconcile, retry briefs, pipeline presets, and environment-aware blocking for local coding workflows.
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:
codex, claude, and opencodeThis 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:
And OpenClaw should normally not:
When direct edits are allowed
Direct edits by the supervisor are the exception, not the default.
Allowed cases:
If the supervisor makes a direct edit, it should say so clearly and distinguish:
Worker-first policy
For coding tasks inside the target repo, prefer this order: 1. probe with a worker when environment viability is unclear 2. implement with a worker 3. review with a reviewer worker or explicit supervisor review phase 4. 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:
The supervisor should then periodically check progress rather than waiting until the very end.
Periodic supervision means checking:
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:
codexclaudeopencodeIt 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:
2. Worker layer
The worker layer runs one or more local coding CLIs.
Workers should be isolated where practical:
Workers are tool specialists, not supervisors.
3. Supervisor layer
The supervisor layer is the core of this skill.
It should:
Task lifecycle
Model work as a persistent state machine instead of a one-shot run.
Recommended states:
draftqueuedrunningawaiting-reviewchanges-requestedretryingblockedcompletedfailedcancelledUse 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:
local-orchestrator/
tasks/
logs/
prompts/
reviews/
state/
Recommended task record shape:
{
"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
}
}
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
Intent model
When routing automatically, first classify the request into a supervisor mode.
opencodeclaudecodexcodex, optionally followed by claude reviewclaude first for stack and risk validation, then codex for implementationIf 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.
2. design_then_build
Use when UI, UX, or solution framing needs a first pass before coding.
3. investigate_then_fix
Use when the failure mode is unclear.
4. parallel_compare
Use only when the user explicitly wants comparison, diversity of solutions, or tool benchmarking.
5. pr_hardening
Use after an implementation worker has produced a candidate result.
Done policies
Completion must be defined by objective signals, not worker self-report.
Feature task
Recommended checks:
Bugfix task
Recommended checks:
Review-only task
Recommended checks:
Prototype task
Recommended checks:
Always report:
Retry policy
Not all retries are the same.
Mechanical retry
Use when the failure is environmental or operational.
Examples:
In this case, retry the same task with corrected execution conditions.
Semantic retry
Use when the worker moved in the wrong direction.
Examples:
In this case, do not just rerun the same prompt.
Generate a retry brief that includes:
Example structure:
Retry reason:
Worker implemented a net-new creation flow.
Required outcome is editing and reusing existing configuration. Adjustments:
Focus on reuse/edit flows, not greenfield creation.
Reuse src/types/template.ts.
Add tests for mutation of existing configuration objects.
Do not spend time polishing unrelated UI.
Progress reporting
Report objective state changes, not chatter.
Include
Report on
Stay concise when
Resource scheduling
The likely bottleneck is often local machine capacity, not model intelligence.
Supervise concurrency intentionally.
Suggested weighting
Suggested policy
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:
assets/scripts/run-codex.ps1assets/scripts/run-claude-code.ps1assets/scripts/run-opencode.ps1assets/scripts/route-task.ps1assets/scripts/multi-orchestrate.ps1assets/scripts/task-state.ps1assets/scripts/evaluate-done.ps1assets/scripts/generate-retry-brief.ps1assets/scripts/start-pipeline.ps1assets/scripts/supervise-task.ps1assets/scripts/launch-worker.ps1assets/scripts/reconcile-worker.ps1The scripts are worker adapters. The orchestration logic should live at the supervisor level.
Operator controls
The orchestrator should support intervention.
Useful controls include:
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:
2. Noisy wrapper output
Problem: Wrapper output can still include startup banners, MCP warnings, and shell-specific error framing.
Mitigation:
3. False completion
Problem: A worker process can exit even though the real task is not review-ready or done.
Mitigation:
completed4. 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:
5. Static retries
Problem: Blindly rerunning the same prompt wastes time and tokens when the first attempt misunderstood the task.
Mitigation:
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:
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:
Practical patterns learned
Implementation + audit split
A strong default for real coding work is:
Reviewers are role-based, not democratic
The point of multiple workers is not equal voting. The point is specialized pressure from different angles.
Prefer:
Objective completion beats conversational completion
Do not ask a worker “are you done?” when you can inspect:
Start narrow, then automate discovery
Before adding proactive task discovery from meeting notes, bug trackers, or logs, first make sure the orchestrator can:
Output contract
When reporting back to the user, prefer this shape:
Blocker classification
When a task cannot advance, classify the blocker explicitly. Do not collapse all failures into a generic blocked state.
Recommended blocker types:
environmentpolicyadapterimplementationsemanticmixedSupervisor reporting should name:
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:
completedcompleted-with-analysis-onlyblocked-by-environmentblocked-by-policyblocked-by-adapterchanges-requestedready-for-hardeningretry-with-semantic-briefawaiting-writable-runtimeNotes:
completed-with-analysis-only is useful when the worker produced a valid artifact, review, or patch plan, but did not land repo changes.awaiting-writable-runtime is useful when implementation scope is clear and bounded, but no writable worker runtime is available.blocked-by-adapter 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
2. move it to queued
3. run supervise-task.ps1 with -AutoLaunch for safe automatic worker launch
4. add -AutoProbe when you want a lightweight repo/runtime probe before deeper execution
5. run reconcile-worker.ps1 or supervise-task.ps1 again to fold background worker state back in
6. only use retry generation when the problem is semantic rather than environmental
See also:
docs/README.mddocs/usage-guide.mddocs/operator-playbook.mddocs/status.mddocs/v2-summary.mddocs/CHANGELOG.mddocs/capability-map.mddocs/script-interface.mddocs/environment-failures.mddocs/review-output-format.mdPublishing workflow
After stabilizing the local skill:
1. update SKILL.md and bundled scripts
2. verify local folder structure and task artifact paths
3. publish with clawhub publish
4. install/sync and validate in the local OpenClaw environment