fix(skills): read block scalar descriptions instead of indexing the > header - #227
Merged
Conversation
…>` header SKILL.md and prompt-template frontmatter read `description:` as one line. A YAML block scalar (`description: >` followed by indented lines, the multi-line spelling third-party skill packages ship) therefore indexed as the single character `>`, and `openmax --check` reported the skill as ok: the model saw a name with no "when", and the check that exists to explain such gaps said nothing. Both frontmatter readers now share one description parser that folds a `>`/`|` block scalar (with the usual chomping and indentation indicators) into the one line the index carries; bare and double-quoted values read as before. `--check` names an empty description as empty (a bare key, or a block header with nothing under it) rather than as absent. Tests: folded, literal, chomped, and indented headers fold to one line and stop at the next key; a header with nothing under it is an empty description; a `>` inside an ordinary value is not a header. The doctor test covers the hollow and folded files. The parser test fails with block headers read as their literal spelling.
…ep first-key Review findings: a header such as `>4` accepted content indented by any amount, so under-indented text populated the index; the digit is now the minimum depth and shallower content ends the block (`>0` is not a header). Prompt templates previously kept the first duplicate `description:` key and had switched to the last through the shared parser; the parser now returns every value in order and each surface keeps the rule it always had (SKILL.md last, templates first), pinned by tests.
Without an explicit digit, the first non-blank line sets the block's depth, as YAML infers it; a later shallower line ends the block instead of folding in, so unevenly indented frontmatter cannot leak unrelated text into the index. Reported by review; pinned by the parser test.
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.
Why
SKILL.md and prompt-template frontmatter read
description:as one line. A YAML block scalar (description: >followed by indented lines, the multi-line spelling third-party skill packages ship) therefore indexed as the single character>, andopenmax --checkreported the skill as ok: the model saw a name with no "when", and the check that exists to explain such gaps said nothing. Observed live: a third-party skill in this repo's.agents/skills/rendered in the frozen prompt as- gh-stack: > — .agents/skills/gh-stack/SKILL.md.Summary
skills::frontmatter_description) shared by SKILL.md and prompt templates: bare and double-quoted values as before;>/|block scalars (with the usual chomping and indentation indicators) fold to the one line the index carries and stop at the next key.--checknames an empty description as empty (a bare key, or a block header with nothing under it) rather than as absent.Test Plan
block_scalar_descriptions_fold_to_one_line: folded, literal, chomped, and indented headers; a header with nothing under it; a>inside an ordinary value. Fails with block headers read as their literal spelling.skill_descriptions_that_the_index_cannot_carry_are_namedextended with a hollow block header (warns "an empty") and a folded description (healthy).cargo test --workspacegreen; clippy at zero warnings.Greptile Summary
This change adds shared support for multi-line skill and prompt-template descriptions. Explicit indentation is enforced, implicit indentation is derived from the first content line, and duplicate descriptions retain each surface’s established selection behavior.
Confidence Score: 5/5
No blocking failure remains.
Executed parser checks confirmed that malformed scalar indentation is excluded and that skills and templates retain their respective duplicate-description behavior.
What T-Rex did
Reviews (3): Last reviewed commit: "fix(skills): infer block scalar indentat..." | Re-trigger Greptile