cli-opencode
FreeNo executable scriptsNot checkedOpenCode CLI orchestrator: external dispatch, in-OpenCode parallel sessions, cross-AI handback with full runtime context.
by MichelKerkmeester★ 40 GitHub starsAbout this skill
OpenCode CLI Orchestrator - Full-Runtime Cross-AI Dispatch
CRITICAL: SELF-INVOCATION PROHIBITED
If you run this skill inside OpenCode (TUI / acp / serve / run modes; detection signals in §8), you MUST refuse to load it and return the documented error message instead of dispatching. This skill dispatches to the OpenCode CLI binary (
opencode). Only an explicit "parallel detached" request is exempt. It must intentionally spawn a SEPARATE session with its own session id and state directory.A running CLI skill never dispatches itself. The cli-X skills are for cross-AI delegation only, never self-invocation.
Orchestrate OpenCode 2's opencode run from external AI assistants (Claude Code, OpenCode, raw shell) AND from inside an existing OpenCode session for parallel detached workers. Three documented use cases keep the cycle risk explicit and give every dispatch path a copy-paste invocation shape.
Core Principle: The calling AI stays the conductor. Delegate to OpenCode for what it does best: the full plugin, skill, and MCP runtime in a one-shot dispatch. Validate and integrate the output.
1. WHEN TO USE
Activation Triggers
- Full plugin / skill / MCP runtime (use case 1): calling AI is Claude Code / OpenCode / Copilot / raw shell AND the task needs the project's spec folders and continuity docs, or every plugin/skill/MCP tool in a one-shot dispatch. Includes
@deep-research/@deep-reviewagent loops with externalized state under.opencode/specs/. - Parallel detached session (use case 2): operator already inside OpenCode (TUI / web / serve / acp) AND wants a SEPARATE session with its own session id and state directory for ablation, worker farm, or parallel research. Prompt explicitly mentions "parallel detached", "ablation suite", "worker farm", "parallel research", "spawn detached", or "share URL".
- Agent dispatch: Use this when a task matches a specialized OpenCode agent.
- Primary agents (directly invokable via
--agent):plan(built-in),orchestrate.generalis a subagent; omit--agentto run it. - The orchestrate primary fully dispatches generic subagents:
context,review,write,debug,ai-council. - Their parent
/deep:*command owns the loop executors end-to-end:deep-research,deep-review,prompt-improver. orchestratemay make exactly one bounded hand-off to a recognized loop request, but never manages the loop.- See §3 for the full contract.
- Primary agents (directly invokable via
- Cross-repo dispatch: a session in repo A dispatches into repo B's plugin/skill/MCP runtime via
--server <url>and a start-in-directorycd.
When NOT to Use
- You ARE OpenCode already. If your runtime is OpenCode (detection signals in §8), this skill refuses to load.
- Self-invocation creates a circular dispatch loop and burns tokens for no value. The cli-X family is exclusively for cross-AI delegation.
- Only an explicit "parallel detached" request is exempt; it must intentionally spawn a SEPARATE session id and state directory (use case 2).
- Without that qualifier, the smart router refuses per ADR-001.
- Simple, quick tasks where
opencode runoverhead is not worth it. - Tasks that only need a raw model dispatch. Use a sibling cli-* skill.
- Tasks requiring interactive TUI or web UI (use
opencodedirectly instead ofopencode run). - Context already loaded and understood by the calling AI.
- Tasks where the OpenCode binary is not installed at the expected path.
2. SMART ROUTING
The cli-external-orchestration hub routes an OpenCode dispatch here: the request names OpenCode, opencode run, a parallel detached session or a full plugin runtime, and the hub's cli-opencode mode signal selects this packet.
A session already inside OpenCode is refused unless the request asks for a parallel detached session.
The hub ROUTER.md names the two leaves an OpenCode dispatch starts from.
Three use cases route here: external dispatch, parallel detached session and cross-AI handback.
Inside this packet the ALWAYS tier loads first: references/cli-reference.md and assets/prompt-quality-card.md.
A request that maps to no use case returns UNKNOWN_FALLBACK with a disambiguation checklist rather than a silent default.
Read ROUTER.md before selecting skill-local resources; open only the matched files.
3. HOW IT WORKS
Execution Ownership
This packet owns user-facing routing, the OpenCode binary probe, prompt construction and the self-invocation guard.
For research and review lineages, the shared deep-loop runtime at ../../system-deep-loop/runtime/scripts/fanout-run.cjs owns process construction and execution, using executor kind cli-opencode.
That runner accepts only the research and review loop types, so a single build or doc dispatch uses the child dispatch envelope in providers-and-models.md §5.
Do not add a packet-local wrapper, spawn pat
Install cli-opencode in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
BashReadGlobGrepBundled files
FAQ
What does the cli-opencode skill do?
OpenCode CLI orchestrator: external dispatch, in-OpenCode parallel sessions, cross-AI handback with full runtime context.
How do I install the cli-opencode skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the cli-opencode skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic