| name | sample-mainframe-easytrieve-transform | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| displayName | Easytrieve Modernization | ||||||||||||
| description | Transform mainframe Broadcom Easytrieve (EZT) programs to Java 17 (Spring Boot) using AWS Transform custom — guided, interactive, end-to-end. | ||||||||||||
| keywords |
|
||||||||||||
| author | Shubham Roy, AWS | ||||||||||||
| version | 1.2.0 |
Transform mainframe Easytrieve (EZT) programs to Java 17 (Spring Boot 3.x) using AWS Transform custom. Based on the AWS Prescriptive Guidance pattern.
Source repo: sample-mainframe-easytrieve-transform
Run these checks silently at the start of EVERY session. Report only failures.
Check if the MCP server is installed:
node -e "require('fs').existsSync(require('os').homedir()+'/.ezt-transform/mcp-server/dist/index.js') ? console.log('INSTALLED') : console.log('NOT_INSTALLED')"If NOT_INSTALLED:
- Clone the repo:
git clone https://github.com/aws-samples/sample-mainframe-easytrieve-transform ~/.ezt-transformIf this fails, tell the user:
"Could not download the EZT transformation tools. Check your internet connection and access to github.com."
Always run this step (even if INSTALLED) to ensure MCP is configured:
- Configure the MCP server with the correct absolute path:
node ~/.ezt-transform/mcp-server/setup-mcp.jsIf this fails, tell the user:
"MCP server setup failed. Please run
node ~/.ezt-transform/mcp-server/setup-mcp.jsmanually and share the error."
- After setup-mcp.js runs, Kiro automatically detects the config change and connects the MCP server. Proceed directly to Step 0b — do NOT ask the user to manually reconnect.
DO NOT PROCEED PAST THIS POINT UNTIL THIS CHECK PASSES.
Try calling the ezt_check_prereqs tool. If it responds with results, the MCP server
is connected — proceed to Step 1.
If the tool call fails or is unavailable:
"The MCP server is not responding. Please click the refresh icon next to
power-sample-mainframe-easytrieve-transform-ezt-transform-mcpin the MCP Servers panel, then let me know."
STOP. DO NOT CONTINUE. Wait for the user to confirm, then retry the tool call.
Check the Powers panel for aws-transform. If missing:
"Before we start, install the aws-transform power from the Kiro Powers panel. It provides the tools I need to run transformations."
Stop and wait.
Call ezt_check_prereqs. This returns pass/fail for AWS credentials, remote
infrastructure, and Lambda functions. Present the results to the user.
If any check fails, tell the user exactly what to fix and stop. If all pass, proceed directly to asking the user for their S3 paths.
DO NOT fall back to shell commands. DO NOT offer the user choices about how to check prerequisites. The MCP tool does everything — just call it and present results.
If infrastructure is not deployed:
"The remote execution infrastructure is not deployed. I'll help you set it up — it takes about 5 minutes and costs nothing when idle."
Then guide through deployment using the aws-transform power's remote execution flow.
If all prereqs pass, proceed directly to asking the user for their S3 paths. Do NOT ask the user to manually run checks — use the MCP tools automatically.
This power includes an MCP server (ezt-transform-mcp) that handles all
deterministic orchestration. The LLM's role is limited to:
- Understanding what the user wants (conversational)
- Collecting inputs (S3 paths, BRE review confirmation)
- Calling the MCP tools in sequence
- Presenting results in plain language
| Tool | What it does |
|---|---|
ezt_check_prereqs |
Verifies credentials, infrastructure, container image, TDs |
ezt_prepare_workspace |
Downloads from S3, organizes 4-folder structure, zips, uploads |
ezt_run_bre |
Submits BRE extraction job via Lambda |
ezt_run_transform |
Submits transformation job — REFUSES if bre-doc/ is empty |
ezt_check_status |
Polls job status, extracts conversation ID for recovery |
ezt_resume_job |
Resumes interrupted job with conversation ID |
ezt_get_results |
Retrieves S3 paths, validation status, download commands |
ezt_run_batch |
Submits up to 128 programs in parallel |
ezt_check_prereqs()
→ ezt_prepare_workspace(source, input, output, programName)
→ ezt_run_bre(workspaceS3Path, programName)
→ ezt_check_status(jobId) [poll until SUCCEEDED]
→ [user reviews BRE]
→ ezt_prepare_workspace(source, input, output, breDocPath, programName)
→ ezt_run_transform(workspaceS3Path, programName)
→ ezt_check_status(jobId) [poll until SUCCEEDED]
→ ezt_get_results(jobId)
If any job times out: ezt_check_status returns the conversationId →
call ezt_resume_job instead of resubmitting.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Epic 1 │─▶│ Epic 2 │─▶│ Epic 3 │─▶│ Epic 4 │─▶│ Epic 5 │
│ Setup Infra │ │ Create TDs │ │ Generate BRE │ │ Prepare Data │ │ Validate + │
│ │ │ │ │ │ │ + Transform │ │ Deliver │
└──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
one-time one-time per workload per workload per workload
- Deploy
AtxInfrastructureStack(Lambda + Batch + S3) - MUST use pre-built image:
public.ecr.aws/d9h8z6l7/aws-transform:latest - Requires: VPC with private subnets + NAT Gateway
- ~5 min deploy, costs nothing when idle
- Clone APG repo documents
- Create BRE TD and Main TD via
atx jsonin-chat flow - Publish both — reused for all future EZT workloads
This step CANNOT be skipped. The BRE drives transformation accuracy.
- Zip EZT source → upload to managed S3 bucket
- Submit BRE job via Lambda
- Monitor until complete
- Download BRE, place in
bre-doc/ - Human review gate — user must confirm BRE before proceeding
Gate: Verify bre-doc/ folder contains the BRE output. If empty → stop, go back to Epic 3.
- Zip full workspace (source-code/ + bre-doc/ + input-data/ + output-data/)
- Submit transformation job with
environment:{"JAVA_VERSION":"17"} - ~10 min per program (pre-built image, no install delays)
- AWS Transform generates Java, builds with Maven, validates byte-by-byte
- Results in S3:
code.zip(Java project) +logs.zip(conversation) - Review knowledge items for continuous improvement
CRITICAL: When a job times out or token expires, NEVER restart from scratch. Always recover the existing session.
Every job response includes a conversation ID in the output path:
s3://atx-custom-output-{account}/transformations/{job}/{conversation-id}/
Store this. Also available from CloudWatch logs:
aws logs filter-log-events --log-group-name /aws/batch/atx-transform \
--log-stream-name <logStreamName> \
--filter-pattern "Conversation log" --limit 1If a job timed out or was interrupted:
aws lambda invoke --function-name atx-trigger-job \
--payload '{"source":"s3://atx-source-code-{account}/repos/{project}.zip",
"command":"atx --conversation-id {conversation-id}",
"jobName":"EZT-{program}-resume",
"environment":{"JAVA_VERSION":"17"}}' \
--cli-binary-format raw-in-base64-out /dev/stdoutOr use atx --resume to continue the most recent conversation:
"command":"atx --resume"Never start a new session when one was interrupted. Always resume.
| File | Inclusion | When active |
|---|---|---|
td-bootstrap.md |
manual | No TD exists — Epics 1-2 |
bre-extraction.md |
manual | TD exists, starting workload — Epic 3 |
transform-validate.md |
manual | BRE complete — Epics 4-5 |
troubleshooting.md |
manual | Validation fails, timeouts, or errors |
Important: The critical workflow gates (BRE required, baseline required) are
enforced BOTH in this POWER.md file AND via the ezt-workflow-enforcement hook.
This means even if a steering file fails to load, the enforcement still applies.
The steering files provide detailed step-by-step guidance but the guardrails
are not dependent on them.
- Check if TDs exist (
atx custom def list) → if not, loadtd-bootstrap.md - If TDs exist but
bre-doc/is empty → loadbre-extraction.md - If
bre-doc/has content AND user approved it → loadtransform-validate.md - On failure/timeout → load
troubleshooting.md
Hard enforcement: NEVER load transform-validate.md unless BRE output exists
in the workspace. Check bre-doc/ folder — if empty, force bre-extraction.md.
Activate when the user mentions Easytrieve, EZT, mainframe batch transformation,
or drops .ezt, .mac, or .jcl files. Greet with:
"Let's get your Easytrieve transformation started. I need three things:
- EZT source — S3 path with your .ezt/.jcl/.mac files
- Input data — S3 path to mainframe batch input (EBCDIC)
- Baseline output — S3 path to mainframe output from running the job (EBCDIC)
I'll handle workspace setup, BRE extraction, Java transformation, and byte-by-byte validation — all running serverless on AWS Batch."
- Never expose internal mechanics — present outcomes, not process
- Refer to jobs by name, not raw IDs
- Always ask for S3 paths — never assume locations
- Present batch results with CloudWatch dashboard link
- On timeout/interruption: always resume, never restart
- Never proceed to transformation without BRE completed and human-approved
- Never proceed without baseline output files in
output-data/ - Never auto-approve agent checkpoints — present to user first
- Never hardcode TD names — discover dynamically
- Never restart a timed-out session — always resume with conversation ID
- Never run transformation without pre-built container image verified
- On goal shift, suggest new chat session
BRE ENFORCEMENT (inline — do not rely on steering files for this):
Before submitting ANY atx custom def exec -n Easytrieve-to-Java-Transformation job,
you MUST verify that the bre-doc/ folder in the workspace zip is non-empty.
If it is empty or missing, STOP and tell the user:
"The Business Rule Extract hasn't been generated yet. This is a required step — it extracts the business logic from your EZT source and drives the accuracy of the Java transformation. Let me run the BRE step first."
Then run the BRE extraction (Epic 3) before proceeding. This check applies regardless of which steering file is loaded or whether steering files loaded at all.
{
"name": "EZT Validation Gate",
"version": "1.0.0",
"description": "Confirms BRE and baseline output exist before transformation runs",
"when": {
"type": "userTriggered"
},
"then": {
"type": "askAgent",
"prompt": "Check that: (1) bre-doc/ contains the BRE output from Epic 3, and (2) output-data/ contains baseline mainframe output files. If EITHER is missing, stop and tell the user which step they need to complete first."
}
}