Problem
When OpenCode loads skills from a project with many Claude Code skills, the system prompt can reach 40KB+, with the skills listing serialized as XML tags (<available_skills>, <skill>, <description>, etc.). For some local Ollama models this XML structure causes them to switch into XML output mode — specifically, models like qwen3-coder and devstral revert to HERMES XML tool-call format instead of JSON, which OpenCode can't parse. Tool invocations then fail silently or log invalid Invalid Tool.
There's currently no way to change this serialization format without patching OpenCode directly.
Proposed solution
Add a skills.format config option ("xml" | "json" | "markdown") that lets users control how skills are serialized into the system prompt. The default stays "xml" — no behavior changes for existing users. Users who hit format-related tool-calling issues with local models can opt into "json" or "markdown" as a workaround.
{
"skills": {
"format": "json"
}
}
Evidence
Tested with devstral:24b via Ollama, 50 runs each, same system prompt and tool definitions — only the skills serialization format varied:
| Format |
Pass rate |
| XML (current default) |
68% (34/50) |
| Markdown |
74% (37/50) |
| JSON |
86% (43/50) |
Related
Problem
When OpenCode loads skills from a project with many Claude Code skills, the system prompt can reach 40KB+, with the skills listing serialized as XML tags (
<available_skills>,<skill>,<description>, etc.). For some local Ollama models this XML structure causes them to switch into XML output mode — specifically, models like qwen3-coder and devstral revert to HERMES XML tool-call format instead of JSON, which OpenCode can't parse. Tool invocations then fail silently or loginvalid Invalid Tool.There's currently no way to change this serialization format without patching OpenCode directly.
Proposed solution
Add a
skills.formatconfig option ("xml"|"json"|"markdown") that lets users control how skills are serialized into the system prompt. The default stays"xml"— no behavior changes for existing users. Users who hit format-related tool-calling issues with local models can opt into"json"or"markdown"as a workaround.{ "skills": { "format": "json" } }Evidence
Tested with devstral:24b via Ollama, 50 runs each, same system prompt and tool definitions — only the skills serialization format varied:
Related
promptfield is not sent as system message to Ollama-compatible local models #24239: agentpromptfield / system message handling with local models