{
  "source_file": "src/summarization/prompts.py",
  "generated_at": "2026-01-10T22:55:11.154906",
  "summary": {
    "purpose": "This file contains functions and constants for generating optimized prompts for code repository summarization, adhering to specific design principles and rules.",
    "exports": [
      "_as_list",
      "build_json_fix_prompt",
      "estimate_tokens",
      "truncate_content",
      "extract_signatures",
      "build_readme_analysis_prompt",
      "build_global_summary_prompt",
      "build_architecture_prompt",
      "build_getting_started_prompt"
    ],
    "imports": [
      "json",
      "re"
    ],
    "key_components": [
      {
        "name": "SYSTEM_PROMPT",
        "type": "constant",
        "description": "A detailed system prompt for the code analyzer, enforcing specific rules for JSON output and preventing code generation."
      },
      {
        "name": "SYSTEM_PROMPT_DETAILED",
        "type": "constant",
        "description": "A more detailed system prompt for the code analyzer, providing additional rules and requirements."
      },
      {
        "name": "_as_list",
        "type": "function",
        "description": "Converts input to a list, handling various data types."
      },
      {
        "name": "build_json_fix_prompt",
        "type": "function",
        "description": "Generates a JSON fix prompt for invalid JSON, ensuring it conforms to the specified rules."
      },
      {
        "name": "estimate_tokens",
        "type": "function",
        "description": "Estimates the number of tokens in a given text."
      },
      {
        "name": "truncate_content",
        "type": "function",
        "description": "Truncates content to a specified maximum number of tokens."
      },
      {
        "name": "extract_signatures",
        "type": "function",
        "description": "Extracts function signatures from code content."
      },
      {
        "name": "build_readme_analysis_prompt",
        "type": "function",
        "description": "Generates a prompt for analyzing a README file."
      },
      {
        "name": "build_global_summary_prompt",
        "type": "function",
        "description": "Generates a global summary prompt for a repository."
      },
      {
        "name": "build_architecture_prompt",
        "type": "function",
        "description": "Generates an architecture prompt for a repository."
      },
      {
        "name": "build_getting_started_prompt",
        "type": "function",
        "description": "Generates a getting started prompt for a repository."
      }
    ],
    "data_structures": "List, Dict, str, int",
    "algorithms": "None explicitly defined in the code",
    "configuration": "None explicitly defined in the code",
    "notes": "The functions are designed to generate prompts for summarizing code repositories, with specific rules for JSON output and code generation prevention."
  }
}