Skip to content

fix(validate): catch unquoted YAML frontmatter that runtime drops#30

Open
mxl wants to merge 1 commit into
antongulin:mainfrom
mxl:fix/yaml-frontmatter-validation
Open

fix(validate): catch unquoted YAML frontmatter that runtime drops#30
mxl wants to merge 1 commit into
antongulin:mainfrom
mxl:fix/yaml-frontmatter-validation

Conversation

@mxl

@mxl mxl commented Jun 24, 2026

Copy link
Copy Markdown

Problem

skill_validate accepted SKILL.md files with unquoted description: values containing : (colon-space). OpenCode runtime uses gray-matterjs-yaml which rejects these as malformed YAML mappings, silently dropping the skill from available skills.

Example that passed validation but failed at runtime:

description: Use when tasks involve PDF files: reading, extracting, creating.

Fix

Add strict YAML parse check via the yaml package before structural validation in validateSkill(). Returns clear error with line/column number and a hint to quote the value.

Changes

  • plugin/lib/validate.ts — Import yaml.parseDocument, add frontmatter parse check after extraction
  • plugin/package.json — Add yaml as explicit dependency
  • plugin/test/validate.test.ts — 11 regression tests covering valid quoted, invalid unquoted, and existing checks

Test results

55/55 tests pass, build succeeds.

skill_validate accepted SKILL.md files with unquoted description values
containing ': ' (colon-space). OpenCode runtime uses gray-matter → js-yaml
which rejects these as malformed YAML mappings, silently dropping the skill
from available skills.

Add strict YAML parse check via the yaml package before structural
validation. Returns clear error with line/column and quoting hint.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant