@@ -269,3 +269,34 @@ func TestLint_Command_Tracked(t *testing.T) {
269269 t .Errorf ("expected command file in LoadedFiles, got %+v" , result .LoadedFiles )
270270 }
271271}
272+
273+ // TestLint_SelectorMatched_FromSkillFrontmatter verifies that frontmatter keys
274+ // declared in SKILL.md files contribute to the selector-coverage 'seen' map.
275+ // Regression test: previously loadSkillEntry recorded the file but not its
276+ // frontmatter values, so a selector key declared only in skill frontmatter
277+ // (e.g. a plugin whose only converted output is a SKILL.md) would falsely
278+ // trigger 'selector matched no discovered files'.
279+ func TestLint_SelectorMatched_FromSkillFrontmatter (t * testing.T ) {
280+ t .Parallel ()
281+ dir := lintTestDir (t )
282+
283+ createTask (t , dir , "task1" , "" , "Do stuff." )
284+ createSkill (t , dir , ".agents/skills/myskill" ,
285+ "---\n name: myskill\n description: A skill that declares a custom selector key.\n category: alpha\n ---\n body" )
286+
287+ cc := New (
288+ WithSearchPaths (dir ),
289+ WithSelectors (map [string ]map [string ]bool {
290+ "category" : {"alpha" : true },
291+ }),
292+ )
293+
294+ result , err := cc .Lint (context .Background (), "task1" )
295+ if err != nil {
296+ t .Fatalf ("Lint() returned error: %v" , err )
297+ }
298+
299+ if hasLintError (result , LintErrorKindSelectorNoMatch , "category=alpha" ) {
300+ t .Errorf ("skill frontmatter should satisfy selector coverage, got errors: %+v" , result .Errors )
301+ }
302+ }
0 commit comments