Repository navigation
Support nested skill discovery without skills directories - #13894
tommaso-moro wants to merge 4 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request updates gh skills discovery and related command flows to support repositories where SKILL.md files live in arbitrarily nested, non-hidden directories (without requiring a skills/ directory), while preserving existing conventions (namespaced, plugins, root, hidden dirs) and ensuring installations/search results remain unambiguous when duplicate leaf names exist.
Changes:
- Expand skill discovery to match nested
<category>/<skill>/SKILL.mdlayouts and update “no skills found” messaging accordingly. - Preserve exact repository paths through search result deduplication and installation, and disambiguate duplicates in interactive prompts/errors.
- Add/adjust tests for nested discovery, ambiguity handling, and installation argument behavior.
Show a summary per file
| File | Description |
|---|---|
| pkg/cmd/skills/search/search.go | Pass exact SKILL.md paths through install-from-search and improve interactive disambiguation for duplicate names. |
| pkg/cmd/skills/search/search_test.go | Add coverage for path-preserving deduplication, prompt disambiguation, and install subprocess argument formation. |
| pkg/cmd/skills/publish/publish.go | Update help text to reflect expanded discovery layouts. |
| pkg/cmd/skills/install/install.go | Improve ambiguity handling and path-based selection/redirect behavior for nested skills. |
| pkg/cmd/skills/install/install_test.go | Add coverage for nested installs, ambiguity errors, exact-path selection, and upstream redirects using stored metadata paths. |
| internal/skills/discovery/discovery.go | Expand matcher to treat non-hidden nested SKILL.md as skills and update discovery error messages; improve convention detection for exact-path lookups. |
| internal/skills/discovery/discovery_test.go | Add coverage for nested matching, hidden exclusions, and nested discovery in remote/local scenarios. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Low
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ccf2a058-7f75-4f53-a39d-dc9225ef5c85
3288946 to
8f44336
Compare
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Root-level discovery, duplicate-path handling, preview ambiguity, and ref parsing remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (3)
| if !hasHiddenSegment(entry.Path) && !hasPluginsAncestor(entry.Path) && skillName != "skills" && skillName != "plugins" { | ||
| convention := "nested" | ||
| if parentDir == "." { | ||
| convention = "root" | ||
| } | ||
| return &skillMatch{entry: entry, name: skillName, skillDir: dir, convention: convention} |
| if !hasHiddenSegment(entry.Path) && !hasPluginsAncestor(entry.Path) && skillName != "skills" && skillName != "plugins" { | ||
| convention := "nested" | ||
| if parentDir == "." { | ||
| convention = "root" | ||
| } | ||
| return &skillMatch{entry: entry, name: skillName, skillDir: dir, convention: convention} |
| func cutSkillVersion(s string) (name, version string, found bool) { | ||
| if i := strings.LastIndex(s, "@"); i > 0 { | ||
| version = s[i+1:] | ||
| if version != "" && !strings.Contains(version, "/") { | ||
| return s[:i], version, true |
|
👋 moving this to draft to represent state w/ new copilot review instructions, please mark ready for review when addressed 🙏 |
|
@tommaso-moro |



Fixes #13876
Summary
SKILL.mdfiles whose parent directories appear at arbitrary non-hidden repository depths, without requiring askills/directory.API request impact
SKILL.mddescriptions and repository metadata. Enrichment remains capped atpage * limit * 3candidates (45 with the default first page).Testing
go test ./...makegolangci-lint run --new-from-rev=origin/trunk ./...gh skill install android/skills r8-analyzer --dir <temp-dir>