Skip to content

Conversation

@dicksontsai
Copy link
Contributor

Problem

4 agent .md files have YAML frontmatter that fails to parse. The description field contains multi-line content with <example> blocks, and lines like user:, assistant:, and Context: 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 {}, missing name and description).

Fix

Use YAML block scalars (|) for the description field 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.md
  • plugins/plugin-dev/agents/skill-reviewer.md
  • plugins/plugin-dev/agents/plugin-validator.md
  • plugins/pr-review-toolkit/agents/code-simplifier.md

Validation

Wrote a script (scratch/validate-frontmatter.ts) replicating the exact parsing logic from claude-cli-internal/src/utils/frontmatterParser.ts (same regex, same yaml v2 library, same two-pass strategy with auto-quoting fallback). Before: 4 errors. After: 0 errors.

Use YAML block scalars (|) for multi-line description fields that contain
<example> blocks with colons and special characters. Without block scalars,
the YAML parser fails because it interprets lines like 'user:' and
'assistant:' as new key-value pairs.

Affected files:
- plugins/plugin-dev/agents/agent-creator.md
- plugins/plugin-dev/agents/skill-reviewer.md
- plugins/plugin-dev/agents/plugin-validator.md
- plugins/pr-review-toolkit/agents/code-simplifier.md
@dicksontsai dicksontsai merged commit 91736b9 into main Feb 5, 2026
1 check passed
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.

2 participants