Repository navigation
Conversation
…md title The body_heading check matched any line starting with '# ', so a shell or Python comment inside a fenced code block (or a '#' line in an HTML comment) satisfied it. A SKILL.md with no title then skipped the only HIGH body finding. Parse the body with markdown-it and require a non-empty ATX level-1 heading instead. Signed-off-by: JYunth <jyunth28@gmail.com>
| tokens = _BODY_PARSER.parse(body) | ||
| return any( | ||
| token.type == "heading_open" | ||
| and token.tag == "h1" |
There was a problem hiding this comment.
[P2] Require the H1 to be at document level
MarkdownIt also emits an h1 token for a heading nested inside a blockquote or list item. With > # Report example as the only H1, both validate --tiers 1 --checks schema and tier1 --checks schema exit 0 on this commit. The base exits 1 and reports the high-severity body_heading finding. I verified the same outcome for a heading nested in a list item.
Please require token.level == 0 and add a nested-heading regression alongside the fenced-code cases. The top-level H1 and fenced-comment controls already behave as intended on this commit.
There was a problem hiding this comment.
Good catch, thanks. Added the token.level == 0 check and blockquote and list-item cases to the test. > # Report example now fails validate --tiers 1 --checks schema and tier1 --checks schema again.
Signed-off-by: JYunth <jyunth28@gmail.com>
Summary
The body_heading check looked for any line starting with "# ", so a comment in a code block (e.g.
# install dependenciesin a bash example) passed as the skill's title. A skill with no title didn't get flagged. This parses the body with markdown-it, which is already a dependency, and only counts a real level-1 heading.Added tests for # lines in fenced code, indented code and HTML comments, plus one where a real title is still found after commented code.
Verification
make lintmake testmake buildRelease Impact
CHANGELOG.md