diff --git a/tools-sync/scripts/sync_repos.ps1 b/tools-sync/scripts/sync_repos.ps1 index 19968cc..16f7542 100644 --- a/tools-sync/scripts/sync_repos.ps1 +++ b/tools-sync/scripts/sync_repos.ps1 @@ -376,8 +376,17 @@ if ($MirrorRegistry) { # A primary entry that is itself a link belongs to whichever host installed it (its real home # is a registry the host already exposes to Codex). Mirroring it would register it twice. - $primarySkills = Get-ChildItem $ClaudeSkills -Directory -Force | + $primaryDirs = Get-ChildItem $ClaudeSkills -Directory -Force | Where-Object { $_.Name -notlike ".*" -and -not (Test-IsLink $_) } + # A directory without SKILL.md at its top level is not a skill -- e.g. 'synced/', the + # runtime cache of account-side skills Claude Code downloads. Mirroring it is worse than + # useless: its NESTED directories do carry SKILL.md, so Codex would register that whole + # set a second time alongside the ones it already gets from the account. + $primarySkills = $primaryDirs | Where-Object { Test-Path (Join-Path $_.FullName "SKILL.md") } + $notSkills = $primaryDirs | Where-Object { -not (Test-Path (Join-Path $_.FullName "SKILL.md")) } + if ($notSkills) { + Write-Host " not skills (no SKILL.md), not mirrored: $(($notSkills | ForEach-Object Name) -join ', ')" + } foreach ($d in $primarySkills) { $link = Join-Path $MirrorRegistry $d.Name if (Test-Path $link) { continue }