From 724ccfebd69ccf34fcd2392e215c688e4e1ff335 Mon Sep 17 00:00:00 2001 From: PeninsulaInd Date: Tue, 17 Feb 2026 10:03:22 -0600 Subject: [PATCH] 2.4: Strip frontmatter in press_release.py _load_skill() The _load_skill() function now strips YAML frontmatter (--- ... ---) before returning skill content. This prevents the execution brain from receiving metadata intended for the skill registry. Co-Authored-By: Claude Opus 4.6 --- cheddahbot/tools/press_release.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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: