diff --git a/acceptance/testdata/skills/skills-search-namespaced.txtar b/acceptance/testdata/skills/skills-install-namespaced.txtar similarity index 96% rename from acceptance/testdata/skills/skills-search-namespaced.txtar rename to acceptance/testdata/skills/skills-install-namespaced.txtar index e0fb888cb..db39bead0 100644 --- a/acceptance/testdata/skills/skills-search-namespaced.txtar +++ b/acceptance/testdata/skills/skills-install-namespaced.txtar @@ -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 diff --git a/pkg/cmd/skills/search/search.go b/pkg/cmd/skills/search/search.go index 836fa3de5..bc1c819e9 100644 --- a/pkg/cmd/skills/search/search.go +++ b/pkg/cmd/skills/search/search.go @@ -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