rust-port
Skill1.8k starsChanged 12 days agoMITView on GitHub
Port code from C, C++, Python, Go, JavaScript, or TypeScript into idiomatic Rust that keeps the original behavior: ownership instead of manual memory, Result instead of error codes and exceptions, enums instead of flag ints and magic strings, and tests that prove the port matches. Use this whenever the user asks to port, translate, convert, migrate, or rewrite code in Rust ("rewrite this in Rust", "what would this look like in Rust", "move this module to Rust"), even if they don't say "port". Pairs with the rust-best-practices skill, which covers the target code's style.
7 other projects use a version of this, 1 of them edited; 2 new projects in the last 4 weeks, against 0 the 4 before.
Adopted by
Surging: 2 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- XGENT-ai/skillsword for word, first seen Nov 8, 2026
- po4yka/rust-skillstheir own version, first seen Nov 8, 2026
- promptctl/cc-candybartheir own version, first seen Nov 8, 2026
- weedmo/skillstheir own version, first seen Nov 8, 2026
- kabudu/engineering-agent-skillstheir own version, first seen Nov 1, 2026
- fedemelo/agent-configedited, first seen Nov 1, 2026
Who's talking about morganlinton/BeautifulRust
- Beeknoee AI“Beautiful Rust: repo 3 ngày hơn 1.000 sao dạy AI viết Rust chuẩn — và người viết nó là Claude”YouTube · Oct 27, 2026 · 3.1k views
- Daksh“AI Now Writes Perfect Rust Code #shorts”YouTube · Oct 29, 2026 · 975 views
- 오늘 뜬 레포“AI는 면허만 있고 연수가 없다 | BeautifulRust”YouTube · Oct 30, 2026 · 943 views
- No Short Answers“Can AI write beautiful Rust? #shorts”YouTube · Oct 27, 2026 · 181 views
- Alex Hitt“BeautifulRust GitHub Explained: Agent Skills for Idiomatic Rust Code”YouTube · Oct 27, 2026 · 180 views
The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 51
Talked about on GitHub, YouTube and the web (51 times).
On GitHub · 34
- Nov 9, 2026codex-plugins.github.morganlinton.beautifulrust: init at 1.6.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026codex-marketplaces.github.morganlinton.beautifulrust: 1.5.0 → 1.6.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026agent-skills.github.morganlinton.beautifulrust: 1.5.0 → 1.6.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026claude-code-marketplaces.github.morganlinton.beautifulrust: 1.5.0 → 1.6.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026claude-code-plugins.github.morganlinton.beautifulrust: 1.5.0 → 1.6.0 — sudosubin/agents.nix0 reactions
29 more on GitHub
- Nov 8, 2026agent-plugins.github.morganlinton.beautifulrust: 1.5.0 → 1.6.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026Import: Trail of Bits rust-review and BeautifulRust — LeszekKantorek/skills-library0 reactions
- Nov 6, 2026Simplify code to follow Rust idioms — dwim-sh/dwim0 reactions
- Nov 2, 2026flake: bump the flake-inputs group across 1 directory with 16 updates — vidhanio/vidhanix0 reactions
- Nov 2, 2026Promo kit — week of 02 Nov 2026 — pahadiji/star-catcher0 reactions
- Nov 1, 2026agent-plugins.github.morganlinton.beautifulrust: init at 1.5.0 — sudosubin/agents.nix0 reactions
- Nov 1, 2026codex-marketplaces.github.morganlinton.beautifulrust: init at 1.5.0 — sudosubin/agents.nix0 reactions
- Oct 30, 2026flake: bump the flake-inputs group across 1 directory with 8 updates — vidhanio/vidhanix0 reactions · 1 comment
- Oct 30, 2026Investigate the Beautiful Rust Claude skills for Rust workers — Glubiz/zirv-cli0 reactions
- Oct 30, 2026claude-code-plugins.github.morganlinton.beautifulrust: 1.4.0 → 1.5.0 — sudosubin/agents.nix0 reactions
- Oct 30, 2026agent-skills.github.morganlinton.beautifulrust: 1.4.0 → 1.5.0 — sudosubin/agents.nix0 reactions
- Oct 30, 2026claude-code-marketplaces.github.morganlinton.beautifulrust: 1.4.0 → 1.5.0 — sudosubin/agents.nix0 reactions
- Oct 30, 2026Update Rust coding guidelines — Cosmian/kms0 reactions · 1 comment
- Oct 29, 2026[m23] Idiomatic Rust lints — fahchen/pbeam0 reactions
- Oct 28, 2026claude-code-plugins.github.morganlinton.beautifulrust: init at 1.4.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026claude-code-marketplaces.github.morganlinton.beautifulrust: init at 1.4.0 — sudosubin/agents.nix0 reactions
- Oct 28, 2026flake: bump the flake-inputs group across 1 directory with 16 updates — vidhanio/vidhanix0 reactions · 2 comments
- Oct 27, 2026flake: bump the flake-inputs group across 1 directory with 14 updates — vidhanio/vidhanix0 reactions · 1 comment
- Oct 27, 2026flake: bump the flake-inputs group across 1 directory with 13 updates — vidhanio/vidhanix0 reactions · 1 comment
- Oct 27, 2026scan: 2026-10-27 daily discovery — mattbutlerengineering/ai-tooling0 reactions
- Oct 26, 2026Adopt BeautifulRust's clippy configuration and rust-review skill — imaimai17468/hypersig0 reactions
- Oct 26, 2026chore: adopt the BeautifulRust lint config — wormholesystems/wormholesystems0 reactions
- Oct 26, 2026Promo kit — week of 26 Oct 2026 — pahadiji/star-catcher0 reactions
- Oct 26, 2026agent-skills.github.morganlinton.beautifulrust: 1.2.0 → 1.4.0 — sudosubin/agents.nix0 reactions
- Oct 26, 2026[Candidate] morganlinton/beautifulrust/skills/rust-port - rust-port — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 25, 2026Make exported note filenames safe on macOS, Linux and Windows — qoodeng/dahlia0 reactions
- Oct 25, 2026agent-skills.github.morganlinton.beautifulrust: init at 1.2.0 — sudosubin/agents.nix0 reactions
- Oct 25, 2026[Candidate] morganlinton/beautifulrust/skills/rust-review - rust-review — ProSkillsMD/proskills0 reactions · 1 comment
- Oct 24, 2026[Candidate] morganlinton/beautifulrust/skills/rust-best-practices - rust-best-practices — ProSkillsMD/proskills0 reactions · 1 comment
On YouTube · 15
- Oct 27, 2026Beautiful Rust: repo 3 ngày hơn 1.000 sao dạy AI viết Rust chuẩn — và người viết nó là Claude — Beeknoee AI3.1k views · 4 comments
- Oct 29, 2026AI Now Writes Perfect Rust Code #shorts — Daksh975 views
- Oct 30, 2026AI는 면허만 있고 연수가 없다 | BeautifulRust — 오늘 뜬 레포943 views
- Oct 27, 2026Can AI write beautiful Rust? #shorts — No Short Answers181 views · 1 comment
- Oct 27, 2026BeautifulRust GitHub Explained: Agent Skills for Idiomatic Rust Code — Alex Hitt180 views
10 more on YouTube
- Oct 27, 2026🔥 ИИ проверяет решения, идиоматичный Rust с ИИ и картинки из узлов - находки GitHub #shorts #github — GitHub HighLights172 views
- Oct 26, 2026Your agent writes Rust that compiles, with public struct fields and unwrap inside the doc examples. — gitpeek119 views
- Oct 26, 2026Make Claude write idiomatic Rust instantly 🤖 — LookOnThisGit112 views · 1 comment
- Oct 29, 2026Uncle Bob ki AI Skill: Claude Code ab Clean Code likhega | ub-mode, tstack, Beautiful Rust (Hindi) — tech how it works44 views
- Nov 1, 2026Your AI writes bad Rust. This free skill fixes it (Beautiful Rust) — RocketLauncher Code42 views
- Oct 30, 2026【BeautifulRust】Codex に Rust 作法スキルを置くだけで自分から読んで作法の警告が 17→6 に減った|テストと素の clippy は入れなくても満点だった — さつきのOSS研究室32 views · 1 comment
- Oct 26, 2026【GitHub AIデイリー】2026-10-27(火) 首位は2日連続/magpieが2位 — シンオン株式会社 (Synon,Inc) 公式31 views
- Oct 31, 2026Esta skill de Claude escribe Rust bonito y sin unwrap 🦀 Beautiful Rust — BarbuPrime IA | Claude Code Vs Codex21 views · 1 comment
- Nov 1, 2026Beautiful Rust: skills que ensinam agentes a escrever Rust idiomático — Byte Cortes9 views
- Oct 25, 2026【GitHub AIデイリー】2026-10-26(月) 首位が交代/opuscarが2位に — シンオン株式会社 (Synon,Inc) 公式8 views
On the web · 2
- Nov 3, 2026Beautiful Rust: Claude Skills for Idiomatic Rust Code — prompthackers.co
- Oct 27, 2026BeautifulRust: 3 Agent Skills for Idiomatic Rust (2026) | explainx.ai Blog | explainx.ai — explainx.ai
Other versions7 projects use a version of this.
Word for word · 2
- tuan3w/herdr-mobile★ 29100% same
- XGENT-ai/skills★ 1100% same
Edited · 1
- fedemelo/agent-config★ 499% same
Wrote their own version · 4
- po4yka/rust-skills★ 5same name
- kabudu/engineering-agent-skills★ 3same name
- weedmo/skills★ 1same name
- promptctl/cc-candybar★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- rust-best-practicesSkill
- rust-reviewSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
List the observable behavior: every public function, its inputs, its outputs, and every way it can fail.
- Distinctive: line 31
If the original has a bug or an ambiguity, keep its behavior, flag it in the porting notes, and let the user decide.
- Very specific: line 62
Don't write unsafe or use raw pointers unless the port must talk to C through FFI, and then confine it as the rust-best-practices skill …
- Very specific: line 93
Don't reimplement the source language's runtime: Use str::lines, str::trim, str::parse, and char methods, not hand-written copies of …
- Distinctive: line 118
Run these if a Rust toolchain is available, and fix everything before reporting:
- Distinctive: line 126
Every ported test must pass.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust port
The goal is the Rust a Rust developer would have written to solve the same problem, with
the same observable behavior. A line-by-line transliteration (C written in Rust syntax,
or Python with Box<dyn Any>) compiles but keeps every problem the original had and adds
the borrow checker on top. Port the behavior, not the structure.
1. Understand the original before writing anything
- Read the code and its tests, and anything that calls it, if you have it.
- List the observable behavior: every public function, its inputs, its outputs, and every way it can fail. Include the quiet parts, which are where ports go wrong: ordering of results, how ties break, what happens on empty input, whitespace and case handling, integer limits, and what counts as an error versus a valid edge case.
- Note what is incidental, meaning things the original only does because of its
language: manual memory management, out-parameters,
NULLreturns, global state, fixed-size buffers, a class that exists only to group functions, orisinstancechecks. These don't carry over. - If the original has a bug or an ambiguity, keep its behavior, flag it in the porting notes, and let the user decide. A port is not the place to silently fix things.
2. Port the tests first
Translate the original tests into Rust tests before porting the implementation. Keep one Rust test per original test, with a name that maps back to it, so a reader can check coverage. The tests are the definition of "same behavior". If the original has no tests, write characterization tests from the behavior list in step 1.
3. Design the Rust API, then implement it
Decide the public types and signatures from the behavior list, not from the original's shape. Then implement against the ported tests.
From C and C++
| In the original | In Rust |
malloc/free, new/delete, create/destroy pairs | Owned types (String, Vec, Box) dropped automatically; Drop for anything else |
NULL meaning "absent" | Option<T> |
Error codes (-1, ERR_* defines), errno | Result<T, E> with an error enum, one variant per code, implementing Display and std::error::Error |
Out-parameters (int *err_line, long *out) | Return values: put the data in the Ok value or the error variant |
Flag bitmasks (FLAG_A | FLAG_B) | An options struct with named fields and Default, or the bitflags crate; never a raw u32 |
char * plus length, strcmp, strcasecmp | &str/String, ==, eq_ignore_ascii_case |
| Pointer plus count, iterator by index | Slices, iterators |
| Fixed-size buffers and their truncation | Growable types; drop the limit unless the limit is behavior |
#define constants and macros | const, enums, and functions |
| Global or static mutable state | A struct the caller owns |
strtol and friends | str::parse with the matching integer type; map parse failures to your error enum |
Don't write unsafe or use raw pointers unless the port must talk to C through FFI, and
then confine it as the rust-best-practices skill describes.
From Python
| In the original | In Rust |
| An exception hierarchy | One error enum (or one per area) with a variant per exception class; data attributes become variant fields |
None as a value | Option<T> |
Strings used as a closed set (kind in ("build", "test")) | An enum, with FromStr and Display for the text form |
| Dicts or classes used as records | Structs with named fields |
dict iteration order (insertion order is guaranteed) | Vec or an ordered map when order is observable; a plain HashMap silently changes output order |
Duck typing, isinstance | Traits or enums |
Unbounded int | A sized integer chosen on purpose, with overflow handled (checked_*) where input can be large |
sorted(..., key=...) | sort_by_key or sort_by; both are stable, like Python's |
str.splitlines(), strip(), isalnum() | lines(), trim(), char::is_alphanumeric; check edge cases such as \r\n, Unicode, and empty strings against the original |
try/except around a parse | ? with a mapped error, or match on the Result |
From Go, JavaScript, and TypeScript
- Go
(value, error)returns becomeResult;nilbecomesOption; interfaces become traits; goroutines and channels become threads withstd::sync::mpscor async tasks, depending on what the original needs. - JavaScript
nullandundefinedbecomeOption; thrown errors becomeResult; plain objects become structs; numbers become a sized integer orf64, chosen on purpose.
4. Keep the port proportionate
A port that matches the original on every possible input is usually the wrong goal. Match it on the inputs it actually receives, and use Rust's standard library for the rest.
- Don't reimplement the source language's runtime. Use
str::lines,str::trim,str::parse, andcharmethods, not hand-written copies of Python'ssplitlines,strip,int(), orrepr(), or of C's locale-dependentisspaceandstrtol. Where Rust's behavior differs only on exotic input, such as Unicode digits, non-ASCII whitespace, or unbounded integers, list the difference in the porting notes instead of coding around it. Write a compatibility shim only when the user says those inputs occur. - Don't grow the API. Port the public surface the original has, plus the standard
trait impls Rust callers expect (
Debug,Clone,Display,Error,FromStr,Default, andIntoIteratorfor collections). Skip builders,Indeximpls,FromIterator,Extend, and custom iterator types unless the original's callers need them. - Keep the algorithm unless it's wrong. Swap in a different algorithm only to fix a real problem, such as quadratic behavior on realistic input, and say so in the notes.
- Check the size. Count code lines, excluding tests, comments, and doc comments. A port from C or C++ usually lands near the original's size. A port from Python or JavaScript usually lands at two to three times the original, because types, error enums, and their trait impls are explicit in Rust. Much more than that usually means one of the three habits above.
Differential testing against the original is worth doing, but a few dozen realistic and edge-case inputs answer the question. A fuzzing harness over millions of inputs usually just finds exotic divergences that belong in the notes.
5. Verify
Run these if a Rust toolchain is available, and fix everything before reporting:
cargo build
cargo test
cargo clippy --all-targets -- -D warningsEvery ported test must pass. If the original's tests can be run too, run them and compare results on the same inputs.
6. Write the porting notes
Alongside the code, write a short PORTING.md that a reviewer can check in a few
minutes:
- API mapping: a table from each original function or type to its Rust equivalent.
- Test mapping: each original test and the Rust test that covers it.
- Deliberate differences: anything that now behaves differently and why, such as an out-of-memory error that no longer exists, a fixed buffer limit that's gone, or exotic input where Rust's standard library behaves differently from the original's.
- Preserved quirks: odd behavior kept on purpose, so nobody "fixes" it by accident.
- Verification: which commands you ran and their result, or a plain statement that you couldn't run them.
For the style of the Rust itself, follow the rust-best-practices skill if it is
installed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

