fix(skills): match closing frontmatter delimiter on its own line#3739
Open
Quratulain-bilal wants to merge 1 commit into
Open
fix(skills): match closing frontmatter delimiter on its own line#3739Quratulain-bilal wants to merge 1 commit into
Quratulain-bilal wants to merge 1 commit into
Conversation
SkillsIntegration.setup parsed each command template's frontmatter with
raw.split("---", 2). A bare substring split stops at the first `---`
*anywhere*, so a template whose description embeds `---` (e.g.
"Separate sections with --- markers") truncated the parsed frontmatter:
later keys were dropped, the description fell back to the generic default,
and the leftover frontmatter spilled into the skill body.
Scan for the closing `---` on its own line instead, for both the
description parse and the body strip. The frontmatter block is parsed
unstripped so trailing newlines in literal (|) block scalars still survive,
and the body slice keeps the newline after the marker so output stays
byte-for-byte identical to the old split for well-formed templates.
Adds regression tests covering the dashed-description truncation and the
frontmatter-spilled-into-body cases.
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.
Problem
SkillsIntegration.setupparses each command template's frontmatter withraw.split("---", 2). A bare substring split stops at the first---anywhere — including one embedded inside a value. A template whose description contains---, e.g.is mis-parsed three ways:
Separate sections with(or dropped entirely, falling back to the genericSpec Kit: <name> workflow);Fix
Locate the closing
---on its own line (line-anchored scan) for both the description parse and the body strip, mirroring the hardenedCommandRegistrar.parse_frontmatterscan.|) block scalars still survive.split("---", 2)[2]for well-formed templates (verified with a differential check across normal / empty-body / trailing-space cases).Tests
Adds
TestSkillFrontmatterEmbeddedDashescovering the dashed-description truncation and the frontmatter-spilled-into-body cases. Both fail on the pre-fix code and pass after. Full skills integration suite: 342 passed, 3 skipped, 0 failures.