Skip to content

feat: add skills.format config option to control skill serialization format #24824

@andrewgwoodruff

Description

@andrewgwoodruff

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions