test(skills): verify reduced catalog handling
This commit is contained in:
1 parent
05663197f7
commit
f7eec43122
4 files changed
+16
No files matched your search
@@ -22,6 +22,7 @@ def validate(state, allow_legacy=False):
|
|||||||
state['semantic_retrieval'] = False
|
state['semantic_retrieval'] = False
|
||||||
if 'statusline' not in state:
|
if 'statusline' not in state:
|
||||||
state['statusline'] = True
|
state['statusline'] = True
|
||||||
|
state.pop('skill_profile', None)
|
||||||
state.pop('update_agents', None)
|
state.pop('update_agents', None)
|
||||||
if any(type(state.get(key)) is not bool for key in ('flashbang', 'statusline', 'semantic_retrieval')):
|
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.')
|
raise ValueError('Invalid saved install options. Run update once without Quick.')
|
||||||
|
|||||||
@@ -80,6 +80,14 @@ class SelectionTests(unittest.TestCase):
|
|||||||
self.assertTrue(state['statusline'])
|
self.assertTrue(state['statusline'])
|
||||||
self.assertIn('semantic_retrieval\ttrue', self.run_state('read', '--format', 'tsv').stdout)
|
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):
|
def test_invalid_write_preserves_last_selection(self):
|
||||||
self.save('--selected', 'Superpowers')
|
self.save('--selected', 'Superpowers')
|
||||||
original = self.path.read_bytes()
|
original = self.path.read_bytes()
|
||||||
|
|||||||
@@ -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" }
|
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 }
|
$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 (@(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' }
|
$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 ($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" }
|
if ($shell -eq 'powershell' -and $content -match 'WindowStyle\s+Hidden') { throw "PowerShell hook hides the terminal in $package" }
|
||||||
|
|||||||
@@ -55,6 +55,12 @@ for shell in powershell bash; do
|
|||||||
expected_skill_count=$source_skill_count
|
expected_skill_count=$source_skill_count
|
||||||
[ "$client" != claude ] || expected_skill_count=$((source_skill_count + rule_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 "$(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
|
if [ "$shell" = powershell ]; then
|
||||||
grep -q '__POWERSHELL_COMMAND__ .*flashbang.ps1' "$package/$file"
|
grep -q '__POWERSHELL_COMMAND__ .*flashbang.ps1' "$package/$file"
|
||||||
! grep -Eq 'WindowStyle[[:space:]]+Hidden' "$package/$file"
|
! grep -Eq 'WindowStyle[[:space:]]+Hidden' "$package/$file"
|
||||||
|
|||||||
Reference in new issue
Block a user