fix(uninstall): clean up per-skill directories with nested SKILL.md symlinks#902
Open
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
Open
fix(uninstall): clean up per-skill directories with nested SKILL.md symlinks#902mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
Conversation
…links The uninstall script only removed entries that were themselves top-level symlinks under ~/.claude/skills. But setup (lines 399-404) creates real directories there, with each SKILL.md linked to gstack/<skill>/SKILL.md. After uninstall, ~30 per-skill directories (autoplan, canary, ship, ...) were left behind holding broken SKILL.md symlinks. Adds a second pass that inspects the nested SKILL.md in each top-level directory and removes the directory when that link points into gstack/. The legacy top-level-symlink pass is preserved for older installs. Scoped to ~/.claude/skills; the codex/factory/kiro paths use a different install topology and are untouched. Fixes garrytan#1132
c08c7bc to
2293128
Compare
dgrant
approved these changes
Apr 22, 2026
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
gstack-uninstallleft behind per-skill directories thatsetupcreates under~/.claude/skills/. Aftergstack-uninstall --keep-state, ~30 empty directories holding brokenSKILL.mdsymlinks into the removedgstack/tree remained. Covers both issue reports: prefix-mode (gstack-*) from #896 and default-mode (browse/,ship/, etc.) from #1132.Why this matters
setup(lines 399-404) creates each skill as a real directory with a nestedSKILL.mdsymlink, regardless of prefix setting:The existing uninstall loop only matched top-level symlinks (
[ -L "$_LINK" ]), so neither layout got cleaned up. The finalrm -rf "$CLAUDE_SKILLS/gstack"then left the per-skill directories holding broken links.Fix
Adds a second pass in the
CLAUDE_SKILLSblock that iterates real directories, checks whether the nestedSKILL.mdis a symlink pointing intogstack/, and removes the directory when it does. The legacy top-level-symlink pass is preserved so older installs still clean up.The symlink-target check matches both default (
browse/) and prefix (gstack-browse/) layouts because setup writes the same nestedSKILL.mdsymlink pattern in both. Also safer than the earliergstack-*glob approach, which would have over-removed any unrelated tool whose top-level directory happened to start withgstack-.Scoped to
~/.claude/skills. The codex/factory/kiro paths use a different install topology and are untouched.Test
Added
test('current setup layout...')intest/uninstall.test.tscovering the real-dir-plus-nested-symlink layout. Runs--force, asserts per-skill directories are gone, confirms a sibling with no SKILL.md survives.Local verification on a fake
HOME:bun test test/uninstall.test.ts: 8/8 pass.Fixes #896, fixes #1132