fix(tools): exclude nested skill docs from strategy-3 flat search - #43342
Closed
cjakma wants to merge 1 commit into
Closed
fix(tools): exclude nested skill docs from strategy-3 flat search#43342cjakma wants to merge 1 commit into
cjakma wants to merge 1 commit into
Conversation
skill_view strategy-3 (rglob) was picking up reference/template .md files nested inside another skill's SKILL.md directory and returning them as candidates for a different skill name. Add an ancestor-walk that skips any file whose parent chain contains a SKILL.md between it and the search root — those are assets of the enclosing skill, not standalone skills. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Thanks for the focused fix. Current
Automated hermes-sweeper review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
skill_viewstrategy-3 usesrglob(f"{name}.md")to find legacy flat skill docs. This was also picking up reference/template.mdfiles that live inside another skill's directory (e.g.skills/foundations/runtime/references/explore-codebase.md) and returning them as match candidates for an unrelated skill name.Added an ancestor-walk: if any directory between the found file and the search root contains a
SKILL.md, the file belongs to that enclosing skill and is excluded from strategy-3 results.How to test
Platforms tested
Changes
tools/skills_tool.py: strategy-3 loop now skips files whose ancestor chain contains aSKILL.md