Skip to content

fix(lint): record skill frontmatter values for selector coverage#216

Merged
swedishborgie merged 1 commit into
kitproj:mainfrom
swedishborgie:fix/skill-frontmatter-coverage
May 13, 2026
Merged

fix(lint): record skill frontmatter values for selector coverage#216
swedishborgie merged 1 commit into
kitproj:mainfrom
swedishborgie:fix/skill-frontmatter-coverage

Conversation

@swedishborgie
Copy link
Copy Markdown
Collaborator

validateSelectorCoverage checks each user-supplied selector against
lintCollector.allFrontmatterValues, the set of key/value pairs seen across
all discovered markdown files. That map was populated only from
makeMarkdownWalkFunc (tasks/commands/rules); loadSkillEntry recorded the
skill file but never its frontmatter values.

Result: a selector key declared only in SKILL.md frontmatter (e.g. a plugin
key injected by an upstream plugin converter into a skill-only plugin's
SKILL.md) would falsely trigger selector '<k>=<v>' matched no discovered files, even though the matching skill loaded and was included successfully.

Fix: call recordFrontmatterValues(frontmatter.BaseFrontMatter) alongside
the existing recordFile call in loadSkillEntry, matching the order used
in makeMarkdownWalkFunc (record before the MatchesIncludes filter so
coverage reflects every discovered file, not only matched ones).

Adds TestLint_SelectorMatched_FromSkillFrontmatter covering the regression.
No change to runtime (Run()) behavior — MatchesIncludes already parses
the skill frontmatter directly; only Lint()'s coverage check was affected.

Branch-Creation-Time: 2026-05-13T13:12:22+0000
Copy link
Copy Markdown
Collaborator

@nettapper nettapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@swedishborgie swedishborgie merged commit 4b1d82d into kitproj:main May 13, 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