You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""|You are analyzing a software codebase that includes a README file and source code files. Your task is to extract a structured summary of the codebase’s architecture, components, and relationships.
90
+
"""|You are analyzing a software codebase that includes a README file and source code files. Your task is to extract a structured, file-by-file analysis of the codebase's architecture, components, and interconnections.
91
91
|
92
-
|Use the information provided below.
92
+
|Use only the information provided below.
93
93
|
94
94
|----------------------
95
95
|README Content:
@@ -104,14 +104,14 @@ data class ModelContextService(
104
104
|${codeSnippets.joinToString("\n\n")}
105
105
|----------------------
106
106
|
107
-
|For each file:
108
-
|- File name and language
109
-
|- Main classes, functions, or data structures
110
-
|- Purpose of the file (based on comments, function names, etc.)
111
-
|- Key public interfaces (functions, methods, classes)
112
-
|- If applicable, how this file connects to other parts of the codebase (e.g. imports, API usage, function calls)
107
+
|For each file, extract the following:
108
+
|- File path and programming language
109
+
|- Main classes, functions, or data structures defined
110
+
|- Purpose of the file (what it does and why it exists)
111
+
|- Key public interfaces (classes, methods, functions)
112
+
|- Dependencies and relationships (e.g., imports, API usage, method calls across files)
113
113
|
114
-
|Use this format:
114
+
|Output using this format:
115
115
|
116
116
|### File: path/to/file.ext (Language: X)
117
117
|- **Purpose**: ...
@@ -120,8 +120,11 @@ data class ModelContextService(
120
120
|- **Relationships**:
121
121
| - ...
122
122
|
123
-
|Repeat this for all files. Avoid speculation. Be concise and grounded in the content above.
124
-
|"""
123
+
|Important:
124
+
|- Be specific and factual; avoid speculation.
125
+
|- Use information from comments, function names, or obvious patterns.
126
+
|- Summarize concisely; no fluff.
127
+
"""
125
128
.trimMargin()
126
129
127
130
/**
@@ -131,40 +134,40 @@ data class ModelContextService(
131
134
* @return A structured prompt for the model
132
135
*/
133
136
funbuildSummaryPrompt(insights:String): String=
134
-
"""|You are writing a high-level but technically accurate summary of a software codebase for a developer unfamiliar with the project.
137
+
"""|You are writing a high-level, technically accurate summary of a software codebase. The reader is a developer unfamiliar with the project, so your explanation should clarify the purpose, structure, and important technical details.
135
138
|
136
-
|Use the extracted structural analysis below to build the summary.
139
+
|Use the structured analysis below to guide your summary.
137
140
|
138
141
|----------------------
139
-
|
140
142
|Structural Analysis:
141
143
|
142
144
|${parseInsights(insights)}
143
145
|----------------------
144
146
|
145
-
|You must include:
147
+
|Include the following in your output:
146
148
|
147
-
|1. **Main Purpose** – what the software does, who might use it.
148
-
|2. **Architecture Overview** – main components and how they interact.
149
-
|3. **Technologies and Languages** – what languages, frameworks, or tools are used.
150
-
|4. **Key Workflows** – example flow of data, processing, or control (e.g., "HTTP request -> router -> controller -> database").
151
-
|5. **Strengths and Weaknesses** – any observed complexity, tight coupling, lack of documentation, or reusable design patterns.
149
+
|1. **Main Purpose** – What the software does, the problem it solves, and who uses it.
150
+
|2. **Architecture Overview** – Key components or layers and how they interact. Describe patterns if evident (e.g., microservices, event-driven, layered architecture).
151
+
|3. **Technologies and Languages** – List the programming language(s), major frameworks/libraries, and any notable tools.
152
+
|4. **Key Workflows** – Show how dataor control flows through the system. Prefer concrete examples (e.g., "Kafka -> Consumer -> Metrics tracker -> Monitoring system").
153
+
|5. **Strengths and Weaknesses** – Mention any strengths (modularity, patterns, scalability) and issues (tight coupling, complexity, missing docs).
152
154
|
153
-
|Where helpful, include:
154
-
|- Short code snippets or function/method names (language-agnostic).
155
-
|- Architecture patterns if detected (e.g., MVC, pub/sub, monolith, microservice).
155
+
|Also consider:
156
+
|- Noteworthy classes, functions, or modules
157
+
|- Signs of testability, extensibility, or maintainability
158
+
|- Use of design patterns (Builder, Observer, etc.)
156
159
|
157
-
|Format the output using Markdown. Be conciseand insightful.
158
-
"""
160
+
|Write the output in well-structured **Markdown**. Be concise, insightful, and avoid guessing.
0 commit comments