doc first implementation

This commit is contained in:
John Lancaster
2026-06-18 20:41:06 -05:00
parent d1c80d4737
commit 4b1a261b2d
17 changed files with 150 additions and 268 deletions
@@ -0,0 +1,22 @@
from pathlib import Path
def _repo_root() -> Path:
return Path(__file__).resolve().parents[3]
def load_skill_document(*, skill_id: str, skill_slug: str) -> dict[str, str]:
"""Load the canonical skill markdown document for an MCP skill."""
document_path = _repo_root() / "skills" / skill_slug / "SKILL.md"
if not document_path.exists():
raise FileNotFoundError(
f"Missing skill document for '{skill_id}': {document_path}"
)
return {
"id": skill_id,
"uri": f"resource://skills/{skill_id}/document",
"format": "markdown",
"source_path": str(document_path),
"content": document_path.read_text(encoding="utf-8"),
}