swapped docs symlink

This commit is contained in:
John Lancaster
2026-08-07 21:07:23 -05:00
parent 5005cd7001
commit f240486a7e
92 changed files with 69 additions and 42 deletions
+15 -5
View File
@@ -1,4 +1,5 @@
from pathlib import Path
from importlib.resources import files
from importlib.resources.abc import Traversable
import pytest
import yaml
@@ -11,7 +12,15 @@ from personal_mcp.skills import create_skills_provider
pytestmark = pytest.mark.unit
SKILLS_ROOT = Path(__file__).parents[2] / "docs" / "skills"
SKILLS_ROOT = files("personal_mcp").joinpath("docs", "skills")
def skill_directories() -> list[Traversable]:
return [
directory
for directory in SKILLS_ROOT.iterdir()
if directory.is_dir() and directory.joinpath("SKILL.md").is_file()
]
class TestSkillsProvider:
@@ -20,7 +29,7 @@ class TestSkillsProvider:
@pytest.mark.asyncio
async def test_discovers_authored_skills(self) -> None:
"""Ensures each authored skill is exposed with its description."""
expected_names = {path.parent.name for path in SKILLS_ROOT.glob("*/SKILL.md")}
expected_names = {directory.name for directory in skill_directories()}
mcp = FastMCP("skills-test")
mcp.add_provider(create_skills_provider())
@@ -48,10 +57,11 @@ class TestSkillsProvider:
def test_frontmatter_names_match_directories(self) -> None:
"""Ensures provider identity and authored skill names remain aligned."""
for skill_file in SKILLS_ROOT.glob("*/SKILL.md"):
for directory in skill_directories():
skill_file = directory.joinpath("SKILL.md")
raw = skill_file.read_text(encoding="utf-8")
frontmatter = yaml.safe_load(raw.split("---", 2)[1])
assert set(frontmatter) == {"name", "description"}
assert frontmatter["name"] == skill_file.parent.name
assert frontmatter["name"] == directory.name
assert frontmatter["description"]