rust-java-migration

Installation
SKILL.md

Java to Rust Migration

Migrate contracts and observable behavior, not Java syntax. Preserve the Java project's public concepts and source traceability while selecting Rust-native ownership, error, concurrency, async, serialization, and framework mechanisms.

Mandatory migration layout

  • Derive the Rust directory from the Java package after the declared package root; preserve meaningful nested packages and never flatten, cross-place, or double-nest them.
  • Convert the Java object name to acronym-aware snake_case.rs; keep the Rust type in PascalCase and do not add suffixes such as _trait.
  • Keep one Java object as one Rust object boundary. Rust defines no universal file-length limit: treat up to 500 physical lines as normal, review 501–800 lines for cohesion, and block authored .rs files above 800 lines.
  • Split only when a file mixes responsibilities. Retain one primary object file and use subordinate files for coherent implementation families without introducing a second migrated object; record every split or reviewed exception.
  • Keep lib.rs and mod.rs to declarations and re-exports. Update parent modules after moves and qualify ambiguous external re-exports with ::.
  • Keep focused private-behavior unit tests in #[cfg(test)] modules when useful. Put public-boundary, cross-module, differential, host, and whole-project tests under tests/ or a non-published <project>-test package; keep source fixtures under <project>-test/tests/fixtures/.

Read Directory path alignment and Layout and governance, then run the layout audit after moves.

Scope and Routing

Use this skill for full-project migrations, one Maven/Gradle module, parity audits, migration planning, or continuation of an existing Rust port.

Installs
36
GitHub Stars
4
First Seen
Jul 27, 2026
rust-java-migration — full-stack-skills/rust-skills