From opencode
Internal helper contract for calling the buddy runtime from Claude Code
How this skill is triggered — by the user, by Claude, or both
Slash command
/opencode:opencode-cli-runtimeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill only inside the `opencode:opencode-review` subagent (and, in future plans, `opencode:opencode-rescue`).
Use this skill only inside the opencode:opencode-review subagent (and, in future plans, opencode:opencode-rescue).
Primary helper for free-form prompt forwarding (the subagent's main mode):
node "${CLAUDE_PLUGIN_ROOT}/scripts/buddy.mjs" prompt --prompt-file <path> — REQUIRED form for the subagent. The prompt body must be written to a temp file via a quoted-delimiter heredoc; never inline the prompt text into the bash command line. See agents/opencode-review.md for the exact pattern.Secondary helper for git-diff convenience review (rarely used by the subagent — /opencode:review covers that):
node "${CLAUDE_PLUGIN_ROOT}/scripts/buddy.mjs" review "<flag-style args>"Tertiary helper for write-capable task delegation (used by opencode:opencode-run subagent):
node "${CLAUDE_PLUGIN_ROOT}/scripts/buddy.mjs" run --task-file <path> [--model <provider/model>] [--yolo] [--background] — same --task-file-under-allowed-dir contract as the prompt route. --yolo opts into --dangerously-skip-permissions (opencode writes without prompting); without it, opencode's own prompts apply and may block the subagent (in non-interactive contexts the companion now hard-rejects without --yolo).When to use which:
prompt — review / Q&A / no file modifications expected.run — explicit task delegation that may modify files.review — git-diff convenience for the user-facing slash command (rarely used by subagents).Other input modes for prompt:
... prompt <positional words> — joined by space; only safe when the prompt is known to contain no shell metacharacters. The subagent never uses this; reserved for ad-hoc CLI testing.--stdin is explicitly NOT supported in plan 000 (security review deferred — it would enable arbitrary file reads via shell redirection).Execution rules:
prompt for forwarded review requests from the orchestrator. The orchestrator constructs the full review prompt (including any references to specific files, focus questions, or expected output format).review only when the orchestrator explicitly says "review the working-tree diff" or "review the branch diff" without supplying its own prompt text.setup from the review subagent — /opencode:setup is a user-facing command.Output:
verdict: line for routing decisions; do not reformat or strip it.Trailer behavior — important contract difference between the two routes:
review route: the prompt explicitly asks the model for a trailer. Missing trailer → verdict: needs-attention (parse error) is always printed.prompt route: the orchestrator may or may not have asked for a trailer. If a trailer is present, the script prints both the text and a parsed verdict line. If no trailer is present, the script prints the text only — no verdict line is synthesized. Orchestrators that need a verdict signal must include hybrid-output instructions in the prompt body (typically a fenced JSON block with verdict and blockers).Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mongmong/claudecode-buddy --plugin opencode