Fix YAML frontmatter parsing errors in agent descriptions #337
+127
−122
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
4 agent
.mdfiles have YAML frontmatter that fails to parse. Thedescriptionfield contains multi-line content with<example>blocks, and lines likeuser:,assistant:, andContext:are interpreted by the YAML parser as new key-value pairs instead of being part of the description string.This means these agents silently fail to load (the parser returns empty frontmatter
{}, missingnameanddescription).Fix
Use YAML block scalars (
|) for thedescriptionfield so the multi-line content (including<example>blocks with colons) is treated as a single string value. The block scalar content is indented by 2 spaces, and the subsequent frontmatter fields (model,color,tools) at column 0 naturally terminate the block.Files changed
plugins/plugin-dev/agents/agent-creator.mdplugins/plugin-dev/agents/skill-reviewer.mdplugins/plugin-dev/agents/plugin-validator.mdplugins/pr-review-toolkit/agents/code-simplifier.mdValidation
Wrote a script (
scratch/validate-frontmatter.ts) replicating the exact parsing logic fromclaude-cli-internal/src/utils/frontmatterParser.ts(same regex, sameyamlv2 library, same two-pass strategy with auto-quoting fallback). Before: 4 errors. After: 0 errors.