Skip to content

fix(docs): match README manual-uninstall snippet to install layout#1142

Open
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn:mvanhorn/fix-readme-uninstall-script
Open

fix(docs): match README manual-uninstall snippet to install layout#1142
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn:mvanhorn/fix-readme-uninstall-script

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

The manual-removal block in README.md told users to run:

find ~/.claude/skills -maxdepth 1 -type l 2>/dev/null | while read -r link; do
  case "$(readlink "$link" 2>/dev/null)" in gstack/*|*/gstack/*) rm -f "$link" ;; esac
done

setup (lines 399-404) creates each skill as a real directory at the top level with SKILL.md as a nested symlink. -maxdepth 1 -type l only matches top-level symlinks, so this find matched nothing on current installs and users were left with ~30 empty per-skill directories.

Fix

Replace the snippet with one that iterates real directories, skips gstack itself, checks the nested SKILL.md is a symlink pointing into gstack/, and removes the directory if so.

find ~/.claude/skills -mindepth 1 -maxdepth 1 -type d 2>/dev/null | while IFS= read -r dir; do
  [ "$(basename "$dir")" = "gstack" ] && continue
  link="$dir/SKILL.md"
  [ -L "$link" ] || continue
  case "$(readlink "$link" 2>/dev/null)" in gstack/*|*/gstack/*) rm -rf "$dir" ;; esac
done

Verified on a fake HOME:

BEFORE:  ~/.claude/skills/{autoplan, ship, gstack, other-tool}
AFTER:   ~/.claude/skills/{gstack, other-tool}
         (autoplan and ship removed; gstack untouched for step 3; other-tool preserved)

Sibling fix for the same root cause in bin/gstack-uninstall is in #902.

Fixes #1130

The manual-removal step 2 used `find -maxdepth 1 -type l` which only matches
top-level symlinks. But setup creates real directories per skill with SKILL.md
symlinked into gstack/, so nothing ever matched and the per-skill directories
survived uninstall.

Switches to iterating real directories and checking each nested SKILL.md
target. Matches the real install topology and aligns with the fix to
bin/gstack-uninstall in garrytan#902.

Fixes garrytan#1130
@mvanhorn
Copy link
Copy Markdown
Contributor Author

Appreciate the review @dgrant. Glad the rewritten find pipeline reads right after the install-layout shift in #1130.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove per-skill symlinks pointing into gstack script in README.md is broken

2 participants