Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

rust-port

Skill by morganlinton

Ports code from C, C++, Python, Go, JavaScript, or TypeScript into idiomatic Rust that keeps the original behavior. It is for developers who want to move a module or function to Rust and check that the port matches the original.

  • Score 94
  • 2.1k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install rust-port

Built from the published package, never by AI.

git clone --depth 1 https://github.com/morganlinton/BeautifulRust /tmp/BeautifulRust && mkdir -p ~/.claude/skills && cp -r /tmp/BeautifulRust/skills/rust-port ~/.claude/skills/rust-port

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install rust-port in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

rust-port is an agent skill that guides an AI assistant in porting code from C, C++, Python, Go, JavaScript, or TypeScript into idiomatic Rust. It asks the assistant to list the original behavior first, including quiet details like ordering, empty input, and error cases. The port keeps that behavior while replacing manual memory with ownership, error codes and exceptions with Result, and flag ints or magic strings with enums.

Written from the project's SKILL.md and checked against it.

What it can do

  • Behavior listingLists the original's public functions, inputs, outputs, and failure modes before writing any Rust.
  • Test portingTranslates the original tests into Rust tests first, one per original test, so coverage can be checked.
  • Rust API designChooses public types and signatures from the behavior list rather than copying the original's structure.
  • C and C++ mappingMaps malloc, NULL, error codes, out-parameters, and flag bitmasks to Rust equivalents.
  • Python mappingMaps exceptions, None, string sets, dicts, and sorting to enums, Option, structs, and stable sorts.
  • Go, JavaScript, and TypeScript mappingMaps Go error returns, nil, null, undefined, and thrown errors to Result, Option, and structs.
  • Proportionate portingKeeps the original algorithm and API surface, and uses Rust's standard library instead of copying runtime behavior.
  • VerificationRuns cargo build, cargo test, and cargo clippy with warnings treated as errors, when a toolchain is available.
  • PORTING.md notesWrites a review document with API and test mappings, deliberate differences, preserved quirks, and verification results.

What you need

  • A Rust toolchain with cargo, for building and testing the port
  • The rust-best-practices skill, if installed, for Rust style

Try asking

  • Port this Python module to Rust and keep the original behavior
  • Rewrite this C parser in Rust and map its error codes to an enum
  • Move this TypeScript utility to Rust and write tests that match the original

Good to know

  • Verification steps run only if a Rust toolchain is available
  • Bugs or ambiguities in the original are kept and flagged, not fixed
  • Unsafe code and raw pointers are used only when FFI to C requires them
  • Exotic input where Rust's standard library differs is listed in the notes, not coded around

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/rust-port/SKILL.md, skills/rust-port/evals/port-c-config-parser/place-files.sh, skills/rust-port/evals/port-python-task-graph/files/taskgraph.py, skills/rust-port/evals/port-python-task-graph/files/test_taskgraph.py, skills/rust-port/evals/port-python-task-graph/place-files.sh. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md8 KB
  • evals/port-c-config-parser/case.yaml663 B
  • evals/port-c-config-parser/files/config.c5 KB
  • evals/port-c-config-parser/files/config.h1 KB
  • evals/port-c-config-parser/files/test_config.c3 KB
Show all 34 files
  • evals/port-c-config-parser/graders/01-builds-and-tests-pass.md114 B
  • evals/port-c-config-parser/graders/02-clippy-clean.md89 B
  • evals/port-c-config-parser/graders/03-no-unsafe.md96 B
  • evals/port-c-config-parser/graders/04-every-test-ported.md289 B
  • evals/port-c-config-parser/graders/05-errors-as-result.md209 B
  • evals/port-c-config-parser/graders/06-error-implements-error.md108 B
  • evals/port-c-config-parser/graders/07-option-for-absent.md185 B
  • evals/port-c-config-parser/graders/08-typed-flags.md144 B
  • evals/port-c-config-parser/graders/09-behavior-preserved.md320 B
  • evals/port-c-config-parser/graders/10-porting-notes.md183 B
  • evals/port-c-config-parser/graders/11-proportionate.md467 B
  • evals/port-c-config-parser/place-files.sh62 B
  • evals/port-c-config-parser/prompt.md459 B
  • evals/port-python-task-graph/case.yaml628 B
  • evals/port-python-task-graph/files/taskgraph.py4 KB
  • evals/port-python-task-graph/files/test_taskgraph.py3 KB
  • evals/port-python-task-graph/graders/01-builds-and-tests-pass.md114 B
  • evals/port-python-task-graph/graders/02-clippy-clean.md89 B
  • evals/port-python-task-graph/graders/03-every-test-ported.md206 B
  • evals/port-python-task-graph/graders/04-exceptions-as-error-enum.md252 B
  • evals/port-python-task-graph/graders/05-kind-is-enum.md134 B
  • evals/port-python-task-graph/graders/06-priority-is-option.md105 B
  • evals/port-python-task-graph/graders/07-definition-order-preserved.md204 B
  • evals/port-python-task-graph/graders/08-order-and-cycle-match.md187 B
  • evals/port-python-task-graph/graders/09-summary-every-kind-in-order.md146 B

And 4 more files on GitHub.

Alternatives to rust-port

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

rust-port: common questions

Which languages can it port from?

The skill covers C, C++, Python, Go, JavaScript, and TypeScript. It includes mapping tables for each of these languages.

Does it only translate the code line by line?

No. The skill says a line-by-line translation keeps the original's problems, so it ports the behavior and designs a new Rust API.

What does it produce besides the Rust code?

It writes a PORTING.md file with API and test mappings, deliberate differences, preserved quirks, and the verification commands it ran.

How do I install rust-port?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is rust-port free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is rust-port safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to rust-port?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

rust-port Install

Add to stack

Loading.