Skip to content

Commit 2dae6ca

Browse files
committed
Revert "Merge remote-tracking branch 'origin/main' into feat-spec-approach"
This reverts commit 4850677, reversing changes made to 3a2ff65.
1 parent 4850677 commit 2dae6ca

26 files changed

+478
-610
lines changed

.github/copilot-instructions.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- Use this file to provide workspace-specific custom instructions to Copilot. For more details, visit https://code.visualstudio.com/docs/copilot/copilot-customization#_use-a-githubcopilotinstructionsmd-file -->
2+
3+
# COBOL to Java Quarkus Migration Project
4+
5+
This project is a C# Semantic Kernel application that migrates COBOL code to Java Quarkus. The key components are:
6+
7+
1. **Agents**: AI-powered agents for COBOL analysis and Java conversion
8+
2. **Process Framework**: Orchestrates the migration workflow
9+
3. **Models**: Data structures for COBOL and Java code
10+
11+
## Development Guidelines
12+
13+
- Follow C# and .NET coding conventions
14+
- Use XML documentation comments for public members
15+
- Use async/await for asynchronous operations
16+
- Handle exceptions appropriately
17+
- Log important events and errors
18+
19+
## Key Classes
20+
21+
- **CobolAnalyzerAgent**: Analyzes COBOL code structure
22+
- **JavaConverterAgent**: Converts COBOL to Java Quarkus
23+
- **MigrationProcess**: Orchestrates the workflow
24+
- **FileHelper**: Manages file operations
25+
26+
## Technologies
27+
28+
- Microsoft Semantic Kernel
29+
- .NET 8.0
30+
- System.CommandLine
31+
- OpenAI API integration
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
Identify code segments that could be removed by using a modern 3rd-party dependency or library. Document these findings in a markdown file. Be precise.

.github/prompts/comments.prompt.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
If information in the code is unclear or ambiguous, add clarifying comments. Be precise. Focus on the essentials.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
Identify recurring deterministic structures and patterns in the codebase. Document these findings in a markdown-file to aid in understanding the code's behavior and to inform potential refactoring efforts. Be precise.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
Use or generate a call chain and visualize it in a mermaid diagram.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
Look at the code and identify potential comments or information that are not relevant to the current implementation. Remove any unnecessary comments, documentation, or code snippets that do not contribute to the understanding or functionality of the code. Stay precise. When in doubt, keep the information or comment.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
Extract the business logic of the cobol files, include technical documentation, comments and user handbooks (if they exist). Write all your findings into a markdown file. Be thorough and ensure that all relevant information is captured but stay precise.

.github/prompts/testing.prompt.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
If test files exist, have a look at them and understand the testing strategy and applied testing techniques. Document your findings in a markdown file. If no tests exist, generate a strategy how you would cover the code with tests. Be precise.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
mode: agent
3+
---
4+
If code or comments are not in English: translate the comments to English. For variables, functions, methods, add a comment in English explaining their purpose. Be precise.

Agents/BusinessLogicExtractorAgent.cs

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ public async Task<BusinessLogic> ExtractBusinessLogicAsync(CobolFile cobolFile,
8989
};
9090
}
9191

92-
var systemPrompt = PromptLoader.LoadSection("BusinessLogicExtractor", "System");
92+
var systemPrompt = @"
93+
You are a business analyst extracting business logic from COBOL code.
94+
Focus on identifying business use cases, operations, and validation rules.
95+
Use business-friendly terminology from the provided glossary when available.
96+
";
9397

9498
// Build glossary context
9599
var glossaryContext = "";
@@ -103,12 +107,56 @@ public async Task<BusinessLogic> ExtractBusinessLogicAsync(CobolFile cobolFile,
103107
glossaryContext += "\n";
104108
}
105109

106-
var userPrompt = PromptLoader.LoadSection("BusinessLogicExtractor", "User", new Dictionary<string, string>
107-
{
108-
["GlossaryContext"] = glossaryContext,
109-
["FileName"] = cobolFile.FileName,
110-
["CobolContent"] = contentToAnalyze
111-
});
110+
var userPrompt = $@"
111+
Analyze this COBOL program and extract the business logic:
112+
Your goal: Identify WHAT the business does, not HOW the code works.{glossaryContext}
113+
114+
## What to Extract:
115+
116+
### 1. Use Cases / Operations
117+
Identify each business operation the program performs:
118+
- CREATE / Register / Add operations
119+
- UPDATE / Change / Modify operations
120+
- DELETE / Remove operations
121+
- READ / Query / Fetch operations
122+
- VALIDATE / Check operations
123+
124+
### 2. Validations as Business Rules
125+
Extract ALL validation rules including:
126+
- Field validations (required, format, length, range)
127+
- Business logic validations
128+
- Error codes and their meanings
129+
130+
### 3. Business Purpose
131+
What business problem does this solve? (1-2 sentences)
132+
133+
## Format Your Response:
134+
135+
## Business Purpose
136+
[1-2 sentences]
137+
138+
## Use Cases
139+
### Use Case 1: [Operation Name]
140+
**Trigger:** [What initiates this operation]
141+
**Description:** [What happens]
142+
**Key Steps:**
143+
1. [Step 1]
144+
2. [Step 2]
145+
146+
## Business Rules & Validations
147+
### Data Validations
148+
- [Field name] must be [requirement] - Error: [code/message]
149+
150+
### Business Logic Rules
151+
- [Rule description]
152+
153+
File: {cobolFile.FileName}
154+
155+
COBOL Code:
156+
```cobol
157+
{contentToAnalyze}
158+
```
159+
";
112160

113161
var (analysisText, usedFallback, fallbackReason) = await ExecuteWithFallbackAsync(
114162
systemPrompt,

0 commit comments

Comments
 (0)