Repository navigation
fix: reject frontmatter plain scalars that start with a YAML indicator - #106
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
Contributor
|
thanks @RaphaelFakhri ! looks like we just need CI to pass |
Author
|
Rebased onto |
RaphaelFakhri
force-pushed
the
fix/frontmatter-plain-scalar-indicators
branch
from
October 29, 2026 12:37
f00bab6 to
05e4919
Compare
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:
npm run check:skillsnow fails when a frontmatter value is an unquoted scalar that starts with a YAML indicator character.Why: The frontmatter check exists so CI catches
SKILL.mdfiles that theskillsCLI cannot parse (see #38). It currently accepts plain values such asdescription: `/plan` before codingordescription: [Experimental] Run the factory. TheskillsCLI parses frontmatter withyaml, which rejects these values, so the CLI drops the skill from discovery without an error. Values that start with&,!, or#parse, but YAML treats the first token as an anchor, tag, or comment, so the description changes or disappears.What changed:
parsePlainScalarrejects plain values that start with[ ] { } , # & * ! | > ' " % @or a backtick, or with-,?, or:followed by whitespace. The error tells you to quote the value or use a folded block scalar, matching the existing:error.parseFrontmatteris exported, andmain()runs only when the script is executed directly, so the parser can be unit tested.scripts/check-skill-frontmatter.test.mjs(built-innode:test, no new dependencies) and annpm testscript.How to test:
npm test. Both tests pass.npm run check:skills. All existing skills remain valid.skills/demo/SKILL.mdwithname: demoanddescription: `/plan` before coding, then runnpm run check:skills. The check fails withplain scalars cannot start with ''. Before this change, it reported the file as valid, andnpx skills@1.7.4 add ./ --list` did not list the skill.Notes: No migrations or breaking changes. CI does not run
npm testyet. Adding a step to.github/workflows/ci.ymlis a possible follow-up.Fixes #105