{{ message }}
Repository navigation
Clarify skill publish error for nested skill directories - #14259
Draft
tommaso-moro wants to merge 2 commits into
Draft
tommaso-moro wants to merge 2 commits into
tommaso-moro wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d7cfd21b-8317-42d4-aba0-2b0ac2d7bb87
Contributor
There was a problem hiding this comment.
Pull request overview
Requires gh skill publish to target a repository root, preventing partial skill validation before tagging and releasing.
Changes:
- Adds repository-root validation.
- Documents the restriction and adds regression coverage for nested directories.
Show a summary per file
Review details
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d7cfd21b-8317-42d4-aba0-2b0ac2d7bb87
tommaso-moro
marked this pull request as ready for review
August 25, 2026 15:04
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The early return masks existing validation diagnostics and changes non-interactive output behavior beyond the stated scope.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
pkg/cmd/skills/publish/publish_test.go — 🛑 Requirement: Cover the preserved diagnostic contract and the false branch. This test discards… |
|
pkg/cmd/skills/publish/publish.go — 🛑 Requirement: Keep this in the validation-diagnostic path instead of returning early. This… |
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
pkg/cmd/skills/publish/publish.go — 💭 Commentary: This overstates the new restriction. git.Client.PathFromRoot returns an empty… View resolved comment |
Comment on lines
+193
to
+197
| ios, _, _, _ := iostreams.Test() | ||
| err := publishRun(&PublishOptions{ | ||
| IO: ios, | ||
| Dir: skillDir, | ||
| GitClient: newTestGitClient(), |
Comment on lines
+199
to
+203
| if len(skills) == 1 && skills[0].Path == "." && opts.GitClient != nil { | ||
| dirGitClient := opts.GitClient.Copy() | ||
| dirGitClient.RepoDir = dir | ||
| if dirGitClient.PathFromRoot(context.Background()) != "" { | ||
| return fmt.Errorf("%s is a skill directory within a repository; gh skill publish must target the repository root", dir) |
BagToad
marked this pull request as draft
September 23, 2026 21:30
Member
This branch has not been deployed
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.



Closes #14134
Description
When
gh skill publishis given a skill directory containingSKILL.mddirectly, shared discovery represents that skill's path as.. Publish then compares the skill name with.and reports the misleading errorname "reskill" does not match directory name ".".This change recognizes only that already-failing case when the selected skill directory is inside a Git repository and replaces the name-mismatch error with an explanation that
gh skill publishmust target the repository root. It does not add general repository-root enforcement or change successful publishing behavior.How did you test this change?
Given this checkout contains
skills/gh-skill, when I rango run ./cmd/gh skill publish skills/gh-skill --dry-run, then the command still exited unsuccessfully but explained that the selected path is a skill directory within a repository and that publishing must target the repository root.Key points
..Notes for reviewers
Start with the targeted check in
publishRun, followed byTestPublishRun_ExplainsSkillDirectoryWithinRepository. #14134 contains the original misleading diagnostic.Authorship and follow-up
Who wrote this:
Who answers review comments: