Skip to content
Back to skills

To Java Migration

ASecurity

Migrate COBOL code to idiomatic Java, preserving business logic while following Java best practices. Use for COBOL modernization projects.

  • 151 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 5, 2026
testinggojavatestingdocumentation

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned June 5, 2026

npx -y skills add OpenHands/extensions --skill to-java-migration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of To Java Migration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for To Java Migration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/openhands-to-java-migration/badge)](https://www.skillsdirectory.com/skills/openhands-to-java-migration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: to-java-migration
description: Migrate COBOL code to idiomatic Java, preserving business logic while following Java best practices. Use for COBOL modernization projects.
license: MIT
compatibility: Requires Java 11+, Maven or Gradle
triggers:
  - cobol to java
  - cobol migration
  - cobol modernization
  - migrate cobol
---

Migrate COBOL code to idiomatic Java, preserving all business logic.

## Code Style Requirements

Write idiomatic Java, NOT literal COBOL translations:
- Use Java conventions: camelCase names, standard collections (List, Map)
- Use Java standard library instead of rolling your own
- No god classes — split into cohesive, single-responsibility classes
- No TODO comments or stub implementations — fully implement everything

## Robustness Requirements

- Validate inputs at method entry (null checks, range validation)
- Use try-catch for all I/O and external operations
- Use try-with-resources for files, streams, connections
- Handle errors gracefully with meaningful messages

## Configuration Requirements

- No hardcoded file paths or credentials — use environment variables
- No magic numbers — use named constants
- Make limits and timeouts configurable

## Documentation Requirements

- Add COBOL references: `// COBOL equivalent: BNK1CRA.cbl 145-167`
- Document assumptions made during conversion
- Add Javadoc to public methods

## Testing Requirements

If test fixtures exist (see `cobol-build-setup` skill):
- Create a JUnit test class for each migrated program
- Load inputs from fixtures, assert output matches expected (golden) output
- All tests must pass before migration is complete

## References

- See [references/cobol-to-java-example.md](references/cobol-to-java-example.md) for a complete transformation example
- See [references/datatype-mappings.md](references/datatype-mappings.md) for COBOL→Java type mappings

## Done When

✓ Code compiles without errors
✓ All JUnit tests pass (Java output matches COBOL golden output)
✓ No TODO or stub implementations remain
✓ COBOL references documented in comments

Files in this skill

  • SKILL.md2 KB
  • references/cobol-to-java-example.md1.5 KB
  • references/datatype-mappings.md609 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.