fix(skill-catalog): fold block-scalar descriptions instead of leaking |/> (#1711)#1713
Open
twidtwid wants to merge 1 commit into
Open
fix(skill-catalog): fold block-scalar descriptions instead of leaking |/> (#1711)#1713twidtwid wants to merge 1 commit into
|/> (#1711)#1713twidtwid wants to merge 1 commit into
Conversation
… `|`/`>` list_skills/get_skill returned the literal block-scalar indicator as a skill's description when SKILL.md used `description: |` or `description: >`: the single-line regex captured `|` (length 1 > 0), so the `?? firstProseLine(body)` fallback never fired. parseDescriptionField now folds block-scalar content into one line (handling chomping/indent indicators like `|-`, `>2`) and returns undefined for an empty block so the body fallback still works. Inline descriptions are unchanged. Fixes garrytan#1711
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.
Summary
Fixes #1711 —
list_skills/get_skillreturned the literal YAML block-scalar indicator (|or>) as a skill's description for anySKILL.mdauthored withdescription: |(or>).Root cause
src/core/skill-catalog.ts→parseDescriptionField:The single-line regex captured the block indicator
|(length 1 > 0), sooneLineDescription's?? firstProseLine(body)fallback never fired.Fix
parseDescriptionFieldnow detects a block-scalar header (|/>with optional chomping+/-and indent digit, optional trailing comment), folds the following indented lines into a single line, and returnsundefinedfor an empty block so the body fallback still works. Inline (and quoted) descriptions are unchanged.Tests
Added 4 cases to the existing
oneLineDescriptionsuite intest/skill-catalog.test.ts:|)>)|-)Scope: catalog-display only; no data path or
get_skillbody change.