Skip to content

fix(server): read SKILL.md frontmatter as YAML - #1629

Merged
Emanuele-web04 merged 1 commit into
Emanuele-web04:mainfrom
MarMarLabs:fix/skill-frontmatter-block-scalars
Oct 7, 2026
Merged

Emanuele-web04 merged 1 commit into
Emanuele-web04:mainfrom
MarMarLabs:fix/skill-frontmatter-block-scalars

Conversation

@MarMarLabs

Copy link
Copy Markdown
Contributor

What Changed

parseSkillFrontmatter in apps/server/src/provider/skillsCatalog.ts now reads SKILL.md frontmatter with the yaml package, which apps/server already depends on. Frontmatter that is not valid YAML still goes through the old line reader, so loosely written files read as before.

On the YAML path:

  • Only string and boolean values are kept. Maps and lists are skipped, so a key nested under another key can no longer replace a top-level one.
  • A short-description under a metadata: map is still read. A top-level short-description wins if both exist.
  • Duplicate-key checking is off. That check is quadratic in the number of keys, and skill files can come from repositories the user opens. A repeated key keeps its last value, as it did with the line reader.
  • YAML warnings are off, so an unusual tag in a skill file does not print a process warning on every scan.

Four tests are added to skillsCatalog.test.ts. They cover a folded and a literal block scalar next to a nested map, the metadata: short description, a 40,000-key frontmatter, and the fallback for invalid YAML.

Why

A SKILL.md can write its description as a YAML block scalar, description: >- or description: |. The line reader stored the indicator itself, so Settings > Agent skills, the plugin library and the composer / menu showed >- or | where the description should be. The line reader also treated every indented line as a top-level key, so a name: or description: inside a metadata: map replaced the real value.

On my machine the skills catalog has 333 skill files, and 54 of them read as a bare >, >- or | description. With this change none do. Names, enabled flags and short descriptions are the same as on main for all 333.

This is the only SKILL.md frontmatter reader in Synara's code. The skills catalog that Settings shows, and that is merged into every provider's skill list, goes through it. yaml is already a dependency of apps/server, which uses it to read one provider's config file. So this swaps the parsing step instead of growing the line reader to cover more of YAML.

A few valid-YAML values read differently from before:

  • A value YAML reads as a number or null, such as name: 2048 or description: ~, is ignored. The name falls back to the folder name.
  • # starts a comment in an unquoted value, so description: Fix issues like #12 reads as Fix issues like.
  • A quoted "true" in disable-model-invocation is a string and no longer disables the skill.
  • Quoted escapes are decoded, so 'It''s' reads as It's.

None of these occurs in the 333 files on my machine.

UI Changes

Skill descriptions in Settings > Agent skills, in the real app (Synara Canary). Before is main at 48603e8 and after is this branch. Both runs use the same five fake skills in the Synara skills folder.

Fake skill Before After
fm-folded-demo, description as a folded block (>-) over two lines >- Folded demo description that spans two lines.
fm-literal-demo, description as a literal block (|) over two lines | Literal demo, first line. Literal demo, second line.
fm-nested-demo, a top-level description plus a name: and description: under metadata: a row titled fm-wrong-name with Nested description (wrong) a row titled fm-nested-demo with Top-level description (correct), and no fm-wrong-name row
fm-short-demo, a short-description under metadata: Short text kept under metadata unchanged
fm-loose-demo, description: Use when: the user asks for a demo (not valid YAML) unchanged unchanged

From Synara skills, before
From Synara skills, after

The composer / menu lists these skills from a second source, labelled User, which already showed the right descriptions before this change. There the change removes the extra fm-wrong-name row the base build added from the Synara catalog. fm-short-demo shows its long description in that menu on both builds, which this change does not touch.

Composer /fm- menu, before
Composer /fm- menu, after

Verification

From the repo root, bun run fmt:check, bun run lint and bun run typecheck pass. Lint reports the same 5 warnings in the two touched files as main does.

From apps/server, bun run test src/provider/skillsCatalog.test.ts src/provider/cursorSkillsDiscovery.test.ts src/provider/Layers/ProviderDiscoveryService.test.ts src/provider/FactoryPluginDiscovery.test.ts passes with 4 files and 53 tests.

Each new test fails without the part of the change it covers. On main the block scalar test fails and the other three pass. With YAML's default options the 40,000-key test fails its 3 s limit (19 to 30 s across my runs), against about 0.3 s with this change. Without the metadata: read the short description test fails, and without the line reader fallback the invalid YAML test fails.

A read-only count over the skill folders on my machine, with no skill text printed: 333 skill files, 54 bare indicators before and 0 after, and none that YAML failed to parse.

No platform or process code changed, so I did not run windows-runtime:check.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

A skill whose SKILL.md writes its description as a YAML block scalar
(`description: >-` or `|`) showed the bare `>-` or `|` as its
description in Settings, the plugin library and the composer skill
menu. Nested `name:` or `description:` keys under another key could
also replace the real top-level values. The frontmatter is now parsed
with the `yaml` package the server already depends on, with its
quadratic duplicate-key check off and a short description under
`metadata:` still read. Frontmatter that is not valid YAML still goes
through the old line reader, so loosely written files read as before.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS Under 50 changed lines, excluding tests, lockfiles, generated files, and assets. labels Oct 7, 2026
@Emanuele-web04
Emanuele-web04 merged commit b6e7ab6 into Emanuele-web04:main Oct 7, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS Under 50 changed lines, excluding tests, lockfiles, generated files, and assets. vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants