Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tools/skills_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,8 +1049,22 @@ def _record(sd: Optional[Path], smd: Path) -> None:
_record(found_skill_md.parent, found_skill_md)

# Strategy 3: legacy flat <name>.md files anywhere under the dir.
# Exclude files nested inside another skill's directory (any ancestor
# between found_md and search_dir that contains its own SKILL.md).
# Those are reference/template assets, not standalone skills.
for found_md in search_dir.rglob(f"{name}.md"):
if found_md.name != "SKILL.md":
if found_md.name == "SKILL.md":
continue
in_other_skill = False
for p in found_md.parents:
if p == search_dir:
break
if search_dir not in p.parents:
break
if (p / "SKILL.md").exists():
in_other_skill = True
break
if not in_other_skill:
_record(None, found_md)

if len(candidates) > 1:
Expand Down