From 8b2507a877926b2b0829b3d1e5bacf516e69e396 Mon Sep 17 00:00:00 2001 From: Vicaversa Date: Thu, 5 Mar 2026 00:36:40 +0300 Subject: [PATCH] Fix hidden directory filter broken on Windows (fixes #389) Both _find_all_skills() and scan_skill_commands() used hardcoded forward-slash strings ('/.git/', '/.hub/') to filter hidden dirs. On Windows, str(Path(...)) returns backslash paths so the filter never matched, exposing quarantined skills to users. Replace string-based check with Path.parts membership test which works on all platforms. --- agent/skill_commands.py | 2 +- tools/skills_tool.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/skill_commands.py b/agent/skill_commands.py index fc11c53125f9..0870fbeec3f6 100644 --- a/agent/skill_commands.py +++ b/agent/skill_commands.py @@ -27,7 +27,7 @@ def scan_skill_commands() -> Dict[str, Dict[str, Any]]: return _skill_commands 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 try: content = skill_md.read_text(encoding='utf-8') diff --git a/tools/skills_tool.py b/tools/skills_tool.py index f118b2037f73..a34b119d2d99 100644 --- a/tools/skills_tool.py +++ b/tools/skills_tool.py @@ -197,7 +197,7 @@ def _find_all_skills() -> List[Dict[str, Any]]: 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