Усилить использование question в OpenCode

This commit is contained in:
2026-04-13 15:08:56 +03:00
parent aa124b98af
commit f1392045a6
3 changed files with 41 additions and 1 deletions

View File

@@ -47,3 +47,11 @@
- After changes, run `dotnet build`. If MCP wiring changed, also run the inspector. - After changes, run `dotnet build`. If MCP wiring changed, also run the inspector.
- Output in Russian. Keep code in English. Keep comments and commit messages in Russian. - Output in Russian. Keep code in English. Keep comments and commit messages in Russian.
- If the request is broad or underspecified, ask one short clarifying question first. Otherwise act on the best reasonable assumption. - If the request is broad or underspecified, ask one short clarifying question first. Otherwise act on the best reasonable assumption.
### OpenCode: Question First
- Before replying with a prose list of options, use OpenCode `question` whenever there are 2+ meaningful options and the user has not already chosen a direction.
- Apply this aggressively for choices about architecture, config, output format, priorities, naming, and execution direction.
- Skip `question` only when the request is already specific, only one valid answer exists, or the choice is cosmetic and does not affect execution.
- After the user answers, continue immediately and do not restate the same options in prose.
- If `question` is unavailable, ask one short plain-text question.
- If a blocking choice is needed before using a subagent, ask it in the primary agent first.

View File

@@ -0,0 +1,26 @@
# OpenCode Question Policy
Prefer `question` over prose option lists when clarification will materially change the result.
## When To Use `question`
- Use it when there are 2+ meaningful and mutually exclusive options.
- Use it when the answer changes architecture, config, output format, naming, priorities, workflow direction, or another blocking implementation choice.
- Ask in the primary agent before delegating to a subagent if the answer must steer delegated work.
## When Not To Use `question`
- Skip it when the user already gave a specific direction.
- Skip it when only one valid answer exists.
- Skip it when the choice is cosmetic and does not affect execution.
## How To Ask
- Ask 2-4 options per question.
- Put the recommended option first.
- Keep labels short and descriptions to one sentence each.
- Combine related blocking decisions into one `question` call when possible, with at most 3 questions in the dialog.
- Do not print a prose preface like `Вот варианты:` before calling the tool.
- Do not add an `Other` or `Другое` option unless free-form input is not available; the OpenCode UI already supports custom input.
## After The Answer
- Continue the task immediately.
- Do not repeat the full option list in prose unless the user asks for a recap.
- If `question` is unavailable, ask one short plain-text question instead.

View File

@@ -2,5 +2,11 @@
"$schema": "https://opencode.ai/config.json", "$schema": "https://opencode.ai/config.json",
"model": "ollama/qwen3.5-agent", "model": "ollama/qwen3.5-agent",
"small_model": "ollama/qwen3.5-agent", "small_model": "ollama/qwen3.5-agent",
"instructions": [ "AGENTS.md" ] "instructions": [
"AGENTS.md",
"docs/opencode/question-policy.md"
],
"permission": {
"question": "allow"
}
} }