fix discovery support in nested dirs#13459
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes gh skill install and gh skill preview behavior for nested skill layouts by improving hidden-directory discovery and by treating deeply nested selectors as repo-relative paths.
Changes:
- Extend hidden-dir discovery so
--allow-hidden-dirsfinds skills under hidden directories at any repository depth. - Add shared path-detection logic (
discovery.IsSkillPath) and use it to support exact nested-path installs/previews (skipping full discovery). - Add regression tests covering nested hidden directories and arbitrary nested path selectors.
Show a summary per file
| File | Description |
|---|---|
pkg/cmd/skills/preview/preview.go |
Add path-based preview flow that looks up a single skill by repo-relative path. |
pkg/cmd/skills/preview/preview_test.go |
Add test ensuring nested path preview skips full discovery. |
pkg/cmd/skills/install/install.go |
Centralize path detection via discovery.IsSkillPath. |
pkg/cmd/skills/install/install_test.go |
Add install test for arbitrary nested path, plus path-detection cases. |
internal/skills/discovery/discovery.go |
Add IsSkillPath helper and broaden hidden-dir convention matching to any depth. |
internal/skills/discovery/discovery_test.go |
Add coverage for nested hidden-dir matching and IsSkillPath. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 3
babakks
requested changes
Jun 1, 2026
babakks
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR. The implementation seems solid. Just some comments (mostly nitpicks) on tests.
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.
Fixes #13372
Summary
Fix
gh skill installandgh skill previewhandling for nested skill paths.What changed
--allow-hidden-dirsto discover hidden skill directories at any repository depth, not only at the root.installandpreview.packages/agent-skills/my-skillowner/skillas namespaced skill names, not paths.installandpreview.Product note
This does not change the recommended Agent Skills publishing conventions or broaden search/publish behavior. Non-standard layouts are only supported when the user explicitly provides an exact path.
Testing
go test ./internal/skills/discovery ./pkg/cmd/skills/install ./pkg/cmd/skills/preview -run 'TestIsSkillPath|Test_isSkillPath|TestPreviewRun|TestMatchHiddenDirConventions|TestDiscoverSkillsWithOptions|TestDiscoverLocalSkillsWithOptions|TestInstallRun' -count=1go test ./internal/skills/discovery ./pkg/cmd/skills/... -count=1git diff --check