fix: address review feedback on namespace changes

- Keep skillName as bare name in JSON output for backward compat;
  namespace is available as a separate --json field
- Fix Namespace field comment to cover plugin namespaces too
- Trim /SKILL.md from install path arg to match comment
- Rename acceptance test to skills-install-namespaced since it
  tests install disambiguation, not search

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Sam Morrow 2026-04-15 23:39:11 +02:00
parent 92e40eabea
commit e04dceb3b5
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
# Two namespaced skills with the same base name in the same repo should
# both appear in search results and be independently installable.
# be independently installable using path-based disambiguation.
# Use gh as a credential helper
exec gh auth setup-git

View file

@ -163,7 +163,7 @@ type skillResult struct {
Owner string // parsed from Repo
RepoName string // parsed from Repo
SkillName string
Namespace string // author/scope prefix for namespaced skills
Namespace string // namespace prefix: author/scope for skills/{author}/* or plugin name for plugins/{plugin}/skills/*
Description string
Path string // original file path (e.g. skills/terraform/SKILL.md)
BlobSHA string
@ -187,7 +187,7 @@ func (s skillResult) ExportData(fields []string) map[string]interface{} {
case "repo":
data[f] = s.Repo
case "skillName":
data[f] = s.qualifiedName()
data[f] = s.SkillName
case "namespace":
data[f] = s.Namespace
case "description":
@ -577,12 +577,12 @@ func promptInstall(opts *SearchOptions, skills []skillResult) error {
fmt.Fprintf(opts.IO.ErrOut, "\n%s Installing %s from %s...\n",
cs.Blue("::"), displayName, s.Repo)
// Use the repo-relative path (e.g. "skills/author/name") for
// disambiguation when installing namespaced skills, so the
// Use the repo-relative directory path (e.g. "skills/author/name")
// for disambiguation when installing namespaced skills, so the
// install command can resolve the exact skill without ambiguity.
installArg := s.SkillName
if s.Namespace != "" {
installArg = s.Path
installArg = strings.TrimSuffix(s.Path, "/SKILL.md")
}
//nolint:gosec // arguments are from user-selected search results, not arbitrary input