fix(skill-stocktake): follow symlinks and match only SKILL.md in scans

scan.sh and quick-diff.sh both used `find "$dir" -name "*.md" -type f`,
which missed symlinked skill directories (no -L) and miscounted any
non-skill markdown file sitting in a skills directory as a skill
(matched *.md instead of SKILL.md). Both call sites now use
`find -L "$dir" -name "SKILL.md" -type f`.

Repro (temp dir with 1 real skill, 1 symlinked skill, 1 stray .md file):
before: 2 skills found (real skill + the stray .md, symlinked skill invisible)
after:  2 skills found (real skill + symlinked skill, stray .md excluded)

Fixes #2598

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhDjpSfrbPpnpqT3CZBEX1
This commit is contained in:
Deepu S Nath
2026-08-29 14:55:13 -04:00
committed by haelyra
co-authored by Claude Sonnet 5
parent 974ccc749f
commit 1c450766a9
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ process_dir() {
'{path:$path,mtime:$mtime,is_new:$is_new}' \
> "$tmpdir/$i.json"
i=$((i+1))
done < <(find "$dir" -name "*.md" -type f 2>/dev/null | sort)
done < <(find -L "$dir" -name "SKILL.md" -type f 2>/dev/null | sort)
}
[[ -d "$GLOBAL_DIR" ]] && process_dir "$GLOBAL_DIR"
+1 -1
View File
@@ -118,7 +118,7 @@ scan_dir_to_json() {
'{path:$path,name:$name,description:$description,use_7d:$use_7d,use_30d:$use_30d,mtime:$mtime}' \
> "$tmpdir/$i.json"
i=$((i+1))
done < <(find "$dir" -name "*.md" -type f 2>/dev/null | sort)
done < <(find -L "$dir" -name "SKILL.md" -type f 2>/dev/null | sort)
if [[ $i -eq 0 ]]; then
echo "[]"