INNER CODE UNIT · Python

load_style_guides

panther-labs/panther-analysis · .scripts/claude_review.py:66

def load_style_guides():
    """Load all style guide markdown files."""
    style_dir = REPO_ROOT / "style_guides"
    if not style_dir.is_dir():
        return ""

    parts = []
    for guide in sorted(style_dir.glob("*.md")):
        content = guide.read_text(encoding="utf-8", errors="replace")
        parts.append(f"--- STYLE GUIDE: {guide.name} ---\n{content}\n--- END: {guide.name} ---")
    return "\n\n".join(parts)


def build_review_prompt(changed_files, file_contents, style_guides):
    """Build the review prompt."""
    has_queries = any(f.startswith("queries/") for f in changed_files)
    has_correlation = any(f.startswith("correlation_rules/") for f in changed_files)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…