Rust Port
Guides Claude to port C/C++, Python, Go, or JS/TS code into idiomatic Rust while preserving the original observable behavior.
Dev & CodingIntermediate★ 1,618⑂ 82AI score 9/10Last updated: Oct 30, 2026
What it does
- Forces a behavior inventory first: public functions, inputs, outputs, failure modes, result ordering, empty-input handling, integer limits.
- Ports the tests before the implementation, one Rust test per original test, so "same behavior" is provable.
- Supplies per-language mapping tables:
NULL→Option, error codes/exceptions→Result+ error enum, flag bitmasks→options struct, magic strings→enums, Go(value, error)→Result, goroutines→threads/mpsc. - Keeps the port proportionate: don't reimplement the source runtime, don't grow the public API, check code-size ratios (C/C++ ≈ original, Python/JS ≈ 2–3×).
- Verifies with
cargo build,cargo test,cargo clippy --all-targets -- -D warnings, then writes a reviewer-friendlyPORTING.mdwith API/test mappings, deliberate differences, and preserved quirks.
Who it's for
- Engineers migrating C/C++ modules or Python scripts to Rust.
- Rust learners asking "what would this look like in Rust?"
- Reviewers who need a concise diff-of-behavior document for a port.
Examples
- "Rewrite this C parser in Rust" → error codes and out-parameters collapse into
Result<T, ParseError>; fixed buffers becomeString/Vec. - "Move this Python utility module to Rust" → the exception hierarchy becomes one error enum, dict-order-dependent output becomes a
Vecor ordered map, with matching tests. - "What would this Go worker look like in Rust?" → interfaces become traits, channels become
std::sync::mpsc, and divergences land inPORTING.md.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/morganlinton/BeautifulRust/HEAD/skills/rust-port/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the skills/rust-port folder from the GitHub repo morganlinton/BeautifulRust into my ~/.claude/skills/rust-port/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/morganlinton/BeautifulRust.git /tmp/BeautifulRust && mkdir -p ~/.claude/skills && cp -r /tmp/BeautifulRust/skills/rust-port ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/morganlinton/BeautifulRust.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r BeautifulRust/skills/rust-port ~/.claude/skills/ - (Recommended) Also copy the
rust-best-practicesskill from the same repo — this skill defers to it for code style. - Install a Rust toolchain from https://rustup.rs if you don't have one; the verification step needs
cargo. - Restart Claude Code and ask something like "port this file to Rust" — the skill triggers automatically.
View source on GitHub ↗License: MIT