Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Rust agent-skillsclaude-codeclicode-migrationcodexffigolangjavajavascriptmcpmigrationnapiperformanceportingpyo3pythonrewriterubyrusttypescript
"""What the tool reads from its environment."""
import os
import subprocess
def load_port():
return int(os.environ.get("PORT", "8080"))
def load_home():
return os.getenv("TOOL_HOME", "/tmp/tool")
def debug_enabled():
return "TOOL_DEBUG" in os.environ
def prepare():
# Writing a variable and handing the whole environment down are not reads.
os.environ["TOOL_STARTED"] = "1"
subprocess.run(["true"], env=os.environ, check=False)