codeboarding 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agents/__init__.py +0 -0
- agents/abstraction_agent.py +150 -0
- agents/agent.py +467 -0
- agents/agent_responses.py +363 -0
- agents/cluster_methods_mixin.py +281 -0
- agents/constants.py +13 -0
- agents/dependency_discovery.py +159 -0
- agents/details_agent.py +174 -0
- agents/llm_config.py +309 -0
- agents/meta_agent.py +105 -0
- agents/planner_agent.py +105 -0
- agents/prompts/__init__.py +85 -0
- agents/prompts/abstract_prompt_factory.py +63 -0
- agents/prompts/claude_prompts.py +381 -0
- agents/prompts/deepseek_prompts.py +389 -0
- agents/prompts/gemini_flash_prompts.py +362 -0
- agents/prompts/glm_prompts.py +407 -0
- agents/prompts/gpt_prompts.py +470 -0
- agents/prompts/kimi_prompts.py +400 -0
- agents/prompts/prompt_factory.py +179 -0
- agents/tools/__init__.py +8 -0
- agents/tools/base.py +96 -0
- agents/tools/get_external_deps.py +47 -0
- agents/tools/get_method_invocations.py +47 -0
- agents/tools/read_cfg.py +60 -0
- agents/tools/read_docs.py +132 -0
- agents/tools/read_file.py +90 -0
- agents/tools/read_file_structure.py +156 -0
- agents/tools/read_git_diff.py +131 -0
- agents/tools/read_packages.py +60 -0
- agents/tools/read_source.py +105 -0
- agents/tools/read_structure.py +49 -0
- agents/tools/toolkit.py +119 -0
- agents/validation.py +383 -0
- caching/__init__.py +4 -0
- caching/cache.py +29 -0
- caching/meta_cache.py +227 -0
- codeboarding-0.9.0.dist-info/METADATA +223 -0
- codeboarding-0.9.0.dist-info/RECORD +126 -0
- codeboarding-0.9.0.dist-info/WHEEL +5 -0
- codeboarding-0.9.0.dist-info/entry_points.txt +3 -0
- codeboarding-0.9.0.dist-info/licenses/LICENSE +21 -0
- codeboarding-0.9.0.dist-info/top_level.txt +18 -0
- core/__init__.py +101 -0
- core/plugin_loader.py +46 -0
- core/protocols.py +27 -0
- core/registry.py +46 -0
- diagram_analysis/__init__.py +4 -0
- diagram_analysis/analysis_json.py +346 -0
- diagram_analysis/diagram_generator.py +486 -0
- diagram_analysis/file_coverage.py +212 -0
- diagram_analysis/incremental/__init__.py +63 -0
- diagram_analysis/incremental/component_checker.py +236 -0
- diagram_analysis/incremental/file_manager.py +217 -0
- diagram_analysis/incremental/impact_analyzer.py +238 -0
- diagram_analysis/incremental/io_utils.py +281 -0
- diagram_analysis/incremental/models.py +72 -0
- diagram_analysis/incremental/path_patching.py +164 -0
- diagram_analysis/incremental/reexpansion.py +166 -0
- diagram_analysis/incremental/scoped_analysis.py +227 -0
- diagram_analysis/incremental/updater.py +464 -0
- diagram_analysis/incremental/validation.py +48 -0
- diagram_analysis/manifest.py +152 -0
- diagram_analysis/version.py +6 -0
- duckdb_crud.py +125 -0
- github_action.py +172 -0
- health/__init__.py +3 -0
- health/checks/__init__.py +11 -0
- health/checks/circular_deps.py +48 -0
- health/checks/cohesion.py +93 -0
- health/checks/coupling.py +140 -0
- health/checks/function_size.py +85 -0
- health/checks/god_class.py +167 -0
- health/checks/inheritance.py +104 -0
- health/checks/instability.py +77 -0
- health/checks/unused_code_diagnostics.py +338 -0
- health/config.py +172 -0
- health/constants.py +19 -0
- health/models.py +186 -0
- health/runner.py +236 -0
- install.py +518 -0
- logging_config.py +105 -0
- main.py +529 -0
- monitoring/__init__.py +12 -0
- monitoring/callbacks.py +163 -0
- monitoring/context.py +158 -0
- monitoring/mixin.py +16 -0
- monitoring/paths.py +47 -0
- monitoring/stats.py +50 -0
- monitoring/writers.py +172 -0
- output_generators/__init__.py +0 -0
- output_generators/html.py +163 -0
- output_generators/html_template.py +382 -0
- output_generators/markdown.py +140 -0
- output_generators/mdx.py +171 -0
- output_generators/sphinx.py +175 -0
- repo_utils/__init__.py +277 -0
- repo_utils/change_detector.py +289 -0
- repo_utils/errors.py +6 -0
- repo_utils/git_diff.py +74 -0
- repo_utils/ignore.py +341 -0
- static_analyzer/__init__.py +335 -0
- static_analyzer/analysis_cache.py +699 -0
- static_analyzer/analysis_result.py +269 -0
- static_analyzer/cluster_change_analyzer.py +391 -0
- static_analyzer/cluster_helpers.py +79 -0
- static_analyzer/constants.py +166 -0
- static_analyzer/git_diff_analyzer.py +224 -0
- static_analyzer/graph.py +746 -0
- static_analyzer/incremental_orchestrator.py +671 -0
- static_analyzer/java_config_scanner.py +232 -0
- static_analyzer/java_utils.py +227 -0
- static_analyzer/lsp_client/__init__.py +12 -0
- static_analyzer/lsp_client/client.py +1642 -0
- static_analyzer/lsp_client/diagnostics.py +62 -0
- static_analyzer/lsp_client/java_client.py +517 -0
- static_analyzer/lsp_client/language_settings.py +97 -0
- static_analyzer/lsp_client/typescript_client.py +235 -0
- static_analyzer/programming_language.py +152 -0
- static_analyzer/reference_resolve_mixin.py +166 -0
- static_analyzer/scanner.py +95 -0
- static_analyzer/typescript_config_scanner.py +54 -0
- tool_registry.py +433 -0
- user_config.py +134 -0
- utils.py +56 -0
- vscode_constants.py +124 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Prompt templates for Zhipu GLM models.
|
|
3
|
+
|
|
4
|
+
GLM Prompt Design Principles:
|
|
5
|
+
- Uses heavy directive language ("STRICTLY follow these rules", "MANDATORY", "MUST", "REQUIRED")
|
|
6
|
+
throughout every prompt. GLM models tend to drift from instructions or take creative liberties
|
|
7
|
+
unless constraints are stated emphatically and repeatedly.
|
|
8
|
+
- Each prompt assigns a specific role identity ("You are a software architecture expert",
|
|
9
|
+
"You are a file reference resolver") to anchor the model's behavior. GLM produces more
|
|
10
|
+
consistent output when given a strong persona framing at the start of each prompt.
|
|
11
|
+
- Steps are explicitly labeled with ordering ("REQUIRED STEPS (execute in order)") and output
|
|
12
|
+
sections are marked with "(complete all)" or "(complete ALL)". Without these markers, GLM
|
|
13
|
+
may produce partial outputs or skip required sections.
|
|
14
|
+
- Constraints are stated both positively and negatively ("MUST analyze", "STRICTLY avoid") because
|
|
15
|
+
GLM responds better to explicit boundary-setting than to implied expectations.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from .abstract_prompt_factory import AbstractPromptFactory
|
|
19
|
+
|
|
20
|
+
SYSTEM_MESSAGE = """You are a software architecture expert. STRICTLY follow these rules:
|
|
21
|
+
|
|
22
|
+
MANDATORY INSTRUCTIONS (MUST comply):
|
|
23
|
+
1. Analyze Control Flow Graphs (CFG) for `{project_name}` and generate high-level data flow overview optimized for diagram generation.
|
|
24
|
+
2. Use tools ONLY when information is missing—do NOT make assumptions.
|
|
25
|
+
3. Focus on architectural patterns for {project_type} projects with clear component boundaries.
|
|
26
|
+
4. Components MUST have distinct visual boundaries suitable for diagram generation.
|
|
27
|
+
|
|
28
|
+
Project Context:
|
|
29
|
+
{meta_context}
|
|
30
|
+
|
|
31
|
+
REQUIRED OUTPUTS (complete all):
|
|
32
|
+
- Central modules/functions (maximum 20) from CFG data with clear interaction patterns
|
|
33
|
+
- Logical component groupings with clear responsibilities suitable for flow graph representation
|
|
34
|
+
- Component relationships and interactions that translate to clear data flow arrows
|
|
35
|
+
- Reference to relevant source files for interactive diagram elements
|
|
36
|
+
|
|
37
|
+
Execution approach:
|
|
38
|
+
Step 1: Analyze provided CFG data—identify patterns and structures.
|
|
39
|
+
Step 2: Use tools when necessary to fill gaps.
|
|
40
|
+
Step 3: Create analysis suitable for both documentation and visual diagram generation."""
|
|
41
|
+
|
|
42
|
+
CLUSTER_GROUPING_MESSAGE = """You are a software architecture analyst. STRICTLY follow these rules:
|
|
43
|
+
|
|
44
|
+
MANDATORY TASK:
|
|
45
|
+
Analyze and GROUP the Control Flow Graph clusters for `{project_name}`.
|
|
46
|
+
|
|
47
|
+
Project Context:
|
|
48
|
+
Project Type: {project_type}
|
|
49
|
+
|
|
50
|
+
{meta_context}
|
|
51
|
+
|
|
52
|
+
Background:
|
|
53
|
+
The CFG has been pre-clustered into groups of related methods/functions. Each cluster represents methods that call each other frequently.
|
|
54
|
+
|
|
55
|
+
CFG Clusters:
|
|
56
|
+
{cfg_clusters}
|
|
57
|
+
|
|
58
|
+
REQUIRED STEPS (execute in order):
|
|
59
|
+
1. Analyze the clusters shown above—identify which ones work together or are functionally related.
|
|
60
|
+
2. Group related clusters into meaningful components.
|
|
61
|
+
3. A component can contain one or more cluster IDs (e.g., [1], [2, 5], or [3, 7, 9]).
|
|
62
|
+
4. For each grouped component, MUST provide:
|
|
63
|
+
- **cluster_ids**: List of cluster IDs that belong together (as a list, e.g., [1, 3, 5])
|
|
64
|
+
- **description**: Comprehensive explanation MUST include:
|
|
65
|
+
* What this component does
|
|
66
|
+
* What is its main flow/purpose
|
|
67
|
+
* WHY these specific clusters are grouped together (MUST provide clear rationale)
|
|
68
|
+
|
|
69
|
+
FOCUS AREAS (prioritize):
|
|
70
|
+
- Create cohesive, logical groupings that reflect the actual {project_type} architecture
|
|
71
|
+
- Base decisions on semantic meaning from method names, call patterns, and architectural context
|
|
72
|
+
- MUST provide clear justification for why clusters belong together
|
|
73
|
+
|
|
74
|
+
OUTPUT FORMAT (MUST use):
|
|
75
|
+
Return a ClusterAnalysis with cluster_components using ClustersComponent model.
|
|
76
|
+
Each component MUST have cluster_ids (list) and description (comprehensive explanation with rationale)."""
|
|
77
|
+
|
|
78
|
+
FINAL_ANALYSIS_MESSAGE = """You are a software architecture designer. STRICTLY follow these rules:
|
|
79
|
+
|
|
80
|
+
MANDATORY TASK:
|
|
81
|
+
Create final component architecture for `{project_name}` optimized for flow representation.
|
|
82
|
+
|
|
83
|
+
Project Context:
|
|
84
|
+
{meta_context}
|
|
85
|
+
|
|
86
|
+
Cluster Analysis:
|
|
87
|
+
{cluster_analysis}
|
|
88
|
+
|
|
89
|
+
REQUIRED STEPS (execute in order):
|
|
90
|
+
1. Review the cluster interpretations above.
|
|
91
|
+
2. Decide which clusters MUST be merged into components.
|
|
92
|
+
3. For each component, specify which cluster_ids it includes.
|
|
93
|
+
4. Add key entities (2-5 most important classes/methods) for each component using SourceCodeReference.
|
|
94
|
+
5. Define relationships between components.
|
|
95
|
+
|
|
96
|
+
GUIDELINES for {project_type} projects (MUST follow):
|
|
97
|
+
- Aim for 5-8 final components
|
|
98
|
+
- Merge related clusters that serve a common purpose
|
|
99
|
+
- Each component MUST have clear boundaries
|
|
100
|
+
- Include ONLY architecturally significant relationships
|
|
101
|
+
|
|
102
|
+
REQUIRED OUTPUTS (complete all):
|
|
103
|
+
- Description: One paragraph explaining the main flow and purpose
|
|
104
|
+
- Components: Each MUST have:
|
|
105
|
+
* name: Clear component name
|
|
106
|
+
* description: What this component does
|
|
107
|
+
* source_cluster_ids: Which cluster IDs belong to this component
|
|
108
|
+
* key_entities: 2-5 most important classes/methods (SourceCodeReference objects with qualified_name and reference_file)
|
|
109
|
+
- Relations: Max 2 relationships per component pair (STRICTLY avoid bidirectional relations like ComponentA sends message to ComponentB and ComponentB returns result to ComponentA)
|
|
110
|
+
|
|
111
|
+
CONSTRAINTS (MUST obey):
|
|
112
|
+
- Focus on highest level architectural components
|
|
113
|
+
- Exclude utility/logging components
|
|
114
|
+
- Components MUST translate well to flow diagram representation
|
|
115
|
+
|
|
116
|
+
Note: assigned_files will be populated later via deterministic file classification."""
|
|
117
|
+
|
|
118
|
+
PLANNER_SYSTEM_MESSAGE = """You are a software architecture evaluator. STRICTLY follow these rules:
|
|
119
|
+
|
|
120
|
+
MANDATORY TASK:
|
|
121
|
+
Evaluate component expansion needs.
|
|
122
|
+
|
|
123
|
+
REQUIRED STEPS (execute in order):
|
|
124
|
+
1. Use available context (file structure, CFG, source) to assess complexity.
|
|
125
|
+
2. Use getClassHierarchy ONLY if component internal structure is unclear.
|
|
126
|
+
|
|
127
|
+
EVALUATION CRITERIA (MUST apply):
|
|
128
|
+
- Simple functionality (few classes/functions) = NO expansion
|
|
129
|
+
- Complex subsystem (multiple interacting modules) = CONSIDER expansion
|
|
130
|
+
|
|
131
|
+
FOCUS:
|
|
132
|
+
MUST assess architectural significance, not implementation details."""
|
|
133
|
+
|
|
134
|
+
EXPANSION_PROMPT = """You are a component complexity analyst. STRICTLY follow these rules:
|
|
135
|
+
|
|
136
|
+
MANDATORY TASK:
|
|
137
|
+
Evaluate component expansion necessity for: {component}
|
|
138
|
+
|
|
139
|
+
REQUIRED STEPS (execute in order):
|
|
140
|
+
1. Review component description and source files.
|
|
141
|
+
2. Determine if it represents a complex subsystem worth detailed analysis.
|
|
142
|
+
3. Simple function/class groups do NOT need expansion.
|
|
143
|
+
|
|
144
|
+
REQUIRED OUTPUT:
|
|
145
|
+
MUST provide clear reasoning for expansion decision based on architectural complexity."""
|
|
146
|
+
|
|
147
|
+
VALIDATOR_SYSTEM_MESSAGE = """You are a software architecture quality validator. STRICTLY follow these rules:
|
|
148
|
+
|
|
149
|
+
MANDATORY TASK:
|
|
150
|
+
Validate analysis quality.
|
|
151
|
+
|
|
152
|
+
REQUIRED STEPS (execute in order):
|
|
153
|
+
1. Review analysis structure and component definitions.
|
|
154
|
+
2. Use getClassHierarchy ONLY if component validity is questionable.
|
|
155
|
+
|
|
156
|
+
VALIDATION CRITERIA (MUST check):
|
|
157
|
+
- Component clarity and responsibility definition
|
|
158
|
+
- Valid source file references
|
|
159
|
+
- Appropriate relationship mapping
|
|
160
|
+
- Meaningful component naming with code references"""
|
|
161
|
+
|
|
162
|
+
COMPONENT_VALIDATION_COMPONENT = """You are an analysis quality reviewer. STRICTLY follow these rules:
|
|
163
|
+
|
|
164
|
+
MANDATORY TASK:
|
|
165
|
+
Validate component analysis.
|
|
166
|
+
|
|
167
|
+
Analysis to validate:
|
|
168
|
+
{analysis}
|
|
169
|
+
|
|
170
|
+
REQUIRED STEPS (execute in order):
|
|
171
|
+
1. Assess component clarity and purpose definition.
|
|
172
|
+
2. Verify source file completeness and relevance.
|
|
173
|
+
3. Confirm responsibilities are well-defined.
|
|
174
|
+
|
|
175
|
+
REQUIRED OUTPUT:
|
|
176
|
+
MUST provide validation assessment without additional tool usage."""
|
|
177
|
+
|
|
178
|
+
RELATIONSHIPS_VALIDATION = """You are a relationship correctness validator. STRICTLY follow these rules:
|
|
179
|
+
|
|
180
|
+
MANDATORY TASK:
|
|
181
|
+
Validate component relationships.
|
|
182
|
+
|
|
183
|
+
Analysis to validate:
|
|
184
|
+
{analysis}
|
|
185
|
+
|
|
186
|
+
REQUIRED STEPS (execute in order):
|
|
187
|
+
1. Check relationship clarity and necessity.
|
|
188
|
+
2. Verify max 2 relationships per component pair (STRICTLY avoid bidirectional relations like ComponentA sends message to ComponentB and ComponentB returns result to ComponentA).
|
|
189
|
+
3. Assess relationship logical consistency.
|
|
190
|
+
|
|
191
|
+
REQUIRED OUTPUT:
|
|
192
|
+
MUST conclude with VALID or INVALID assessment and specific reasoning."""
|
|
193
|
+
|
|
194
|
+
SYSTEM_META_ANALYSIS_MESSAGE = """You are a senior software architect. STRICTLY follow these rules:
|
|
195
|
+
|
|
196
|
+
ROLE:
|
|
197
|
+
Analyze software projects to extract high-level architectural metadata for documentation and flow diagram generation.
|
|
198
|
+
|
|
199
|
+
CORE RESPONSIBILITIES (MUST execute):
|
|
200
|
+
1. Identify project type, domain, and architectural patterns from project structure and documentation.
|
|
201
|
+
2. Extract technology stack and expected component categories.
|
|
202
|
+
3. Provide architectural guidance for component organization and diagram representation.
|
|
203
|
+
4. Focus on high-level architectural insights rather than implementation details.
|
|
204
|
+
|
|
205
|
+
ANALYSIS APPROACH (follow this order):
|
|
206
|
+
Step 1: Start with project documentation (README, docs) for context and purpose.
|
|
207
|
+
Step 2: Examine file structure and dependencies for technology identification.
|
|
208
|
+
Step 3: Apply architectural expertise to classify patterns and suggest component organization.
|
|
209
|
+
Step 4: Consider both documentation clarity and visual diagram requirements.
|
|
210
|
+
|
|
211
|
+
CONSTRAINTS (MUST obey):
|
|
212
|
+
- Maximum 2 tool calls for critical information gathering
|
|
213
|
+
- Focus on architectural significance over implementation details
|
|
214
|
+
- MUST provide actionable guidance for component identification and organization"""
|
|
215
|
+
|
|
216
|
+
META_INFORMATION_PROMPT = """You are a project metadata extractor. STRICTLY follow these rules:
|
|
217
|
+
|
|
218
|
+
MANDATORY TASK:
|
|
219
|
+
Analyze project '{project_name}' to extract architectural metadata.
|
|
220
|
+
|
|
221
|
+
REQUIRED ANALYSIS OUTPUTS (complete ALL):
|
|
222
|
+
1. **Project Type**: Classify the project category (web framework, data processing library, ML toolkit, CLI tool, etc.)
|
|
223
|
+
2. **Domain**: Identify the primary domain/field (web development, data science, DevOps, AI/ML, etc.)
|
|
224
|
+
3. **Technology Stack**: List main technologies, frameworks, and libraries used.
|
|
225
|
+
4. **Architectural Patterns**: Identify common patterns for this project type (MVC, microservices, pipeline, etc.)
|
|
226
|
+
5. **Expected Components**: Predict high-level component categories typical for this project type.
|
|
227
|
+
6. **Architectural Bias**: Provide guidance on how to organize and interpret components for this specific project type.
|
|
228
|
+
|
|
229
|
+
ANALYSIS STEPS (execute in order):
|
|
230
|
+
1. Read project documentation (README, setup files) to understand purpose and domain.
|
|
231
|
+
2. Examine file structure and dependencies to identify technology stack.
|
|
232
|
+
3. Apply architectural expertise to determine patterns and expected component structure.
|
|
233
|
+
|
|
234
|
+
FOCUS:
|
|
235
|
+
MUST extract metadata that will guide component identification and architectural analysis."""
|
|
236
|
+
|
|
237
|
+
FILE_CLASSIFICATION_MESSAGE = """You are a file reference resolver. STRICTLY follow these rules:
|
|
238
|
+
|
|
239
|
+
MANDATORY TASK:
|
|
240
|
+
Find which file contains the code reference `{qname}`.
|
|
241
|
+
|
|
242
|
+
Files to choose from (absolute paths):
|
|
243
|
+
{files}
|
|
244
|
+
|
|
245
|
+
REQUIRED STEPS (execute in order):
|
|
246
|
+
1. MUST select exactly one file path from the list above. Do NOT invent or modify paths.
|
|
247
|
+
2. If `{qname}` is a function, method, class, or similar:
|
|
248
|
+
- MUST use the `readFile` tool to locate its definition.
|
|
249
|
+
- MUST include the start and end line numbers of the definition."""
|
|
250
|
+
|
|
251
|
+
UNASSIGNED_FILES_CLASSIFICATION_MESSAGE = """You are a file classifier. STRICTLY follow these rules:
|
|
252
|
+
|
|
253
|
+
Context:
|
|
254
|
+
The following files were not automatically assigned to any component during cluster-based analysis:
|
|
255
|
+
|
|
256
|
+
{unassigned_files}
|
|
257
|
+
|
|
258
|
+
Available Components:
|
|
259
|
+
{components}
|
|
260
|
+
|
|
261
|
+
MANDATORY TASK:
|
|
262
|
+
For EACH unassigned file listed above, determine which component it logically belongs to based on:
|
|
263
|
+
- File name and directory structure
|
|
264
|
+
- Likely functionality (inferred from path/name)
|
|
265
|
+
- Best architectural fit with the component descriptions
|
|
266
|
+
|
|
267
|
+
CRITICAL RULES (MUST follow ALL):
|
|
268
|
+
1. MUST assign EVERY file to exactly ONE component.
|
|
269
|
+
2. MUST use the exact component name from the "Available Components" list above.
|
|
270
|
+
3. MUST use the exact file path from the unassigned files list above.
|
|
271
|
+
4. STRICTLY do NOT invent new component names.
|
|
272
|
+
5. STRICTLY do NOT skip any files.
|
|
273
|
+
|
|
274
|
+
OUTPUT FORMAT (MUST use):
|
|
275
|
+
Return a ComponentFiles object with file_paths list containing FileClassification for each file."""
|
|
276
|
+
|
|
277
|
+
VALIDATION_FEEDBACK_MESSAGE = """Original result:
|
|
278
|
+
{original_output}
|
|
279
|
+
|
|
280
|
+
Issues found (MUST address ALL):
|
|
281
|
+
{feedback_list}
|
|
282
|
+
|
|
283
|
+
MANDATORY TASK:
|
|
284
|
+
Correct the output based on the above issues.
|
|
285
|
+
|
|
286
|
+
Original prompt:
|
|
287
|
+
{original_prompt}"""
|
|
288
|
+
|
|
289
|
+
SYSTEM_DETAILS_MESSAGE = """You are a software architecture subsystem analyst. STRICTLY follow these rules:
|
|
290
|
+
|
|
291
|
+
MANDATORY TASK:
|
|
292
|
+
Analyze a subsystem of `{project_name}`.
|
|
293
|
+
|
|
294
|
+
Project Context:
|
|
295
|
+
{meta_context}
|
|
296
|
+
|
|
297
|
+
REQUIRED STEPS (execute in order):
|
|
298
|
+
1. Start with available project context and CFG data.
|
|
299
|
+
2. Use getClassHierarchy ONLY for the target subsystem.
|
|
300
|
+
|
|
301
|
+
REQUIRED OUTPUTS (complete all):
|
|
302
|
+
- Subsystem boundaries from context
|
|
303
|
+
- Central components (max 10) following {project_type} patterns
|
|
304
|
+
- Component responsibilities and interactions
|
|
305
|
+
- Internal subsystem relationships
|
|
306
|
+
|
|
307
|
+
FOCUS:
|
|
308
|
+
MUST analyze subsystem-specific functionality. STRICTLY avoid cross-cutting concerns like logging or error handling."""
|
|
309
|
+
|
|
310
|
+
CFG_DETAILS_MESSAGE = """You are a CFG interaction analyzer. STRICTLY follow these rules:
|
|
311
|
+
|
|
312
|
+
MANDATORY TASK:
|
|
313
|
+
Analyze CFG interactions for `{project_name}` subsystem.
|
|
314
|
+
|
|
315
|
+
Project Context:
|
|
316
|
+
{meta_context}
|
|
317
|
+
|
|
318
|
+
CFG Data:
|
|
319
|
+
{cfg_str}
|
|
320
|
+
|
|
321
|
+
REQUIRED STEPS (execute in order):
|
|
322
|
+
1. Analyze provided CFG data for subsystem patterns.
|
|
323
|
+
2. Use getClassHierarchy ONLY if interaction details are unclear.
|
|
324
|
+
|
|
325
|
+
REQUIRED OUTPUTS (complete all):
|
|
326
|
+
- Subsystem modules/functions from CFG
|
|
327
|
+
- Components with clear responsibilities
|
|
328
|
+
- Component interactions (max 10 components, 2 relationships per pair - STRICTLY avoid bidirectional relations like ComponentA sends message to ComponentB and ComponentB returns result to ComponentA)
|
|
329
|
+
- Justification based on {project_type} patterns
|
|
330
|
+
|
|
331
|
+
FOCUS:
|
|
332
|
+
MUST analyze core subsystem functionality only."""
|
|
333
|
+
|
|
334
|
+
DETAILS_MESSAGE = """You are a component overview synthesizer. STRICTLY follow these rules:
|
|
335
|
+
|
|
336
|
+
MANDATORY TASK:
|
|
337
|
+
Create final component overview for {component}.
|
|
338
|
+
|
|
339
|
+
Project Context:
|
|
340
|
+
{meta_context}
|
|
341
|
+
|
|
342
|
+
Analysis summary:
|
|
343
|
+
{insight_so_far}
|
|
344
|
+
|
|
345
|
+
INSTRUCTIONS:
|
|
346
|
+
No tools required—MUST use provided analysis summary only.
|
|
347
|
+
|
|
348
|
+
REQUIRED OUTPUTS (complete ALL):
|
|
349
|
+
1. Final component structure from provided data
|
|
350
|
+
2. Max 8 components following {project_type} patterns
|
|
351
|
+
3. Clear component descriptions and source files
|
|
352
|
+
4. Component interactions (max 2 relationships per component pair - STRICTLY avoid bidirectional relations like ComponentA sends message to ComponentB and ComponentB returns result to ComponentA)
|
|
353
|
+
|
|
354
|
+
JUSTIFICATION:
|
|
355
|
+
MUST base component choices on fundamental architectural importance."""
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
class GLMPromptFactory(AbstractPromptFactory):
|
|
359
|
+
"""Prompt factory for GLM models optimized for firm directive prompts with strong role-playing."""
|
|
360
|
+
|
|
361
|
+
def get_system_message(self) -> str:
|
|
362
|
+
return SYSTEM_MESSAGE
|
|
363
|
+
|
|
364
|
+
def get_cluster_grouping_message(self) -> str:
|
|
365
|
+
return CLUSTER_GROUPING_MESSAGE
|
|
366
|
+
|
|
367
|
+
def get_final_analysis_message(self) -> str:
|
|
368
|
+
return FINAL_ANALYSIS_MESSAGE
|
|
369
|
+
|
|
370
|
+
def get_planner_system_message(self) -> str:
|
|
371
|
+
return PLANNER_SYSTEM_MESSAGE
|
|
372
|
+
|
|
373
|
+
def get_expansion_prompt(self) -> str:
|
|
374
|
+
return EXPANSION_PROMPT
|
|
375
|
+
|
|
376
|
+
def get_validator_system_message(self) -> str:
|
|
377
|
+
return VALIDATOR_SYSTEM_MESSAGE
|
|
378
|
+
|
|
379
|
+
def get_component_validation_component(self) -> str:
|
|
380
|
+
return COMPONENT_VALIDATION_COMPONENT
|
|
381
|
+
|
|
382
|
+
def get_relationships_validation(self) -> str:
|
|
383
|
+
return RELATIONSHIPS_VALIDATION
|
|
384
|
+
|
|
385
|
+
def get_system_meta_analysis_message(self) -> str:
|
|
386
|
+
return SYSTEM_META_ANALYSIS_MESSAGE
|
|
387
|
+
|
|
388
|
+
def get_meta_information_prompt(self) -> str:
|
|
389
|
+
return META_INFORMATION_PROMPT
|
|
390
|
+
|
|
391
|
+
def get_file_classification_message(self) -> str:
|
|
392
|
+
return FILE_CLASSIFICATION_MESSAGE
|
|
393
|
+
|
|
394
|
+
def get_unassigned_files_classification_message(self) -> str:
|
|
395
|
+
return UNASSIGNED_FILES_CLASSIFICATION_MESSAGE
|
|
396
|
+
|
|
397
|
+
def get_validation_feedback_message(self) -> str:
|
|
398
|
+
return VALIDATION_FEEDBACK_MESSAGE
|
|
399
|
+
|
|
400
|
+
def get_system_details_message(self) -> str:
|
|
401
|
+
return SYSTEM_DETAILS_MESSAGE
|
|
402
|
+
|
|
403
|
+
def get_cfg_details_message(self) -> str:
|
|
404
|
+
return CFG_DETAILS_MESSAGE
|
|
405
|
+
|
|
406
|
+
def get_details_message(self) -> str:
|
|
407
|
+
return DETAILS_MESSAGE
|