This page describes how to modernize your mainframe applications by using the Gemini CLI with the outputs from Mainframe Assessment Tool, and then validate the deployed applications on Google Cloud by using Dual Run.
After assessing your mainframe application and extracting business rules with Mainframe Assessment Tool, you can use Gemini CLI to transform your legacy code into high-quality, cloud-native code. This process uses technical metadata and business requirements to ensure the target application is architecturally and functionally equivalent to the original.
After your modernized application is deployed to Google Cloud, Dual Run helps reduce the risk of the transition. It lets you run workloads simultaneously on your existing mainframe and on Google Cloud, comparing outputs like daily reports and online transactions. This real-time testing helps you gather data on functional equivalence, performance, and stability, ensuring a reduced-risk transition.
By following the instructions on this page, you'll learn how to:
- Use Gemini CLI for modernization tasks, leveraging the
AGENTS.mdfile created by Mainframe Assessment Tool. - Enable communication between Gemini CLI and the assessment data.
- Use Dual Run to validate your deployed application.
This page is intended for IT professionals, architects, and engineers involved in mainframe modernization projects.
Before you begin
To prepare your environment for code modernization, complete the following steps.
Roles and permissions
- Make sure that you have the necessary IAM roles to access the Mainframe Assessment Tool MCP server. For more information, see Mainframe Assessment Tool MCP server.
- Confirm you have permissions to run Gemini CLI commands in your terminal environment. For more information, see Gemini CLI configuration.
Requirements
- Export the agent configuration: in the Mainframe Assessment Tool, export the
agent configuration (
AGENTS.md) file. This file provides Gemini CLI with context about your assessment. - Install Gemini CLI: if not already installed, follow the Gemini CLI getting started guide.
- Set up a workspace: create a local directory for your modernization project to store exported configuration files and generated code.
- Enable the Mainframe Assessment Tool MCP server: configure Mainframe Assessment Tool MCP server to enable communication between Gemini CLI and assessment data.
Configure the AGENTS.md file
Gemini CLI uses the AGENTS.md file that you exported from
Mainframe Assessment Tool to communicate with your assessment. The AGENTS.md file
contains the unique identifiers for the assessment and the specific business
rules extraction job.
To configure Gemini CLI to modernize code, follow these steps:
Go to the root directory of your workspace.
Check if an
AGENTS.mdfile already exists.Based on whether the file exists, do one of the following:
If an
AGENTS.mdfile doesn't exist, place theAGENTS.mdfile that you downloaded from the Mainframe Assessment Tool in this directory.If the
AGENTS.mdfile already exists, open the existing file and append the following content to the end of the file.## Mainframe Assessment Tool MCP Configuration assessmentID: ASSESSMENT_ID jobID: JOB_IDReplace the following:
ASSESSMENT_ID: your specific assessment ID.JOB_ID: the job ID of the business rules extraction job from Mainframe Assessment Tool.
Modernize your mainframe application code with Gemini CLI
After you configure Gemini CLI to modernize code,
it automatically uses the assessmentID and jobID from
your AGENTS.md file to contextually understand your application.
The Gemini CLI uses the Mainframe Assessment Tool MCP server tools and combines multiple data sources from your assessment and design phases to perform analysis and generate the following:
- Validated business rules: core business logic extracted from legacy code and verified by stakeholders.
- Target data model: optimized data structures designed for your target Google Cloud environment, such as Cloud Spanner or Cloud SQL.
- Product Requirements Document (PRD): a human-readable specification that serves as the blueprint for the modernized application.
- Modernized application code: cloud-native code in the language of your choice that implements the business rules.
To use the information gathered during your assessment to understand and modernize your mainframe application, you can use prompts like the following in Gemini CLI:
To retrieve business rules, plan the target data model, and generate a PRD:
Get business rules for business rules extraction job JOB_NAME. Based on these rules, suggest a target data model for Spanner and generate a Product Requirements Document.Replace
JOB_NAMEwith the job name of the business rules extraction job from Mainframe Assessment Tool.To generate the modernized code:
Generate the Java code to implement the business rules from the business rules extraction job ID:JOB_NAME by using the suggested Spanner data model.Replace
JOB_NAMEwith the job name of the business rules extraction job from Mainframe Assessment Tool.
Review the generated code
After generating the code, verify the output to ensure accuracy and architectural alignment.
| Review Checklist | |
|---|---|
| Logic accuracy | Compare generated methods against the validated business rules in your business rules extraction Job. Make sure that every rule is mapped to a code block. |
| Architectural alignment | Verify the code correctly implements the suggested data structures and uses appropriate Google Cloud client libraries. |
| Security and performance | Scan for hard-coded credentials or inefficient loops. Use Gemini CLI to fine-tune specific code sections for performance. |
Validate the modernized code with Dual Run
Dual Run lets you simultaneously run workloads on your existing mainframes and on Google Cloud, letting you perform real-time testing and quickly gather data on performance and stability.
For more information, see Dual Run overview.
What's next
- Learn more about Gemini CLI.