mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 12:23:22 +00:00
When a target directory is an external symlink (e.g., dotfiles manager pointing ~/.claude/skills/ elsewhere), sync previously deleted it unconditionally during symlink→merge/copy mode conversion. This also affected DiscoverSourceSkills which failed to traverse symlinked source directories because filepath.Walk uses Lstat on root. Changes: - Add resolveWalkRoot() helper; use in both Discover functions so filepath.Walk enters symlinked source directories - Add isSymlinkToSource() to distinguish source-pointing symlinks (symlink mode residue, safe to remove) from external symlinks - Pass explicit sourcePath to SyncTargetMergeWithSkills and SyncTargetCopyWithSkills for reliable symlink origin detection - Fix FindLocalSkills to use utils.ResolveLinkTarget (handles relative symlinks correctly) and follow external symlinks for scanning - Fix CheckStatusMerge to follow external symlinks instead of returning StatusConflict - Add 17 unit tests and 6 integration tests covering symlinked source, target, both, chained symlinks, idempotency, prune, and pull