Mainframe Modernization Toolkit
Deterministic tools and agent instructions for migrating a JCL-bounded COBOL workload to Python or PySpark.
The toolkit discovers source relationships, validates configuration and record layouts, extracts SQL and business rules, generates typed boundaries, compiles validated relational IR to PySpark, and compares final outputs with an authoritative Golden Dataset. It does not invent missing source semantics.
Install
Python 3.10 or newer is required.
python -m pip install mainframe-modernization-toolkit
mainframe-toolkit --version
Optional runtime dependencies:
python -m pip install "mainframe-modernization-toolkit[pyspark]"
python -m pip install "mainframe-modernization-toolkit[aws]"
Initialize A Workspace
mainframe-toolkit workspace init . --target vscode
mainframe-toolkit workspace init . --target claude
mainframe-toolkit workspace init . --target all
The initializer adds mainframe-migration.json, JSON schemas, and the selected agent integration without overwriting existing files. Configure source directories, encoding, extensions, known external dependencies, transport profiles, environment facts, and targetCapabilities in mainframe-migration.json.
For Claude Code, verify the project MCP server with claude mcp list or /mcp.
Migration Workflow
A migration starts from one JCL. A compact campaign inventories the job, then processes one program at a time so large jobs do not produce one huge preflight response.
mainframe-toolkit run migration_campaign -- init . --jcl MYJOB --format json
mainframe-toolkit run migration_campaign -- next . --jcl MYJOB --worker local --format json
For each selected program:
- Resolve dependencies, callers, copybooks, impact, and blockers.
- Generate canonical record contracts and readers.
- Extract SQL and business rules.
- Generate one program capsule containing machine-readable I/O and partial IR.
- Implement cohesive business logic and focused tests.
- Validate relational IR and compile PySpark when appropriate.
- Mark the program complete and claim the next one.
After all programs are implemented, compose the JCL pipeline and compare its final output with an authoritative Golden Dataset.
mainframe-toolkit validate-golden . --manifest validation/job-output.json --format json
Intermediate program outputs do not require Golden files when the migrated job passes DataFrames in process. Validate those boundaries with explicit contracts and focused tests.
Core Commands
| Command | Purpose |
|---|---|
migration_preflight |
Validate sources, references, environment, scope, and target capabilities. |
migration_campaign |
Track compact program-at-a-time progress for one JCL. |
dependency_graph |
Build CALL, COPY, and EXEC relationships. |
impact_analysis |
Calculate transitive impact. |
dead_code_finder |
Find unreferenced migration candidates. |
jcl_flow_extractor |
Extract JCL flow and generate a local runner. |
migration_complexity_report |
Order programs by deterministic risk. |
copybook_to_contract |
Generate canonical record contracts. |
copybook_to_dataclass |
Generate Python boundary models. |
generate_copybook_fixtures |
Generate ingestion-only test records. |
generate_file_readers |
Generate contract-based readers. |
sql_extractor |
Extract SQL and host variables. |
business_rule_extractor |
Extract conditional rules with source locations. |
characterization_test_scaffolder |
Generate a starting characterization test. |
generate_program_capsule |
Generate a program manifest, contracts, and partial IR. |
validate_relational_ir |
Validate typed relational IR. |
ir_to_pyspark |
Compile executable IR to PySpark. |
golden_validate |
Compare authoritative expected and actual CSV files. |
Run any command through the stable entry point:
mainframe-toolkit run <command> -- <arguments>
AWS Glue And Local PySpark
Use the aws-glue-pyspark starter profile when creating a new configuration:
mainframe-toolkit run migration_preflight -- . --write-template --profile aws-glue-pyspark
Keep transformations in transform_frames(). Production wrappers can use Glue Catalog, S3, and Iceberg descriptors; local runners can load semicolon-delimited CSV files with explicit schemas and invoke the same transformations.
The toolkit does not provision AWS resources. IAM, Lake Formation, buckets, Glue jobs, Catalog tables, bookmarks, connectors, and Iceberg configuration belong in deployment infrastructure.
Safety Boundaries
- Missing copybooks, PROCs, conflicting sources, parse failures, and unsafe layouts block the affected migration.
- Unknown external programs remain explicit adapter TODOs.
- Synthetic fixtures validate ingestion, not business equivalence.
- Only mainframe output or a verified equivalent implementation is an authoritative Golden Dataset.
- Generated relational IR with TODOs is non-executable.
See docs/JCL-MIGRATION-GUIDE.md for the concise end-to-end procedure.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mainframe_modernization_toolkit-0.1.19.tar.gz.
File metadata
- Download URL: mainframe_modernization_toolkit-0.1.19.tar.gz
- Upload date:
- Size: 5.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8134485bd9b1393ec07a3299f4c9a1700953d2ee67af6e4a4b0ca6afc1f308ed
|
|
| MD5 |
35f57988a99daa0c9475e56fca089bbd
|
|
| BLAKE2b-256 |
b7db763cecf8b2233d184c56f31d04cc6ce3f34e128008f8f3cd8a4c7e9805d1
|
File details
Details for the file mainframe_modernization_toolkit-0.1.19-py3-none-any.whl.
File metadata
- Download URL: mainframe_modernization_toolkit-0.1.19-py3-none-any.whl
- Upload date:
- Size: 5.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c04c6d0d955f5155d4080e5202cddcfcf8c9c4b02865b6f78b576e88e3089c6a
|
|
| MD5 |
1fbe8afaffa95954717394f904ea8d2e
|
|
| BLAKE2b-256 |
3cd5e59351320353a4741d11ac8f4532fd69a3febc09b3d42ab88c67539c65ec
|