Sync-ManagedDestination and Copy-Directory cut relative paths by the length of $Source. With an 8.3 short path such as JULIAN~1, Get-ChildItem returned long paths, so files landed under a truncated directory name. Both now expand $Source with Get-Item first. PowerShell tests now pass -ExecutionPolicy Bypass, tolerate non-UTF-8 console output, and give the Git Bash quick update 300 seconds. The orchestration rule now covers plugin workflows. A plugin default alone never authorizes subagents, per-task reviews stay proportional, parallel writers get disjoint files, and plugin agents keep to their specialty inside the shared handoff format. doctor warns when an installed Impeccable or Apple Design skill no longer names the commands and sections plugin-workflow relies on. Prompt budget baselines are refreshed to the current values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.7 KiB
Python
43 lines
1.7 KiB
Python
import importlib.util
|
|
from pathlib import Path
|
|
import tempfile
|
|
import unittest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
SPEC = importlib.util.spec_from_file_location('contracts', ROOT / 'scripts/lib/skill-contracts.py')
|
|
CONTRACTS = importlib.util.module_from_spec(SPEC)
|
|
SPEC.loader.exec_module(CONTRACTS)
|
|
|
|
|
|
class SkillContractTests(unittest.TestCase):
|
|
def setUp(self):
|
|
directory = tempfile.TemporaryDirectory()
|
|
self.addCleanup(directory.cleanup)
|
|
self.home = Path(directory.name)
|
|
|
|
def write(self, relative, text):
|
|
path = self.home / relative
|
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
path.write_text(text, encoding='utf-8')
|
|
|
|
def test_reports_nothing_when_skills_are_absent(self):
|
|
self.assertEqual([], CONTRACTS.check(self.home))
|
|
|
|
def test_passes_complete_skill_and_warns_on_missing_names(self):
|
|
self.write('.claude/skills/apple-design/SKILL.md', ' '.join(CONTRACTS.CONTRACTS['apple-design'][1]))
|
|
self.write('.agents/skills/impeccable/SKILL.md', 'critique audit')
|
|
results = dict((message.split(' at ')[0], status) for status, message in CONTRACTS.check(self.home))
|
|
self.assertEqual({'Apple Design': 'PASS', 'Impeccable': 'WARN'}, results)
|
|
|
|
def test_uses_highest_cached_plugin_version(self):
|
|
tokens = ' '.join(CONTRACTS.CONTRACTS['impeccable'][1])
|
|
self.write('.claude/plugins/cache/impeccable/impeccable/4.10.0/skills/impeccable/SKILL.md', tokens)
|
|
self.write('.claude/plugins/cache/impeccable/impeccable/4.9.2/skills/impeccable/SKILL.md', 'old')
|
|
[(status, message)] = CONTRACTS.check(self.home)
|
|
self.assertEqual('PASS', status)
|
|
self.assertIn('4.10.0', message)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|