fix(skills): update in-place instead of relocating namespaced skills#13423
Draft
SamMorrowDrums wants to merge 3 commits into
Draft
fix(skills): update in-place instead of relocating namespaced skills#13423SamMorrowDrums wants to merge 3 commits into
SamMorrowDrums wants to merge 3 commits into
Conversation
When `gh skill update --dir` was used on a namespaced skill layout
({dir}/{namespace}/{name}/SKILL.md), the install base was computed by
walking up two filepath.Dir levels instead of one. This caused the
updated skill to land at the wrong (shallower) path and the original
directory to be deleted via os.RemoveAll.
Always use filepath.Dir(u.local.dir) as the install base so the update
writes back into the exact directory where the skill was found. Clean
the directory contents before re-installing to remove stale files from
the previous version while preserving the directory itself (keeping
symlinks, mounts, and external references intact).
Closes cli#13370
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When gh skill update --dir was used on a namespaced skill layout
({dir}/{namespace}/{name}/SKILL.md), the install base was computed by
walking up two filepath.Dir levels instead of one. This caused the
updated skill to land at the wrong (shallower) path and the original
directory to be deleted via os.RemoveAll.
Always use filepath.Dir(u.local.dir) as the install base so the update
writes back into the exact directory where the skill was found. Clean
the directory contents before re-installing to remove stale files from
the previous version while preserving the directory itself (keeping
symlinks, mounts, and external references intact).
Closes cli#13370
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Removed issue reference from comment about updating namespaced skill.
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.
Summary
When
gh skill update --dirwas used on a namespaced skill layout ({dir}/{namespace}/{name}/SKILL.md), the install base was computed by walking up twofilepath.Dirlevels instead of one. This caused the updated skill to land at the wrong (shallower) path and the original directory to be deleted viaos.RemoveAll.Changes
filepath.Dir(u.local.dir)as the install base so the update writes back into the exact directory where the skill was found - regardless of flat or namespaced layout.skills-update-inplace.txtar) that plants a namespaced skill, updates via--dirone level up, and verifies the skill stays in its original location.Closes #13370