@@ -23,23 +23,37 @@ try {
2323
2424Write-Host " Installing Polyspace skills to $SkillsDir "
2525
26- # Create symlinks/junctions for each skill group
26+ # Create flat per-skill symlinks so that each SKILL.md is at depth */SKILL.md
27+ # (Gemini CLI discovers skills with a one-level-deep glob only).
2728foreach ($GroupDir in Get-ChildItem - Path $SkillsCatalog - Directory) {
28- $GroupName = $GroupDir.Name
29- $LinkName = " polyspace-$GroupName "
30- $LinkPath = Join-Path $SkillsDir $LinkName
31-
32- if (Test-Path $LinkPath ) {
33- Remove-Item $LinkPath - Force - Recurse
29+ # If the group itself has a SKILL.md, link it directly
30+ $DirectSkill = Join-Path $GroupDir.FullName " SKILL.md"
31+ if (Test-Path $DirectSkill ) {
32+ $LinkName = $GroupDir.Name
33+ $LinkPath = Join-Path $SkillsDir $LinkName
34+ if (Test-Path $LinkPath ) { Remove-Item $LinkPath - Force - Recurse }
35+ try {
36+ New-Item - ItemType SymbolicLink - Path $LinkPath - Target $GroupDir.FullName | Out-Null
37+ } catch {
38+ cmd / c mklink / J " $LinkPath " " $ ( $GroupDir.FullName ) " | Out-Null
39+ }
40+ Write-Host " Linked: $LinkName -> $ ( $GroupDir.FullName ) "
3441 }
3542
36- try {
37- New-Item - ItemType SymbolicLink - Path $LinkPath - Target $GroupDir.FullName | Out-Null
38- } catch {
39- # Fall back to junction if symlink requires admin
40- cmd / c mklink / J " $LinkPath " " $ ( $GroupDir.FullName ) " | Out-Null
43+ # Link each sub-skill individually
44+ foreach ($SkillDir in Get-ChildItem - Path $GroupDir.FullName - Directory) {
45+ $SkillFile = Join-Path $SkillDir.FullName " SKILL.md"
46+ if (-not (Test-Path $SkillFile )) { continue }
47+ $LinkName = $SkillDir.Name
48+ $LinkPath = Join-Path $SkillsDir $LinkName
49+ if (Test-Path $LinkPath ) { Remove-Item $LinkPath - Force - Recurse }
50+ try {
51+ New-Item - ItemType SymbolicLink - Path $LinkPath - Target $SkillDir.FullName | Out-Null
52+ } catch {
53+ cmd / c mklink / J " $LinkPath " " $ ( $SkillDir.FullName ) " | Out-Null
54+ }
55+ Write-Host " Linked: $LinkName -> $ ( $SkillDir.FullName ) "
4156 }
42- Write-Host " Linked: $LinkName -> $ ( $GroupDir.FullName ) "
4357}
4458
4559Write-Host " Done. Skills installed to $SkillsDir "
0 commit comments