Skip to content

fix(docs): correct per-skill symlink removal snippet in README uninstall#1338

Open
stedfn wants to merge 1 commit intogarrytan:mainfrom
stedfn:fix/readme-uninstall-per-skill-1130
Open

fix(docs): correct per-skill symlink removal snippet in README uninstall#1338
stedfn wants to merge 1 commit intogarrytan:mainfrom
stedfn:fix/readme-uninstall-per-skill-1130

Conversation

@stedfn
Copy link
Copy Markdown
Contributor

@stedfn stedfn commented May 6, 2026

Closes #1130.

Problem

The manual-uninstall fallback in ## Uninstall### Option 2 uses:

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

This finds nothing on real installs. Each ~/.claude/skills/<name>/ is a real directory, and only <name>/SKILL.md inside it is a symlink into gstack/ (per bin/gstack-relink). The find walks one level for symlinks at that depth — there are none — and silently removes nothing.

Fix

Replace with a directory walk that inspects each <name>/SKILL.md:

find ~/.claude/skills -mindepth 1 -maxdepth 1 -type d ! -name gstack 2>/dev/null |
while IFS= read -r dir; do
  link="$dir/SKILL.md"
  [ -L "$link" ] || continue
  target=$(readlink "$link" 2>/dev/null) || continue
  case "$target" in
    gstack/*|*/gstack/*)
      rm -f "$link"
      rmdir "$dir" 2>/dev/null || true
      ;;
  esac
done
  • Excludes the top-level gstack/ dir from the walk; step 3 of the same block removes it.
  • Uses rm -f + rmdir (vs rm -rf) so any user-added files in a per-skill dir are preserved.
  • bin/gstack-uninstall (script mode) already handles the layout correctly via its own walk; only this manual fallback needed updating.

Verification

  • bash -n parse-checks clean.
  • git diff upstream/main -- README.md shows only the snippet replaced (+12/-3, scoped to the lines under # 2. Remove per-skill symlinks pointing into gstack/).

Closes garrytan#1130.

The manual-uninstall fallback in `## Uninstall` → `### Option 2` used
`find ~/.claude/skills -maxdepth 1 -type l`, which finds nothing on real
installs. Each `~/.claude/skills/<name>/` is a real directory, and only
`<name>/SKILL.md` inside it is a symlink into `gstack/`. The find never
matched, so the snippet silently removed nothing.

Replace with a directory walk that inspects each `<name>/SKILL.md`:

  find ~/.claude/skills -mindepth 1 -maxdepth 1 -type d ! -name gstack
  → check $dir/SKILL.md is a symlink → readlink it
  → if target is gstack/* or */gstack/*: rm -f the link, rmdir the dir
    (only if empty — preserves any user-added files)

Excludes the top-level `gstack/` dir from the walk; that's removed by
step 3 of the same uninstall block.

`bin/gstack-uninstall` (the script-mode path) already handles the layout
correctly via its own walk; only this manual fallback needed updating.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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

1 participant