fix: handle multiline YAML block scalars in frontmatter parser#95
Open
themavik wants to merge 1 commit intoshareAI-lab:mainfrom
Open
fix: handle multiline YAML block scalars in frontmatter parser#95themavik wants to merge 1 commit intoshareAI-lab:mainfrom
themavik wants to merge 1 commit intoshareAI-lab:mainfrom
Conversation
_parse_frontmatter() splits each line on ':' independently, so YAML block scalars like 'description: |' followed by indented continuation lines are parsed as description='|' with the actual content lost. Rewrite the parser to track the current key and accumulate indented continuation lines for block scalar values (| and >). Closes shareAI-lab#79 Made-with: Cursor
|
@themavik is attempting to deploy a commit to the crazyboym's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
_parse_frontmatter()ins05_skill_loading.pyfails to parse YAML block scalar descriptions (using|or>) in SKILL.md files, resulting in the description being read as just|instead of the actual multiline content.Problem
The
agent-builder/SKILL.mduses a YAML block scalar for its description:The current parser splits each line independently on
:, sodescription: |producesdescription→"|". The indented continuation lines are either ignored (no:) or misinterpreted.Root cause
The line-by-line
split(":", 1)approach has no concept of multiline YAML values. It cannot accumulate indented continuation lines that belong to a block scalar key.Fix
Rewrite
_parse_frontmatter()to:|or>, enter block scalar modeSingle-line values (
description: Process PDF files) continue to work as before.Testing
skills/agent-builder/SKILL.md(block scalar|): description correctly parsed as multiline stringskills/pdf/SKILL.md(inline value): description parsed correctly (unchanged behavior)skills/code-review/SKILL.md(inline value with colons): description parsed correctlyCloses #79