Skip to content

fix: handle multiline YAML block scalars in frontmatter parser#95

Open
themavik wants to merge 1 commit intoshareAI-lab:mainfrom
themavik:fix/79-frontmatter-multiline-description
Open

fix: handle multiline YAML block scalars in frontmatter parser#95
themavik wants to merge 1 commit intoshareAI-lab:mainfrom
themavik:fix/79-frontmatter-multiline-description

Conversation

@themavik
Copy link

@themavik themavik commented Mar 18, 2026

Summary

_parse_frontmatter() in s05_skill_loading.py fails 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.md uses a YAML block scalar for its description:

---
name: agent-builder
description: |
  Design and build AI agents for any domain. Use when users:
  (1) ask to "create an agent"...
---

The current parser splits each line independently on :, so description: | produces description"|". 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:

  1. Track the current key being parsed
  2. When a value is | or >, enter block scalar mode
  3. Accumulate indented continuation lines into the current key's value
  4. Flush the accumulated value when a new top-level key is encountered

Single-line values (description: Process PDF files) continue to work as before.

Testing

  • skills/agent-builder/SKILL.md (block scalar |): description correctly parsed as multiline string
  • skills/pdf/SKILL.md (inline value): description parsed correctly (unchanged behavior)
  • skills/code-review/SKILL.md (inline value with colons): description parsed correctly

Closes #79

_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
@vercel
Copy link

vercel bot commented Mar 18, 2026

@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.

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.

s05_skill_loading.py load SKILL.md bug

1 participant