module-level-code-translator
Installation
SKILL.md
Module-Level Code Translator
Single-function translation (→ code-translation) is clean. Module translation is messy: imports, circular deps, visibility, file boundaries, and the build system all get involved. This is about the glue.
Module concerns that function-level misses
| Concern | Why it matters |
|---|---|
| Import/export structure | Python __init__.py ≠ Java package ≠ Go package ≠ Rust mod. What's public? |
| File ↔ unit mapping | Java: one public class per file. Python: anything goes. Go: package = dir. |
| Circular imports | Python tolerates them at runtime. Go/Rust don't compile. Java barely does. |
| Visibility | Python _private convention. Java private/package/protected/public. Go capitalization. Rust pub/pub(crate). |
| Module-level state | Python module-level vars are singletons. Java needs a class. Go var. Rust static/lazy_static. |
| Build integration | setup.py/pyproject.toml → pom.xml/build.gradle → go.mod → Cargo.toml |
Step 1 — Build the module dependency graph
Before translating anything, map out what depends on what within the module: