From da11841565809c1657ae225d59e4ec0be7e4e6d6 Mon Sep 17 00:00:00 2001 From: Julian lechner Date: Wed, 30 Sep 2026 09:23:39 +0200 Subject: [PATCH] fix(doctor): detect underscored placeholders --- scripts/commands/doctor.ps1 | 2 +- scripts/commands/doctor.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/commands/doctor.ps1 b/scripts/commands/doctor.ps1 index b4dcc3e..e05d6f7 100644 --- a/scripts/commands/doctor.ps1 +++ b/scripts/commands/doctor.ps1 @@ -34,7 +34,7 @@ foreach ($shell in @('powershell','bash')) { $expectedSkillCount = if ($client -eq 'claude') { $sourceSkillCount + $ruleSkillCount } else { $sourceSkillCount } $skillCount = @(Get-ChildItem (Join-Path $package 'skills') -Filter 'SKILL.md' -Recurse -ErrorAction SilentlyContinue).Count if ($skillCount -eq $expectedSkillCount) { Result 'PASS' "$client-$shell skill count matches source ($skillCount)" } else { Result 'FAIL' "$client-$shell skill count $skillCount does not match source ($expectedSkillCount)" } - $placeholderHits = @(Get-ChildItem $package -File -Recurse | Where-Object { ((Get-Content -LiteralPath $_.FullName -Raw) -replace '__AI_CONFIG_ROOT__|__POWERSHELL_COMMAND__|__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__', '') -cmatch '__[A-Z0-9_]+__' }) + $placeholderHits = @(Get-ChildItem $package -File -Recurse | Where-Object { ((Get-Content -LiteralPath $_.FullName -Raw) -replace '__AI_CONFIG_ROOT__|__POWERSHELL_COMMAND__|__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__', '') -cmatch '__[A-Z0-9_]*[A-Z0-9][A-Z0-9_]*__' }) if ($placeholderHits.Count -eq 0) { Result 'PASS' "$client-$shell has no unresolved placeholders" } else { Result 'FAIL' "$client-$shell has unresolved placeholders: $($placeholderHits.FullName -join ', ')" } } } diff --git a/scripts/commands/doctor.sh b/scripts/commands/doctor.sh index 247f6d7..b522132 100644 --- a/scripts/commands/doctor.sh +++ b/scripts/commands/doctor.sh @@ -44,7 +44,7 @@ for shell in powershell bash; do [ "$client" != claude ] || expected_skill_count=$((source_skill_count + rule_skill_count)) skill_count=$(find "$package/skills" -name SKILL.md 2>/dev/null | wc -l) if [ "$skill_count" -eq "$expected_skill_count" ]; then result PASS "$client-$shell skill count matches source ($skill_count)"; else result FAIL "$client-$shell skill count $skill_count does not match source ($expected_skill_count)"; fi - leftover_tokens=$(grep -RohE '__[A-Z0-9_]+__' "$package" 2>/dev/null | sort -u | grep -Ev '^(__AI_CONFIG_ROOT__|__POWERSHELL_COMMAND__|__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__)$' || true) + leftover_tokens=$(grep -RohE '__[A-Z0-9_]*[A-Z0-9][A-Z0-9_]*__' "$package" 2>/dev/null | sort -u | grep -Ev '^(__AI_CONFIG_ROOT__|__POWERSHELL_COMMAND__|__CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY__)$' || true) if [ -n "$leftover_tokens" ]; then result FAIL "$client-$shell has unresolved placeholders"; else result PASS "$client-$shell has no unresolved placeholders"; fi done done