fix: use Path.parts for hidden directory filter in skill listing

The hidden directory filter used hardcoded forward-slash strings like
'/.git/' and '/.hub/' to exclude internal directories. On Windows,
Path returns backslash-separated strings, so the filter never matched.

This caused quarantined skills in .hub/quarantine/ to appear as
installed skills and available slash commands on Windows.

Replaced string-based checks with Path.parts membership test which
works on both Windows and Unix.
This commit is contained in:
Farukest 2026-03-04 18:34:16 +03:00
parent 70a0a5ff4a
commit f93b48226c
No known key found for this signature in database
GPG key ID: 73E2756B3FFF5241
3 changed files with 97 additions and 4 deletions

View file

@ -196,8 +196,7 @@ def _find_all_skills() -> List[Dict[str, Any]]:
return skills
for skill_md in SKILLS_DIR.rglob("SKILL.md"):
path_str = str(skill_md)
if '/.git/' in path_str or '/.github/' in path_str or '/.hub/' in path_str:
if any(part in ('.git', '.github', '.hub') for part in skill_md.parts):
continue
skill_dir = skill_md.parent