Repository navigation
fix(server): read SKILL.md frontmatter as YAML - #1629
Merged
Emanuele-web04 merged 1 commit intoOct 7, 2026
Merged
Emanuele-web04 merged 1 commit into
Emanuele-web04 merged 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
parseSkillFrontmatterinapps/server/src/provider/skillsCatalog.tsnow reads SKILL.md frontmatter with theyamlpackage, whichapps/serveralready 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:
short-descriptionunder ametadata:map is still read. A top-levelshort-descriptionwins if both exist.Four tests are added to
skillsCatalog.test.ts. They cover a folded and a literal block scalar next to a nested map, themetadata: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: >-ordescription: |. 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 aname:ordescription:inside ametadata: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.
yamlis already a dependency ofapps/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:
name: 2048ordescription: ~, is ignored. The name falls back to the folder name.#starts a comment in an unquoted value, sodescription: Fix issues like #12reads asFix issues like."true"indisable-model-invocationis a string and no longer disables the skill.'It''s'reads asIt'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.
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 aname:anddescription:undermetadata:fm-wrong-namewithNested description (wrong)fm-nested-demowithTop-level description (correct), and nofm-wrong-namerowfm-short-demo, ashort-descriptionundermetadata:Short text kept under metadatafm-loose-demo,description: Use when: the user asks for a demo(not valid YAML)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 extrafm-wrong-namerow the base build added from the Synara catalog.fm-short-demoshows its long description in that menu on both builds, which this change does not touch.Verification
From the repo root,
bun run fmt:check,bun run lintandbun run typecheckpass. 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.tspasses 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