2026-11-03 13:43:15 +01:00
|
|
|
"""Validate the kvb-skill-tune skill text and its persistence targets."""
|
2026-07-25 18:24:53 +02:00
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
2026-11-03 13:08:31 +01:00
|
|
|
SKILL = REPO_ROOT / "skills" / "kvb-skill-tune" / "SKILL.md"
|
2026-07-25 18:24:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestAutotuneSkill(unittest.TestCase):
|
|
|
|
|
def test_skill_is_trigger_only(self):
|
|
|
|
|
text = SKILL.read_text(encoding="utf-8")
|
2026-11-03 13:08:31 +01:00
|
|
|
self.assertIn("name: kvb-skill-tune", text)
|
2026-07-25 18:24:53 +02:00
|
|
|
self.assertIn("multiSelect: false", text)
|
|
|
|
|
|
2026-11-03 13:43:15 +01:00
|
|
|
def test_skill_has_no_own_reminder_hook(self):
|
|
|
|
|
self.assertFalse((SKILL.parent / "hooks").exists())
|
|
|
|
|
|
2026-07-25 18:24:53 +02:00
|
|
|
|
2026-08-02 19:39:43 +02:00
|
|
|
class TestSkillPersistence(unittest.TestCase):
|
|
|
|
|
"""Both skill writers must persist to the skills repository AND the live dirs."""
|
|
|
|
|
|
|
|
|
|
def test_autotune_names_every_target(self):
|
|
|
|
|
text = SKILL.read_text(encoding="utf-8")
|
2026-08-10 17:13:29 +02:00
|
|
|
for target in (
|
|
|
|
|
"SKILLS_REPO",
|
|
|
|
|
"skills/<name>/SKILL.md",
|
|
|
|
|
"~/.claude/skills/",
|
|
|
|
|
"~/.agents/skills/",
|
|
|
|
|
):
|
2026-08-02 19:39:43 +02:00
|
|
|
self.assertIn(target, text)
|
|
|
|
|
|
|
|
|
|
def test_autoskill_routes_to_the_same_persistence(self):
|
2026-11-03 13:08:31 +01:00
|
|
|
text = (REPO_ROOT / "skills" / "kvb-skill-auto" / "SKILL.md").read_text(
|
2026-08-10 17:13:29 +02:00
|
|
|
encoding="utf-8"
|
|
|
|
|
)
|
2026-08-02 19:39:43 +02:00
|
|
|
for target in ("Persistence", "~/.claude/skills/", "~/.agents/skills/"):
|
|
|
|
|
self.assertIn(target, text)
|
|
|
|
|
|
|
|
|
|
|
2026-07-25 18:24:53 +02:00
|
|
|
if __name__ == "__main__":
|
|
|
|
|
unittest.main()
|