Describe the bug
gh skill install successfully installs a namespaced skill, but its post-install file tree reports (could not read directory).
Since #13266, skill files have been installed into flat directories using Name (deploy/), while Result.Installed retains the qualified identity (alice/deploy) for the success message. printFileTree in pkg/cmd/skills/install/install.go still joins that identity onto the install directory, so it reads target/alice/deploy instead of the actual target/deploy.
Affected version
gh version 2.96.0 (2026-07-02)
https://github.com/cli/cli/releases/tag/v2.96.0
The mismatch is also present on trunk at 0eeec0b92edbe70199f9768522f831d3534f41ad.
Steps to reproduce
mkdir -p src/skills/alice/deploy
cat >src/skills/alice/deploy/SKILL.md <<'EOF'
---
name: deploy
description: Minimal reproduction for a namespaced skill install.
---
# Deploy
EOF
gh skill install ./src --from-local --all --force --dir target
find target -maxdepth 3 -type f -print
Expected behavior
The file tree shows the actual flat install directory and its contents:
The qualified identity remains in the success message:
Installed alice/deploy (from ./src) in target
Actual behavior
alice/deploy/
(could not read directory)
The install itself succeeds, and the file exists at:
Suggested fix and regression coverage
Use the flat on-disk directory name when resolving and labeling each file-tree entry, while preserving the qualified identity in the Installed ... line. A minimal fix may be to derive the on-disk name with filepath.Base(filepath.FromSlash(name)) inside printFileTree.
The InstallName comment in internal/skills/discovery/discovery.go still describes the pre-#13266 nested layout and should be corrected alongside this change.
For regression coverage, extend the existing TTY file-tree test pattern in pkg/cmd/skills/install/install_test.go with a namespaced case. The namespaced acceptance test updated in #13365 can also assert the stderr tree, but it requires a live GitHub instance and runs only when explicitly enabled.
Happy to open a focused PR if this direction looks right.
Describe the bug
gh skill installsuccessfully installs a namespaced skill, but its post-install file tree reports(could not read directory).Since #13266, skill files have been installed into flat directories using
Name(deploy/), whileResult.Installedretains the qualified identity (alice/deploy) for the success message.printFileTreeinpkg/cmd/skills/install/install.gostill joins that identity onto the install directory, so it readstarget/alice/deployinstead of the actualtarget/deploy.Affected version
The mismatch is also present on trunk at
0eeec0b92edbe70199f9768522f831d3534f41ad.Steps to reproduce
Expected behavior
The file tree shows the actual flat install directory and its contents:
The qualified identity remains in the success message:
Actual behavior
The install itself succeeds, and the file exists at:
Suggested fix and regression coverage
Use the flat on-disk directory name when resolving and labeling each file-tree entry, while preserving the qualified identity in the
Installed ...line. A minimal fix may be to derive the on-disk name withfilepath.Base(filepath.FromSlash(name))insideprintFileTree.The
InstallNamecomment ininternal/skills/discovery/discovery.gostill describes the pre-#13266 nested layout and should be corrected alongside this change.For regression coverage, extend the existing TTY file-tree test pattern in
pkg/cmd/skills/install/install_test.gowith a namespaced case. The namespaced acceptance test updated in #13365 can also assert the stderr tree, but it requires a live GitHub instance and runs only when explicitly enabled.Happy to open a focused PR if this direction looks right.