anomalyco / anomalyco/opencode

Skills emit unescaped XML metacharacters into model context

Open
#43,012 2 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 17, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Skill metadata and resource paths are inserted into XML-like model context without consistently escaping XML metacharacters.

Skill.fmt(..., { verbose: true }) escapes location, but inserts description directly. The skill tool also inserts sampled file paths directly into <file> elements. Valid descriptions and filesystem paths can contain characters such as &, <, and >, which makes the model-visible structure malformed or ambiguous.

Plugins

None

OpenCode version

1.18.10; also present on dev at 4d68d30b

Steps to reproduce
  1. Create a skill with this valid frontmatter:

    ---
    name: comparison
    description: Compare A < B & C
    ---
    
  2. Add a sampled resource such as references/a&b.md.

  3. Inspect the available-skills context and the output returned by the skill tool.

Current output contains raw dynamic values:

<description>Compare A < B & C</description>
<file>/path/to/references/a&b.md</file>

Expected output escapes those values:

<description>Compare A &lt; B &amp; C</description>
<file>/path/to/references/a&amp;b.md</file>

A focused fix can reuse the existing escapeHtml helper and add regression coverage around Skill.fmt and the skill tool output.

Screenshot and/or share link

Not applicable

Operating System

macOS

Terminal

zsh

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.