1414# Planning Stage Prompts
1515# =============================================================================
1616
17- PLANNING_SYSTEM_PROMPT = """You are a PostgreSQL expert helping to plan a database analysis report.
17+ PLANNING_SYSTEM_PROMPT = """You are a PostgreSQL expert helping to plan a
18+ database analysis report.
1819
19- Your task is to select which analysis sections are most relevant for the given report type and database context.
20+ Your task is to select which analysis sections are most relevant for the
21+ given report type and database context.
2022
2123Return ONLY a JSON array of section IDs to analyze, ordered by priority.
2224Only include sections that are relevant given the database characteristics.
@@ -55,14 +57,16 @@ def get_planning_user_prompt(
5557- Table count: { context .get ('table_count' , 'Unknown' )}
5658- Has pg_stat_statements: { context .get ('has_stat_statements' , False )}
5759
58- Return a JSON array of section IDs to analyze, e.g.: ["section1", "section2", "section3"]"""
60+ Return a JSON array of section IDs to analyze, e.g.:
61+ ["section1", "section2", "section3"]"""
5962
6063
6164# =============================================================================
6265# Section Analysis Prompts
6366# =============================================================================
6467
65- SECTION_ANALYSIS_SYSTEM_PROMPT = """You are a PostgreSQL expert analyzing database configuration.
68+ SECTION_ANALYSIS_SYSTEM_PROMPT = """You are a PostgreSQL expert analyzing
69+ database configuration.
6670
6771Analyze the provided data and generate a concise summary (max 300 words).
6872
@@ -111,7 +115,8 @@ def get_section_analysis_prompt(
111115
112116 data_json = json .dumps (data , indent = 2 , default = str )
113117
114- return f"""Analyze the following { section_name } data for a PostgreSQL { context .get ('server_version' , '' )} server.
118+ return f"""Analyze the following { section_name } data for a PostgreSQL
119+ { context .get ('server_version' , '' )} server.
115120
116121Section focus: { section_description }
117122
@@ -130,19 +135,25 @@ def get_section_analysis_prompt(
130135# Synthesis Prompts
131136# =============================================================================
132137
133- SYNTHESIS_SYSTEM_PROMPT = """You are a PostgreSQL expert creating a comprehensive report.
138+ SYNTHESIS_SYSTEM_PROMPT = """You are a PostgreSQL expert creating a
139+ comprehensive report.
134140
135141Combine the section summaries into a cohesive, well-organized report.
136142
137143Your report MUST:
1381441. Start with an **Executive Summary** (3-5 sentences overview)
139- 2. Include a **Critical Issues** section (aggregate all critical/warning findings)
140- 3. Include each section's detailed analysis (use the section content as-is, don't add duplicate headers)
141- 4. End with **Prioritized Recommendations** (numbered list, most important first)
145+ 2. Include a **Critical Issues** section (aggregate all critical/warning
146+ findings)
147+ 3. Include each section's detailed analysis (use the section content as-is,
148+ don't add duplicate headers)
149+ 4. End with **Prioritized Recommendations** (numbered list, most important
150+ first)
142151
143152IMPORTANT:
144- - Do NOT include a report title at the very beginning - start directly with Executive Summary
145- - Each section already has its own ### header - do NOT add extra headers around them
153+ - Do NOT include a report title at the very beginning - start directly with
154+ Executive Summary
155+ - Each section already has its own ### header - do NOT add extra headers
156+ around them
146157- Simply organize and flow the sections together naturally
147158
148159Use severity indicators consistently:
@@ -151,7 +162,8 @@ def get_section_analysis_prompt(
151162- 🟡 Advisory - Consider improving
152163- 🟢 Good - No issues found
153164
154- Be professional and actionable. Include SQL commands for recommendations where helpful."""
165+ Be professional and actionable. Include SQL commands for recommendations
166+ where helpful."""
155167
156168
157169def get_synthesis_prompt (
@@ -186,7 +198,8 @@ def get_synthesis_prompt(
186198 if context .get ('schema_name' ):
187199 scope_info = f"{ context ['schema_name' ]} schema in { scope_info } "
188200
189- return f"""Create a comprehensive { report_type_display } Report for { scope_info } .
201+ return f"""Create a comprehensive { report_type_display } Report for
202+ { scope_info } .
190203
191204Server: PostgreSQL { context .get ('server_version' , 'Unknown' )}
192205
0 commit comments