"""Helpers to load system prompts from agents/prompts/*.md. Prompts are stored as Markdown files so they can be edited without code changes. They are read once at module-load time (cached at import scope) and returned as plain strings to the Agents SDK ``instructions=...`` parameter. """ from __future__ import annotations from functools import lru_cache from pathlib import Path _PROMPTS_DIR = Path(__file__).parent / "prompts" @lru_cache(maxsize=8) def load_prompt(name: str) -> str: """Load ``agents/prompts/.md`` and return its text. Parameters ---------- name: Stem of the prompt file (no ``.md`` suffix). Examples: ``"slide_reviewer"``, ``"consistency"``, ``"lead_auditor"``. """ path = _PROMPTS_DIR / f"{name}.md" if not path.exists(): raise FileNotFoundError(f"Prompt file not found: {path}") return path.read_text(encoding="utf-8")