from pathlib import Path from hqt.skills.registry import SkillRegistry def test_discover_skills(tmp_path: Path): skill_dir = tmp_path / "my-skill" skill_dir.mkdir() (skill_dir / "SKILL.md").write_text("---\nname: my-skill\ndescription: A test skill\n---\nSkill content here") registry = SkillRegistry(tmp_path) skills = registry.discover() assert len(skills) == 1 assert skills[0].name == "my-skill" assert skills[0].description == "A test skill" assert skills[0].content == "Skill content here" def test_discover_empty_dir(tmp_path: Path): registry = SkillRegistry(tmp_path) assert registry.discover() == [] def test_discover_nonexistent_dir(tmp_path: Path): registry = SkillRegistry(tmp_path / "nope") assert registry.discover() == []