ask-opencode
БесплатноЗапускает вложенные скриптыНе проверенConsult a model through opencode (headless `opencode run`) for an independent review of a design doc, spec, plan, PRD, decision, diff, or piece of code, then…
от xdg★ 20 звёзд на GitHubОб этом скилле
Ask Opencode
Ask a different model, reached through opencode, to critique an artifact, then report where it and you agree, disagree, and what changed your mind. The value is independence: the reviewer has none of this conversation's context, so it catches assumptions you and the user share without noticing.
This skill handles the opencode invocation details (read-only agent, model resolution, timeout, session cleanup) that otherwise misbehave.
Do NOT use for generic requests for a second opinion, outside review, sanity check, or another model; handle those yourself or ask which reviewer they want. "Ask codex" belongs to the ask-codex skill.
Invocation
Always go through the bundled script; never call opencode run directly.
scripts/ask-opencode.sh [-m MODEL] [-e EFFORT] [-t SECONDS] [-C DIR] PROMPT_FILE
scripts/ask-opencode.sh -r MODEL # resolve a model name only; no run
(scripts/ is relative to this skill's directory.)
The script exists because headless opencode has sharp edges:
- The default agent can edit files and run shell commands. The built-in
planagent denies edits but still allows shell. The script injects its own agent throughOPENCODE_CONFIG_CONTENTthat allows only read, grep, glob, and list inside the working directory, denies reading.envfiles, and denies thequestiontool (nobody can answer it headless). opencode checks grep permission against the search pattern rather than the file, so grep can still return.envcontents. The script prepends an instruction to every prompt telling the reviewer to keep.envand credential files out of its searches; that is a request, not enforcement. Do not point-Cat a directory where a leaked secret would be serious without telling the user. This needs--standalone, because the background service never sees a per-process environment variable. - Every run is saved as a session. The script deletes the session afterward.
- Output is a JSON event stream mixing narration, tool calls, and the answer. The script prints only the text of the final step. Any error event counts as failure: it exits nonzero and prints opencode's error message (e.g. "Variant unavailable ...") with any partial text.
- No
timeouton macOS. The script bounds the run withperl alarm(default 600s). Set the Bash tool's own timeout at least as high.
Write the prompt to a file in the scratchpad directory and pass the path. A long prompt on the command line is fragile (quoting, ARG_MAX).
-C DIR sets the working root; default is the current directory. The
reviewer resolves relative paths against it and cannot read outside it, so
point it at the repo root when the artifact references other files.
Choosing the model
Opencode takes --model provider/model#variant. Bare names like astra
are rejected, so the script resolves short names against opencode models:
- A value containing
/passes through unchanged. - Otherwise it lowercases the name, turns spaces into
-, and looks for a model whose last path segment equals it, then for IDs containing it. Exactly one hit wins. - Zero or several hits exit 3 with the candidate list.
Map what the user said to -m:
A model name in the request ("ask opencode Astra ...", "opencode with GLM", "have opencode opus look"): pass the name as
-m(-m astra,-m "gpt 6 luna"). Strip filler words like "the" or "model". If the user names a family and a version ("Sol 6.1"), pass the part most likely to be unique (-m 6.1-sol) or resolve first with-r.No model named: omit
-m. The user's opencode default is deliberate.Ambiguous (exit 3): pick from the candidates only when one is clearly what the user meant:
- Prefer the highest version when the user gave none (
gpt-6.1-solovergpt-5.6-sol). - Prefer
ai-gateway-*providers over directfireworks-ai/...entries for the same model. - Prefer plain model entries over
-priority,-spot,-fast, androuters/...variants unless the user asked for one.
If more than one candidate survives those rules (e.g. "kimi" covers both
kimi-k3andkimi-k2.7-code), ask the user, listing the survivors. Then rerun with the full ID.- Prefer the highest version when the user gave none (
No match: say so and show the closest entries from
opencode models(e.g.opencode models | rg -i <fragment>); do not guess.
Always tell the user the full model ID you used, especially when you picked it from candidates.
-e EFFORT sets the variant suffix (#low, #medium, #high, #xhigh,
#max on models that support reasoning effort). Use it only when the user
asks for an effort level ("ask opencode astra on max"); a #variant
already in -m wins. An unsupported variant fails with "Variant
unavailable"; report it rather than retrying with a different one.
Writing the prompt
The reviewer starts cold. The prompt is the whole briefing. Include:
- Role and stance. "You are an inde
Установить ask-opencode в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ask-opencode?
Consult a model through opencode (headless `opencode run`) for an independent review of a design doc, spec, plan, PRD, decision, diff, or piece of code, then reconcile its findings with your own view. Handles picking the model when the user names one ("ask opencode Astra ...", "have opencode kimi review this"). Use ONLY when the user explicitly names opencode.
Как установить скилл ask-opencode?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ask-opencode запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic