doc first implementation
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
Reference in New Issue
Block a user