diff --git a/cheddahbot/tools/press_release.py b/cheddahbot/tools/press_release.py index 314c9c5..e69b33e 100644 --- a/cheddahbot/tools/press_release.py +++ b/cheddahbot/tools/press_release.py @@ -49,11 +49,19 @@ def _set_status(ctx: dict | None, message: str) -> None: def _load_skill(filename: str) -> str: - """Read a markdown skill file from the skills/ directory.""" + """Read a markdown skill file from the skills/ directory, stripping frontmatter.""" path = _SKILLS_DIR / filename if not path.exists(): raise FileNotFoundError(f"Skill file not found: {path}") - return path.read_text(encoding="utf-8") + text = path.read_text(encoding="utf-8") + + # Strip YAML frontmatter (--- ... ---) if present + if text.startswith("---"): + end = text.find("---", 3) + if end != -1: + text = text[end + 3 :].strip() + + return text def _load_file_if_exists(path: Path) -> str: