Repository navigation
Conversation
…#15147) When a namespaced skill is installed, gh skill installs it into a flat directory so agent clients can discover it, but previously recorded the namespaced name in ~/.agents/.skill-lock.json. This broke interoperability with the Vercel skills CLI, which looks up the skill directory by its lockfile key during 'skills update'. In addition, printFileTree attempted to read the namespaced path on disk and failed with '(could not read directory)'. Record skill.Name in the lockfile to match the on-disk directory layout, and resolve the directory name in printFileTree. Signed-off-by: Parth Gorde <[email protected]>
wellparth
requested review from
sergiou87
and
a balanced review from Copilot
November 25, 2026 06:37
Contributor
|
Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:
Please update your PR to address the above. This PR will be automatically closed in 4 days if these requirements are not met. Full contribution requirements
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Regression tests can pass with the tree fix reverted and do not cover namespaced lockfile keys in multi-skill installs, leaving both regressions undetected.
2 open issues
What changed in this PR
This PR addresses #15147 by aligning namespaced skill lockfile keys and file-tree lookups with the flat directories that gh skill install creates, improving compatibility with the Vercel skills updater.
Changes:
- Record flat skill names in the lockfile for single and batch installs.
- Use flat directory names when rendering installed file trees.
- Add regression tests while preserving namespaced identifiers in installation results.
| File | Description |
|---|---|
pkg/cmd/skills/install/install.go |
Resolve and display flat directory names in file trees. |
pkg/cmd/skills/install/install_test.go |
Add a tree-output expectation for a namespaced install. |
internal/skills/installer/installer.go |
Record flat names in both lockfile-writing paths. |
internal/skills/installer/installer_test.go |
Add a namespaced install case and lockfile-key checks. |
Review effort: Balanced
| skill := opts.Skills[i] | ||
| if err := lockfile.RecordInstall(opts.Host, skill.InstallName(), opts.Owner, opts.Repo, skill.Path+"/SKILL.md", skill.TreeSHA, opts.PinnedRef); err != nil { | ||
| warnings = append(warnings, fmt.Sprintf("could not record install for %s: %v", skill.InstallName(), err)) | ||
| if err := lockfile.RecordInstall(opts.Host, skill.Name, opts.Owner, opts.Repo, skill.Path+"/SKILL.md", skill.TreeSHA, opts.PinnedRef); err != nil { |
| } | ||
| }, | ||
| wantStdout: "Installed bob/xlsx-pro", | ||
| wantStderr: "xlsx-pro/", |
…rendering - Add multi-skill test ensuring namespaced skills write flat lock keys in batch installs - Assert file tree output renders child SKILL.md under flat directory heading Signed-off-by: Parth Gorde <[email protected]>
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.

Fixes #15147
Description
When installing a skill with a namespace prefix (e.g.
skills/alice/deploywith namedeployand namespacealice),gh skill installintentionally writes files to a flat directory (baseDir/deploy) so agent hosts (Copilot, Claude Code, etc.) can discover them as immediate subdirectories.However,
internal/skills/installer/installer.gopreviously recordedskill.InstallName()("alice/deploy") as the key in the shared~/.agents/.skill-lock.jsonfile. Because Vercel'sskillsCLI lockfile specification uses the lockfile key to locate the installed skill folder on disk, runningskills updatelooked for a folder namedalice/deploy, could not find it, and failed withNo matching skills found.Additionally, in
pkg/cmd/skills/install/install.go,printFileTreeattempted to look up the on-disk directory using the unstripped install name (filepath.Join(dir, "alice/deploy")), which caused the post-install tree view to emit(could not read directory).This change:
skill.Nameinstead ofskill.InstallName()inlockfile.RecordInstall, ensuring the lockfile key matches the flat directory on disk.printFileTreeusingfilepath.Base(...), allowing the installed file tree to render properly for namespaced skills.internal/skills/installerandpkg/cmd/skills/install.How did you test this change?
Unit and Integration Tests:
go test -v ./internal/skills/installer -run TestInstall: verifiedTestInstall/namespaced_skill_records_flat_name_in_lockfilepasses, writing"deploy"to.skill-lock.jsonand ensuring"alice/deploy"is not written.go test -v ./pkg/cmd/skills/install -run "TestInstallRun/remote_install_namespaced_exact_match": verified that the tree output for a namespaced install rendersxlsx-pro/onstderrwithout(could not read directory).go test ./internal/skills/... ./pkg/cmd/skills/...): all 13 packages passed cleanly.Manual Walkthrough:
bob/xlsx-prointo a temporary directoryInstallruns.skill-lock.jsonrecords"xlsx-pro"underskills, matching thexlsx-prodirectory created in the target path.Key points
Result.Installedcontinues to preserveskill.InstallName()so user-facing completion output (✓ Installed alice/deploy) and review hints (gh skill preview repo alice/deploy) retain full remote namespace context.printFileTree) are flattened to match the actual filesystem layout.Notes for reviewers
internal/skills/installer/installer.golines 79 and 132, followed by the tree helper inpkg/cmd/skills/install/install.goline 1150.internal/skills/installer/installer_test.goandpkg/cmd/skills/install/install_test.go.Authorship and follow-up
Who wrote this:
Who answers review comments: