diff --git a/agents/s05_skill_loading.py b/agents/s05_skill_loading.py index 07e580e82..17be20581 100644 --- a/agents/s05_skill_loading.py +++ b/agents/s05_skill_loading.py @@ -40,6 +40,8 @@ import subprocess from pathlib import Path +import yaml + from anthropic import Anthropic from dotenv import load_dotenv @@ -75,11 +77,7 @@ def _parse_frontmatter(self, text: str) -> tuple: 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() + meta = yaml.safe_load(match.group(1)) or {} return meta, match.group(2).strip() def get_descriptions(self) -> str: diff --git a/requirements.txt b/requirements.txt index 55f896d40..c27dfcc04 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ anthropic>=0.25.0 python-dotenv>=1.0.0 +pyyaml>=6.0 \ No newline at end of file