Skip to content

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

Closed as not planned

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

Activity

  1. added
    core
    on Apr 28, 2026
  2. changed the title [-]bug: Large XML-heavy system prompt causes qwen3-coder:30b (Ollama) to output HERMES XML instead of JSON tool calls[/-] [+]bug: Large XML-heavy system prompt breaks tool calling across multiple Ollama models (Qwen3, Qwen2.5, Devstral)[/+] on Apr 28, 2026
  3. andrewgwoodruff commented on Apr 28, 2026

    @andrewgwoodruff
    Author

    Additional testing — confirmed model-agnostic

    Ran the same three-tier tests against two additional models to see how broad the format sensitivity is.

    Models tested

    Model Family Size Tool call result with XML system prompt
    qwen3-coder:30b Qwen 18GB HERMES XML output
    qwen2.5-coder:32b Qwen 19GB Plain-text JSON {"name":"bash","arguments":{...}}
    devstral:24b Mistral 14GB Plain-text JSON (test 1), hallucinated without tool call (test 2), no output at all (test 3)

    Tests run per model

    1. Simple tool call: "List files in the current directory using a bash command"
    2. File read + analysis: "Read README.md and give me a one sentence summary"
    3. Multi-step: "Find all TypeScript files in apps/ai, read one, tell me what it does"

    Takeaway

    The format sensitivity isn't Qwen-specific — it shows up across model families in different ways. This strengthens the case for a skills.format config option so users can choose the serialization format that works best for their model rather than being locked into XML.

  4. andrewgwoodruff commented on Apr 28, 2026

    @andrewgwoodruff
    Author

    Follow-up: format comparison testing

    Ran controlled tests to quantify how much the serialization format actually matters. Tested XML (current default), Markdown, and JSON against devstral:24b via Ollama, 50 runs each, same system prompt and tool definitions across all three.

    Format Prompt size Pass rate
    XML (current default) 7,019 bytes 68% (34/50)
    Markdown 3,654 bytes 74% (37/50)
    JSON 6,611 bytes 86% (43/50)

    JSON and XML are nearly the same prompt size, so the difference is about format, not token count. This suggests a skills.format config option with "json" or "markdown" as available values would give local model users a meaningful improvement without changing the default for anyone.

  5. changed the title [-]bug: Large XML-heavy system prompt breaks tool calling across multiple Ollama models (Qwen3, Qwen2.5, Devstral)[/-] [+]feat: add skills.format config option to control skill serialization format[/+] on Apr 30, 2026
  6. removed
    core
    on May 3, 2026
  7. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions