Skip to content

fix: reject frontmatter plain scalars that start with a YAML indicator - #106

Open
RaphaelFakhri wants to merge 1 commit into
BuilderIO:mainfrom
RaphaelFakhri:fix/frontmatter-plain-scalar-indicators
Open

RaphaelFakhri wants to merge 1 commit into
BuilderIO:mainfrom
RaphaelFakhri:fix/frontmatter-plain-scalar-indicators

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Summary: npm run check:skills now 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.md files that the skills CLI cannot parse (see #38). It currently accepts plain values such as description: `/plan` before coding or description: [Experimental] Run the factory. The skills CLI parses frontmatter with yaml, 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:

  • parsePlainScalar rejects 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.
  • parseFrontmatter is exported, and main() runs only when the script is executed directly, so the parser can be unit tested.
  • Added scripts/check-skill-frontmatter.test.mjs (built-in node:test, no new dependencies) and an npm test script.

How to test:

  1. Run npm test. Both tests pass.
  2. Run npm run check:skills. All existing skills remain valid.
  3. Create skills/demo/SKILL.md with name: demo and description: `/plan` before coding, then run npm run check:skills. The check fails with plain scalars cannot start with ''. Before this change, it reported the file as valid, and npx skills@1.7.4 add ./ --list` did not list the skill.

Notes: No migrations or breaking changes. CI does not run npm test yet. Adding a step to .github/workflows/ci.yml is a possible follow-up.

Fixes #105

@steve8708

Copy link
Copy Markdown
Contributor

thanks @RaphaelFakhri ! looks like we just need CI to pass

@RaphaelFakhri

Copy link
Copy Markdown
Author

Rebased onto main. The check job failed because the branch predated the latest Agent Native skill exports. On the rebased branch, npm run check:skills, npm run check:agent-native-skills against current agent-native main, and npm test pass. The frontmatter check also accepts the skills added since, including efficient-orchestrator.

@RaphaelFakhri
RaphaelFakhri force-pushed the fix/frontmatter-plain-scalar-indicators branch from f00bab6 to 05e4919 Compare October 29, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontmatter check accepts plain scalars that start with a YAML indicator

2 participants