anomalyco / anomalyco/opencode
Skills emit unescaped XML metacharacters into model context
@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
-
Create a skill with this valid frontmatter:
--- name: comparison description: Compare A < B & C --- -
Add a sampled resource such as
references/a&b.md. -
Inspect the available-skills context and the output returned by the
skilltool.
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 < B & C</description>
<file>/path/to/references/a&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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.