Merge pull request #140 from 1thanMoon/fix/s05-frontmatter-multiline-yaml

fix: skill description not fully loaded from SKILL.md frontmatter
This commit is contained in:
Xinlu Lai
2026-03-29 22:49:22 +08:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ Key insight: "Don't put everything in the system prompt. Load on demand."
import os
import re
import subprocess
import yaml
from pathlib import Path
from anthropic import Anthropic
@@ -75,11 +76,10 @@ class SkillLoader:
match = re.match(r"^---\n(.*?)\n---\n(.*)", text, re.DOTALL)
if not match:
return {}, text
meta = {}
for line in match.group(1).strip().splitlines():
if ":" in line:
key, val = line.split(":", 1)
meta[key.strip()] = val.strip()
try:
meta = yaml.safe_load(match.group(1)) or {}
except yaml.YAMLError:
meta = {}
return meta, match.group(2).strip()
def get_descriptions(self) -> str: