[dotnet-port] Align fsskills nested discovery with .NET - #348
Conversation
Stop recursive skill root discovery once a SKILL.md is found so nested files remain part of the parent skill instead of becoming independent skill roots. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the file-system skill discovery logic to match the .NET behavior by treating a directory containing SKILL.md as a terminal “skill root” (i.e., do not recursively discover nested skill roots beneath it). This prevents nested SKILL.md files from being interpreted as separate skills and instead keeps nested content logically under the parent skill root.
Changes:
- Stop recursive skill-root discovery once a
SKILL.mdis found in a directory. - Add a unit test asserting that a nested
SKILL.mdunder a skill root does not produce an additional discovered skill.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
agent/skills/fsskills/source.go |
Adds an early return to halt further recursive discovery once a skill root is detected. |
agent/skills/fsskills/source_test.go |
Adds coverage ensuring nested SKILL.md does not create an independent skill. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Cross-repo parity reviewThe Go change in However, the Python equivalent — the inner def _search(directory: str, current_depth: int) -> None:
dir_path = Path(directory)
if (dir_path / SKILL_FILE_NAME).is_file():
discovered.append(str(dir_path.absolute()))
# ← no return; recursion continues into subdirectories
if current_depth >= MAX_SEARCH_DEPTH:
return
for entry in entries:
if entry.is_dir():
_search(str(entry), current_depth + 1)This means for a layout like:
This is a meaningful behavioral divergence for any user who authors nested Suggested follow-up: open a tracking issue (or add a comment here) and align the Python implementation to add an early
|
Stop recursive skill root discovery once a SKILL.md is found so nested files remain part of the parent skill instead of becoming independent skill roots.