diff --git a/scripts/lib/selection-state.py b/scripts/lib/selection-state.py index f2edc6a..ce596ce 100644 --- a/scripts/lib/selection-state.py +++ b/scripts/lib/selection-state.py @@ -22,6 +22,7 @@ def validate(state, allow_legacy=False): state['semantic_retrieval'] = False if 'statusline' not in state: state['statusline'] = True + state.pop('skill_profile', None) state.pop('update_agents', None) if any(type(state.get(key)) is not bool for key in ('flashbang', 'statusline', 'semantic_retrieval')): raise ValueError('Invalid saved install options. Run update once without Quick.') diff --git a/scripts/tests/test-quick-update.py b/scripts/tests/test-quick-update.py index 9ad6192..fc5f7a2 100644 --- a/scripts/tests/test-quick-update.py +++ b/scripts/tests/test-quick-update.py @@ -80,6 +80,14 @@ class SelectionTests(unittest.TestCase): self.assertTrue(state['statusline']) self.assertIn('semantic_retrieval\ttrue', self.run_state('read', '--format', 'tsv').stdout) + def test_legacy_skill_profile_is_ignored(self): + self.save() + state = json.loads(self.run_state('read').stdout) + state['skill_profile'] = 'core' + self.path.write_text(json.dumps(state)) + self.assertNotIn('skill_profile', json.loads(self.run_state('read').stdout)) + self.assertNotIn('skill_profile', self.run_state('read', '--format', 'tsv').stdout) + def test_invalid_write_preserves_last_selection(self): self.save('--selected', 'Superpowers') original = self.path.read_bytes() diff --git a/scripts/tests/test-shell-packages.ps1 b/scripts/tests/test-shell-packages.ps1 index 6b3d25f..6a202b5 100644 --- a/scripts/tests/test-shell-packages.ps1 +++ b/scripts/tests/test-shell-packages.ps1 @@ -48,6 +48,7 @@ foreach ($shell in @('powershell','bash')) { if ($client -eq 'claude' -and (Get-Content (Join-Path $package 'agents/reviewer.md') -Raw) -notmatch "(?m)^tools: Read,Grep,Glob,$expectedReviewerShellTool\r?`$") { throw "Reviewer capability profile is missing in $package" } $expectedSkillCount = if ($client -eq 'claude') { $sourceSkillCount + $ruleSkillCount } else { $sourceSkillCount } if (@(Get-ChildItem "$package/skills" -Filter SKILL.md -Recurse).Count -ne $expectedSkillCount) { throw "Missing skills in $package" } + if (-not (Test-Path "$package/skills/debugging/SKILL.md") -or -not (Test-Path "$package/skills/copywriting/SKILL.md") -or -not (Test-Path "$package/skills/marketing-psychology/SKILL.md") -or -not (Test-Path "$package/skills/image/SKILL.md") -or (Test-Path "$package/skills/marketing-plan/SKILL.md") -or (Test-Path "$package/skills/social/SKILL.md")) { throw "Incorrect skill catalog in $package" } $expected = if ($shell -eq 'powershell') { '__POWERSHELL_COMMAND__ .*flashbang.ps1' } else { 'bash .*flashbang.sh' } if ($content -notmatch $expected -or $content -match '__HOOK_|__POWERSHELL_HOOK_') { throw "Incorrect shell command in $package" } if ($shell -eq 'powershell' -and $content -match 'WindowStyle\s+Hidden') { throw "PowerShell hook hides the terminal in $package" } diff --git a/scripts/tests/test-shell-packages.sh b/scripts/tests/test-shell-packages.sh index df04dde..f973d9f 100644 --- a/scripts/tests/test-shell-packages.sh +++ b/scripts/tests/test-shell-packages.sh @@ -55,6 +55,12 @@ for shell in powershell bash; do expected_skill_count=$source_skill_count [ "$client" != claude ] || expected_skill_count=$((source_skill_count + rule_skill_count)) test "$(find "$package/skills" -name SKILL.md | wc -l)" -eq "$expected_skill_count" + test -f "$package/skills/debugging/SKILL.md" + test -f "$package/skills/copywriting/SKILL.md" + test -f "$package/skills/marketing-psychology/SKILL.md" + test -f "$package/skills/image/SKILL.md" + test ! -e "$package/skills/marketing-plan/SKILL.md" + test ! -e "$package/skills/social/SKILL.md" if [ "$shell" = powershell ]; then grep -q '__POWERSHELL_COMMAND__ .*flashbang.ps1' "$package/$file" ! grep -Eq 'WindowStyle[[:space:]]+Hidden' "$package/$file"