一键导入
cli-runner
A built-in skill to trigger CLI_Runner (cliorch) for complex, multi-model, and agentic code interventions with HITL protection.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
A built-in skill to trigger CLI_Runner (cliorch) for complex, multi-model, and agentic code interventions with HITL protection.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | cli-runner |
| description | A built-in skill to trigger CLI_Runner (cliorch) for complex, multi-model, and agentic code interventions with HITL protection. |
This skill teaches Claude how to offload complex, multi-step, or risky coding tasks to the local CLI_Runner framework (cliorch).
Whenever the user asks you to:
Do NOT manually generate large boilerplate or use raw bash for complex operations. Delegate it to cliorch instead!
Execute the following Node.js command in the terminal to invoke the CLI_Runner's task orchestration engine:
node src/cli.js do --task "<describe the task context completely>" --strategy <strategy_name>
--strategy <name>.--strategy fast_code.--strategy default.Once you execute node src/cli.js do, the CLI_Runner OS will:
node src/cli.js models).User: "Can you rewrite the entire logging module and ensure tests pass? Use the fast code strategy."
Claude:
(Action: run command)
node src/cli.js do --task "Rewrite the entire logging module in src/logger/ and ensure the test suite passes" --strategy fast_code
Let CLI_Runner handle the orchestration and just relay the output back to the user!
Use this mode when tasks are large enough to be split into independent sub-tasks that can be executed in parallel, each in its own git worktree by a dedicated CLI instance.
Main Orchestrator (Claude Code Session)
|
+-- Dispatch Task A --> git worktree .wt/feat-a (branch: feat/task-a) --> cliorch instance A
+-- Dispatch Task B --> git worktree .wt/feat-b (branch: feat/task-b) --> cliorch instance B
+-- Dispatch Task C --> git worktree .wt/feat-c (branch: feat/task-c) --> cliorch instance C
Sync Layer (file-based, in TARGET project root)
.cliorch/tasks/
task-a.json { id, branch, worktree, status, startedAt, completedAt, output, errors }
task-b.json
task-c.json
Merge Phase (main Session, sequential or parallel)
git merge feat/task-a --> conflict HITL --> test --> git merge feat/task-b --> ...
Break the top-level task into independent sub-tasks. Each sub-task must:
feat-auth, feat-tests, feat-docs)For each sub-task, run the following sequence:
# 1. Create the worktree and branch in the TARGET project directory
git -C <project-dir> worktree add .wt/<slug> -b feat/<slug>
# 2. Write the task manifest so the main session can track it
# File: <project-dir>/.cliorch/tasks/<slug>.json
# Content:
{
"id": "<slug>",
"branch": "feat/<slug>",
"worktree": ".wt/<slug>",
"status": "pending",
"startedAt": null,
"completedAt": null,
"output": null,
"errors": []
}
# 3. Launch cliorch in the worktree directory (background or new terminal)
cd <project-dir>/.wt/<slug> && node <cliorch-path>/src/cli.js do \
--task "<sub-task description>" \
--strategy <strategy_name>
Use dispatch-task.sh to automate the above:
bash dispatch-task.sh <project-dir> <slug> "<task>" <strategy> <cliorch-path>
The main Session polls the manifest directory to track all sub-task statuses:
node wt-status.js <project-dir>
Output:
TASK BRANCH STATUS STARTED
------------------------------------------------------------------------
feat-auth feat/feat-auth done 2026-03-06 10:00:00
feat-tests feat/feat-tests running 2026-03-06 10:01:00
feat-docs feat/feat-docs pending -
Summary: 1 done, 1 running, 0 failed, 1 pending / 3 total
Repeat until all tasks are done or failed before proceeding to merge.
bash wt-merge.sh <project-dir> [--skip-failed]
Merges all done branches in dependency order (respecting dependsOn). On conflict, presents 4-option HITL:
[1] Open mergetool (resolve manually)
[2] Abort this branch (skip)
[3] Accept ours (keep main)
[4] Accept theirs (use branch)
Dependency ordering: Declare dependencies in the manifest:
{
"id": "feat-tests",
"dependsOn": ["feat-auth"],
"...": "..."
}
# Run integration tests after all merges
npm test # or your project's test command
# Clean up worktrees after successful merge
git worktree list
git worktree remove .wt/feat-auth
git worktree remove .wt/feat-tests
# Clean up manifests
rm -rf .cliorch/tasks/
| Command | Purpose |
|---|---|
cliorch do --task "..." --strategy <name> | Execute a task end-to-end |
cliorch plan --task "..." | Generate a plan JSON without executing |
cliorch run --plan <path> | Execute a pre-generated plan |
cliorch options | Show strategy / stage / LLM options |
cliorch models | List available models from all providers |
cliorch status | Show CLI registry status |
cliorch redteam | Print security red-team checklist |
plans/, logs/, outputs/ directories (relative to CLI_Runner root)..cliorch/tasks/ directory to be accessible to all CLI instances.ContextManager (src/memory/contextManager.js) persists failure knowledge across sessions — each sub-CLI instance benefits from shared memory if CLI_Runner root is the same.askApproval.js) blocks dangerous commands; worktree merge conflicts follow the same HITL pattern.api_mode: 'anthropic' for direct API calls without subprocess overhead.