mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-02 03:35:09 +02:00
6afd8cc259
gstack-upgrade/migrations/v0.18.5.0.sh removes the stale on-disk
/checkpoint install so Claude Code's native /rewind alias is no longer
shadowed. Ownership guard inspects the directory itself (not just
SKILL.md) and handles 3 install shapes:
1. ~/.claude/skills/checkpoint is a directory symlink whose canonical
path resolves inside ~/.claude/skills/gstack/ → remove.
2. ~/.claude/skills/checkpoint is a directory containing exactly one
file SKILL.md that's a symlink into gstack → remove (gstack's
prefix-install shape).
3. Anything else (user's own regular file/dir, or a symlink pointing
elsewhere) → leave alone, print a one-line notice.
Also removes ~/.claude/skills/gstack/checkpoint/ unconditionally (gstack
owns that dir).
Portable realpath: `realpath` with python3 fallback for macOS BSD which
lacks readlink -f. Idempotent: missing paths are no-ops.
test/migration-checkpoint-ownership.test.ts ships 7 scenarios covering
all 3 install shapes + idempotency + no-op-when-gstack-not-installed +
SKILL.md-symlink-outside-gstack. Critical safety net for a migration
that mutates user state. Free tier, ~85ms.