Skip to content

Clarify skill publish error for nested skill directories - #14259

Open
tommaso-moro wants to merge 2 commits into
trunkfrom
tommaso-moro-fix-skill-publish-target-error
Open

Clarify skill publish error for nested skill directories#14259
tommaso-moro wants to merge 2 commits into
trunkfrom
tommaso-moro-fix-skill-publish-target-error

Conversation

@tommaso-moro

@tommaso-moro tommaso-moro commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes #14134

Description

When gh skill publish is given a skill directory containing SKILL.md directly, shared discovery represents that skill's path as .. Publish then compares the skill name with . and reports the misleading error name "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 publish must 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 ran go 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

  • Checks only a single directly supplied skill represented by discovery as ..
  • Preserves the existing failure and changes only its explanation.
  • Leaves all other directory targeting and publishing behavior unchanged.

Notes for reviewers

Start with the targeted check in publishRun, followed by TestPublishRun_ExplainsSkillDirectoryWithinRepository. #14134 contains the original misleading diagnostic.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @tommaso-moro will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d7cfd21b-8317-42d4-aba0-2b0ac2d7bb87
Copilot AI balanced review requested due to automatic review settings August 25, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
File Description
pkg/cmd/skills/publish/publish.go Adds root validation and help text.
pkg/cmd/skills/publish/publish_test.go Tests nested-directory rejection and updates Git stubs.

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

Comment thread pkg/cmd/skills/publish/publish.go Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d7cfd21b-8317-42d4-aba0-2b0ac2d7bb87
@tommaso-moro tommaso-moro changed the title Require skill publish to target repository root Clarify skill publish error for nested skill directories Aug 25, 2026
@tommaso-moro
tommaso-moro marked this pull request as ready for review August 25, 2026 15:04
@tommaso-moro
tommaso-moro requested review from a team as code owners August 25, 2026 15:04
@tommaso-moro
tommaso-moro requested a review from BagToad August 25, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh skill publish fails with correct skills/<name>/SKILL.md structure: name does not match directory name '.'

2 participants