Skip to content

fix(skills): match skills by install name in preview command#13249

Merged
SamMorrowDrums merged 2 commits intotrunkfrom
sammorrowdrums/fix-skill-install-preview-sha
Apr 21, 2026
Merged

fix(skills): match skills by install name in preview command#13249
SamMorrowDrums merged 2 commits intotrunkfrom
sammorrowdrums/fix-skill-install-preview-sha

Conversation

@SamMorrowDrums
Copy link
Copy Markdown
Contributor

@SamMorrowDrums SamMorrowDrums commented Apr 21, 2026

Summary

Fixes #13248

After gh skill install, the output suggests a gh skill preview command using the skill's InstallName() (e.g., aws-common/aws-mcp-setup for plugins-convention skills). However, the preview command's selectSkill function only matched against DisplayName() and Name, neither of which matched:

  • DisplayName() for plugins convention = [plugins] aws-common/aws-mcp-setup
  • Name = aws-mcp-setup
  • InstallName() = aws-common/aws-mcp-setup (what the install hint outputs)

Changes

  • pkg/cmd/skills/preview/preview.go: Added s.InstallName() as an additional match criterion in selectSkill, so namespaced skill identifiers from the install hint are accepted.
  • pkg/cmd/skills/preview/preview_test.go: Added test case for plugins-convention skills matched by install name.

End-to-end verification

Before fix:

$ gh skill preview zxkane/aws-skills aws-common/aws-mcp-setup@e4ef2e2147aa5d7b812af8970064dd822c7678ec
skill "aws-common/aws-mcp-setup" not found in zxkane/aws-skills

After fix:

$ gh skill preview zxkane/aws-skills aws-common/aws-mcp-setup@e4ef2e2147aa5d7b812af8970064dd822c7678ec
[plugins] aws-common/aws-mcp-setup/
└── SKILL.md

── SKILL.md ──

# AWS MCP Server Configuration Guide
...

The preview command's selectSkill function only matched skills by
DisplayName() and Name. For plugins-convention skills, the install
hint outputs InstallName() (namespace/name), which matched neither -
DisplayName() includes a [plugins] prefix and Name is just the base
name. This caused 'skill not found' errors when users ran the
suggested preview command after install.

Add InstallName() as an additional match criterion so that namespaced
skill identifiers produced by the install hint are accepted.

Closes #13248

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 21, 2026 07:57
@SamMorrowDrums SamMorrowDrums requested review from a team as code owners April 21, 2026 07:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes gh skill preview failing when users paste the post-install hint for plugins-convention skills by allowing selection by InstallName() (e.g., aws-common/aws-mcp-setup).

Changes:

  • Update selectSkill in gh skill preview to also match skills by InstallName().
  • Add a regression test ensuring plugins-convention skills can be previewed via their install name.
Show a summary per file
File Description
pkg/cmd/skills/preview/preview.go Extends skill selection to accept install-name identifiers.
pkg/cmd/skills/preview/preview_test.go Adds a test case covering plugins-convention install-name matching.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread pkg/cmd/skills/preview/preview.go Outdated
Use a two-pass search so exact DisplayName and Name matches are
preferred over InstallName. This avoids incorrectly selecting a
plugins-convention skill via InstallName when a standard namespaced
skill with a matching DisplayName exists later in the sorted slice.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums SamMorrowDrums merged commit 1b236f2 into trunk Apr 21, 2026
11 checks passed
@SamMorrowDrums SamMorrowDrums deleted the sammorrowdrums/fix-skill-install-preview-sha branch April 21, 2026 09:30
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.

Invalid gh skill preview command shows after gh skill install

3 participants