AI Skill MartBrowse skillsPromptsProgramsLearnWhat is a Skill?
← Back to list

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-friendly PORTING.md with 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

  1. "Rewrite this C parser in Rust" → error codes and out-parameters collapse into Result<T, ParseError>; fixed buffers become String/Vec.
  2. "Move this Python utility module to Rust" → the exception hierarchy becomes one error enum, dict-order-dependent output becomes a Vec or ordered map, with matching tests.
  3. "What would this Go worker look like in Rust?" → interfaces become traits, channels become std::sync::mpsc, and divergences land in PORTING.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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download 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.

  1. Open a terminal.
  2. Clone the repo: git clone https://github.com/morganlinton/BeautifulRust.git
  3. Create the skills directory: mkdir -p ~/.claude/skills
  4. Copy the skill: cp -r BeautifulRust/skills/rust-port ~/.claude/skills/
  5. (Recommended) Also copy the rust-best-practices skill from the same repo — this skill defers to it for code style.
  6. Install a Rust toolchain from https://rustup.rs if you don't have one; the verification step needs cargo.
  7. Restart Claude Code and ask something like "port this file to Rust" — the skill triggers automatically.