Agentic AI Driven Legacy Code Modernization using Amazon Q (Extension in VSCode)
This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Exploring the Possibilities What I Built Agentic AI Driven Legacy Code Modernization using Amazon Q addresses the challenge of transforming legacy systems into modern, maintainable code while preserving business logic and functional accuracy. Legacy systems, often written in outdated languages, hinder scalability, security, and integration with modern architectures. Solution Approach: Input Processing: Users upload legacy code files through a Streamlit interface. Agent Selection: The system dynamically selects the appropriate AI agent based on the input language (e.g., COBOL, Fortran). Conversion Execution: Using Amazon Q Developer, the CrewAI agents convert the input code to the selected modern language (e.g., Python). Output Generation: The modernized code is dynamically generated and stored in the modernized_code/output directory. Logging and Monitoring: Comprehensive logging ensures that each conversion step is traceable and auditable. Key Features: Multi-Language Support: COBOL, Fortran, Pascal, Assembly Target Languages: Python, C++, Java, C Agentic AI Integration: Specialized agents for each legacy language Automated Conversion: AI-driven transformation using Amazon Q Developer Centralized Logging: Conversion logs are stored in the logs directory for monitoring Streamlit Frontend: Simplified user interface for uploading files and selecting languages Demo 1.Frontend Interface: Streamlit interface allows users to upload legacy code files and choose the target language. The uploaded file content is displayed in an expandable section for review. After conversion, the output is dynamically generated and available for download. 2.Runtime Storage in VS Code: The modernized_code/output directory is dynamically populated with converted files. The file extension is determined by the selected target language (.py, .cpp, .java, .c). The runtime generation is verified by observing file creation and modification timestamps. Code Repository Code Link How I Used Amazon Q Developer Amazon Q Developer plays a crucial role in automating legacy code transformation through AI-powered agents. Here’s how it was used throughout the project: Q Configuration – q-config.json: Amazon Q Developer initializes the project by generating the q-config.json file. This file defines key paths, agent configurations, and logging directories: Quack-The-Code/ ├── q-config.json # Q configuration - Q Generated Agent Mapping – agents.yaml: The agents.yaml file is generated by Q Developer to define specialized agents for each legacy language. This configuration enables CrewAI to handle language-specific logic conversion. Quack-The-Code/ ├── config/ │ └── agents.yaml # Agent configuration - Q Generated Main Application Logic – crew.py: Amazon Q Developer generates the crew.py file, which serves as the main application logic for agent orchestration. The file is structured to interact with agents defined in agents.yaml. Quack-The-Code/ ├── crew.py # Main application file - Q Generated (Extension) Dependencies and Runtime Configuration – requirements.txt: Q Developer compiles all necessary dependencies and generates the requirements.txt file. This ensures consistency in package versions across development and deployment environments. Quack-The-Code/ └── requirements.txt # Dependencies - Q Generated Readme and Project Documentation – readme.md: Amazon Q Developer creates a comprehensive readme.md file that outlines the project flow, structure, and usage instructions. This documentation is auto-generated to maintain consistency in code execution and project architecture. Quack-The-Code/ └── readme.md # End to end flow - Q Generated Conclusion: Amazon Q Developer, when combined with CrewAI’s modular agent structure, provides a scalable and robust framework for legacy code modernization. This step-by-step implementation guide demonstrates how to effectively utilize Q Developer to streamline the modernization process, ensuring consistency and maintainability throughout the code transformation lifecycle.

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Exploring the Possibilities
What I Built
Agentic AI Driven Legacy Code Modernization using Amazon Q addresses the challenge of transforming legacy systems into modern, maintainable code while preserving business logic and functional accuracy. Legacy systems, often written in outdated languages, hinder scalability, security, and integration with modern architectures.
Solution Approach:
Input Processing: Users upload legacy code files through a Streamlit interface.
Agent Selection: The system dynamically selects the appropriate AI agent based on the input language (e.g., COBOL, Fortran).
Conversion Execution: Using Amazon Q Developer, the CrewAI agents convert the input code to the selected modern language (e.g., Python).
Output Generation: The modernized code is dynamically generated and stored in the modernized_code/output directory.
Logging and Monitoring: Comprehensive logging ensures that each conversion step is traceable and auditable.
Key Features:
- Multi-Language Support: COBOL, Fortran, Pascal, Assembly
- Target Languages: Python, C++, Java, C
- Agentic AI Integration: Specialized agents for each legacy language
- Automated Conversion: AI-driven transformation using Amazon Q Developer
- Centralized Logging: Conversion logs are stored in the logs directory for monitoring
- Streamlit Frontend: Simplified user interface for uploading files and selecting languages
Demo
1.Frontend Interface:
- Streamlit interface allows users to upload legacy code files and choose the target language.
- The uploaded file content is displayed in an expandable section for review.
- After conversion, the output is dynamically generated and available for download.
2.Runtime Storage in VS Code:
- The modernized_code/output directory is dynamically populated with converted files.
- The file extension is determined by the selected target language (.py, .cpp, .java, .c).
- The runtime generation is verified by observing file creation and modification timestamps.
Code Repository
How I Used Amazon Q Developer
Amazon Q Developer plays a crucial role in automating legacy code transformation through AI-powered agents. Here’s how it was used throughout the project:
Q Configuration – q-config.json:
- Amazon Q Developer initializes the project by generating the q-config.json file.
- This file defines key paths, agent configurations, and logging directories:
Quack-The-Code/
├── q-config.json # Q configuration - Q Generated
Agent Mapping – agents.yaml:
- The agents.yaml file is generated by Q Developer to define specialized agents for each legacy language.
- This configuration enables CrewAI to handle language-specific logic conversion.
Quack-The-Code/
├── config/
│ └── agents.yaml # Agent configuration - Q Generated
Main Application Logic – crew.py:
- Amazon Q Developer generates the crew.py file, which serves as the main application logic for agent orchestration.
- The file is structured to interact with agents defined in agents.yaml.
Quack-The-Code/
├── crew.py # Main application file - Q Generated (Extension)
Dependencies and Runtime Configuration – requirements.txt:
- Q Developer compiles all necessary dependencies and generates the requirements.txt file.
- This ensures consistency in package versions across development and deployment environments.
Quack-The-Code/
└── requirements.txt # Dependencies - Q Generated
Readme and Project Documentation – readme.md:
- Amazon Q Developer creates a comprehensive readme.md file that outlines the project flow, structure, and usage instructions.
- This documentation is auto-generated to maintain consistency in code execution and project architecture.
Quack-The-Code/
└── readme.md # End to end flow - Q Generated
Conclusion:
Amazon Q Developer, when combined with CrewAI’s modular agent structure, provides a scalable and robust framework for legacy code modernization.
This step-by-step implementation guide demonstrates how to effectively utilize Q Developer to streamline the modernization process, ensuring consistency and maintainability throughout the code transformation lifecycle.