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