Skip to content

fix(skill): malformed YAML frontmatter in using-ao SKILL.md breaks OpenCode (all platforms) #2925

Description

@i-trytoohard

Bug

OpenCode sessions crash on startup with ConfigFrontmatterError when AO materializes the using-ao skill into .opencode/skills/using-ao/SKILL.md.

Reported on Windows but not platform-specific — it breaks on every OS.

Error

ConfigFrontmatterError: ConfigFrontmatterErrorInput
  data: SyntaxError: Unexpected end of JSON input
  message: "Failed to parse YAML frontmatter: incomplete explicit mapping pair; a key node is missed"
  path: "...\.opencode\skills\using-ao\SKILL.md"
  at parse9 (src/config/markdown.ts:24:17)

Root cause

The description and trigger fields in the embedded frontmatter (backend/internal/skillassets/using-ao/SKILL.md) are unquoted YAML plain scalars that contain ": " (colon-space) sequences:

description: Catalog of the AO (Agent Orchestrator) `ao` CLI: spawning workers, ...
trigger: Using the ao CLI in an AO workspace: spawning workers, ...

In YAML, ": " terminates a plain scalar (it is the mapping-pair indicator). The parser reads CLI as the end of the value and treats spawning workers... as a new mapping key with no value → incomplete explicit mapping pair; a key node is missed.

Confirmed with PyYAML:

mapping values are not allowed here
  in "<unicode string>", line 2, column 61

Fix

Quote both fields:

description: "Catalog of the AO (Agent Orchestrator) `ao` CLI: spawning workers, ..."
trigger: "Using the ao CLI in an AO workspace: spawning workers, ..."

Files changed:

  • backend/internal/skillassets/using-ao/SKILL.md — quote description and trigger
  • backend/internal/skillassets/skillassets_test.go — add TestEmbeddedSkillFrontmatterIsValidYAML regression test that parses the frontmatter with gopkg.in/yaml.v3

The existing tests only checked strings.Contains(skillBody, "name: using-ao") — string presence, not YAML validity. The new test fails on the old code and passes on the fix.

Repro

  1. ao spawn <issue> --harness opencode on any platform
  2. OpenCode starts, tries to load the materialized skill
  3. js-yaml rejects the frontmatter → ConfigFrontmatterError → session dies

Tested

go test ./internal/skillassets/... -v -count=1  # 3/3 PASS
go test ./internal/adapters/agent/opencode/...   # all PASS
go vet ./internal/skillassets/...                # OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions