Skip to content

fix(skills): read block scalar descriptions instead of indexing the > header - #227

Merged
Max17190 merged 3 commits into
mainfrom
skill-description-block-scalars
Aug 19, 2026
Merged

fix(skills): read block scalar descriptions instead of indexing the > header#227
Max17190 merged 3 commits into
mainfrom
skill-description-block-scalars

Conversation

@Max17190

@Max17190 Max17190 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

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

  • One description parser (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.
  • --check names an empty description as empty (a bare key, or a block header with nothing under it) rather than as absent.

Test Plan

  • New 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_named extended with a hollow block header (warns "an empty") and a folded description (healthy).
  • Confirmed on the built binary that the live skill above now indexes with its folded description.
  • cargo test --workspace green; 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.

T-Rex T-Rex Logs

What T-Rex did

  • I ran an external Rust harness against the real skills::parse_skill_source and templates::parse_template_source entry points, plus the repository’s focused block-scalar unit test.
  • The parent commit previously folded two-space and deeper lines, but the current commit returns only "four-space".
  • The current commit updates the frontmatter handling by excluding two-space content from description: >4, accepting six-space content, and selecting the last duplicate description for skills and the first duplicate description for templates.
  • The focused unit test passed, confirming the corrected behavior is covered.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "fix(skills): infer block scalar indentat..." | Re-trigger Greptile

…>` 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.
Comment thread crates/core/src/skills.rs Outdated
Comment thread crates/core/src/templates.rs Outdated
…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.
Comment thread crates/core/src/skills.rs Outdated
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.
@Max17190
Max17190 merged commit efe4e02 into main Aug 19, 2026
4 checks passed
@Max17190
Max17190 deleted the skill-description-block-scalars branch August 19, 2026 03:50
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.

1 participant